diff --git a/node_modules/ajv/lib/compile/validate/keyword.ts b/node_modules/ajv/lib/compile/validate/keyword.ts new file mode 100644 index 0000000000000000000000000000000000000000..f854aa71083ca28c01f8064fdca177a847e6f308 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/keyword.ts @@ -0,0 +1,171 @@ +import type {KeywordCxt} from "." +import type { + AnySchema, + SchemaValidateFunction, + AnyValidateFunction, + AddedKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, +} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen" +import N from "../names" +import type {JSONType} from "../rules" +import {callValidateCode} from "../../vocabularies/code" +import {extendErrors} from "../errors" + +type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction + +export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, it} = cxt + const macroSchema = def.macro.call(it.self, schema, parentSchema, it) + const schemaRef = useKeyword(gen, keyword, macroSchema) + if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true) + + const valid = gen.name("valid") + cxt.subschema( + { + schema: macroSchema, + schemaPath: nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, + valid + ) + cxt.pass(valid, () => cxt.error(true)) +} + +export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, $data, it} = cxt + checkAsyncKeyword(it, def) + const validate = + !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate + const validateRef = useKeyword(gen, keyword, validate) + const valid = gen.let("valid") + cxt.block$data(valid, validateKeyword) + cxt.ok(def.valid ?? valid) + + function validateKeyword(): void { + if (def.errors === false) { + assignValid() + if (def.modifying) modifyData(cxt) + reportErrs(() => cxt.error()) + } else { + const ruleErrs = def.async ? validateAsync() : validateSync() + if (def.modifying) modifyData(cxt) + reportErrs(() => addErrs(cxt, ruleErrs)) + } + } + + function validateAsync(): Name { + const ruleErrs = gen.let("ruleErrs", null) + gen.try( + () => assignValid(_`await `), + (e) => + gen.assign(valid, false).if( + _`${e} instanceof ${it.ValidationError as Name}`, + () => gen.assign(ruleErrs, _`${e}.errors`), + () => gen.throw(e) + ) + ) + return ruleErrs + } + + function validateSync(): Code { + const validateErrs = _`${validateRef}.errors` + gen.assign(validateErrs, null) + assignValid(nil) + return validateErrs + } + + function assignValid(_await: Code = def.async ? _`await ` : nil): void { + const passCxt = it.opts.passContext ? N.this : N.self + const passSchema = !(("compile" in def && !$data) || def.schema === false) + gen.assign( + valid, + _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`, + def.modifying + ) + } + + function reportErrs(errors: () => void): void { + gen.if(not(def.valid ?? valid), errors) + } +} + +function modifyData(cxt: KeywordCxt): void { + const {gen, data, it} = cxt + gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`)) +} + +function addErrs(cxt: KeywordCxt, errs: Code): void { + const {gen} = cxt + gen.if( + _`Array.isArray(${errs})`, + () => { + gen + .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) + .assign(N.errors, _`${N.vErrors}.length`) + extendErrors(cxt) + }, + () => cxt.error() + ) +} + +function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void { + if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema") +} + +function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name { + if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`) + return gen.scopeValue( + "keyword", + typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)} + ) +} + +export function validSchemaType( + schema: unknown, + schemaType: JSONType[], + allowUndefined = false +): boolean { + // TODO add tests + return ( + !schemaType.length || + schemaType.some((st) => + st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined") + ) + ) +} + +export function validateKeywordUsage( + {schema, opts, self, errSchemaPath}: SchemaObjCxt, + def: AddedKeywordDefinition, + keyword: string +): void { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error") + } + + const deps = def.dependencies + if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`) + } + + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]) + if (!valid) { + const msg = + `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors) + if (opts.validateSchema === "log") self.logger.error(msg) + else throw new Error(msg) + } + } +} diff --git a/node_modules/ajv/lib/compile/validate/subschema.ts b/node_modules/ajv/lib/compile/validate/subschema.ts new file mode 100644 index 0000000000000000000000000000000000000000..9072ed7743decf23950a40033cb2c2f6ec1845e4 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/subschema.ts @@ -0,0 +1,135 @@ +import type {AnySchema} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, str, getProperty, Code, Name} from "../codegen" +import {escapeFragment, getErrorPath, Type} from "../util" +import type {JSONType} from "../rules" + +export interface SubschemaContext { + // TODO use Optional? align with SchemCxt property types + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef?: Code + errorPath?: Code + dataLevel?: number + dataTypes?: JSONType[] + data?: Name + parentData?: Name + parentDataProperty?: Code | number + dataNames?: Name[] + dataPathArr?: (Code | number)[] + propertyName?: Name + jtdDiscriminator?: string + jtdMetadata?: boolean + compositeRule?: true + createErrors?: boolean + allErrors?: boolean +} + +export type SubschemaArgs = Partial<{ + keyword: string + schemaProp: string | number + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef: Code + data: Name | Code + dataProp: Code | string | number + dataTypes: JSONType[] + definedProperties: Set + propertyName: Name + dataPropType: Type + jtdDiscriminator: string + jtdMetadata: boolean + compositeRule: true + createErrors: boolean + allErrors: boolean +}> + +export function getSubschema( + it: SchemaObjCxt, + {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs +): SubschemaContext { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed') + } + + if (keyword !== undefined) { + const sch = it.schema[keyword] + return schemaProp === undefined + ? { + schema: sch, + schemaPath: _`${it.schemaPath}${getProperty(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`, + } + } + + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"') + } + return { + schema, + schemaPath, + topSchemaRef, + errSchemaPath, + } + } + + throw new Error('either "keyword" or "schema" must be passed') +} + +export function extendSubschemaData( + subschema: SubschemaContext, + it: SchemaObjCxt, + {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs +): void { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed') + } + + const {gen} = it + + if (dataProp !== undefined) { + const {errorPath, dataPathArr, opts} = it + const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true) + dataContextProps(nextData) + subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}` + subschema.parentDataProperty = _`${dataProp}` + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty] + } + + if (data !== undefined) { + const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once? + dataContextProps(nextData) + if (propertyName !== undefined) subschema.propertyName = propertyName + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + + if (dataTypes) subschema.dataTypes = dataTypes + + function dataContextProps(_nextData: Name): void { + subschema.data = _nextData + subschema.dataLevel = it.dataLevel + 1 + subschema.dataTypes = [] + it.definedProperties = new Set() + subschema.parentData = it.data + subschema.dataNames = [...it.dataNames, _nextData] + } +} + +export function extendSubschemaMode( + subschema: SubschemaContext, + {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs +): void { + if (compositeRule !== undefined) subschema.compositeRule = compositeRule + if (createErrors !== undefined) subschema.createErrors = createErrors + if (allErrors !== undefined) subschema.allErrors = allErrors + subschema.jtdDiscriminator = jtdDiscriminator // not inherited + subschema.jtdMetadata = jtdMetadata // not inherited +} diff --git a/node_modules/ajv/lib/core.ts b/node_modules/ajv/lib/core.ts new file mode 100644 index 0000000000000000000000000000000000000000..81a2d33ceecf62a055722373bd26384cbb1a4ebb --- /dev/null +++ b/node_modules/ajv/lib/core.ts @@ -0,0 +1,892 @@ +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + AnyValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {SchemaCxt, SchemaObjCxt} from "./compile" +export interface Plugin { + (ajv: Ajv, options?: Opts): Ajv + [prop: string]: any +} + +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +import type { + Schema, + AnySchema, + AnySchemaObject, + SchemaObject, + AsyncSchema, + Vocabulary, + KeywordDefinition, + AddedKeywordDefinition, + AnyValidateFunction, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + Format, + AddedFormat, + RegExpEngine, + UriResolver, +} from "./types" +import type {JSONSchemaType} from "./types/json-schema" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import ValidationError from "./runtime/validation_error" +import MissingRefError from "./compile/ref_error" +import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules" +import {SchemaEnv, compileSchema, resolveSchema} from "./compile" +import {Code, ValueScope} from "./compile/codegen" +import {normalizeId, getSchemaRefs} from "./compile/resolve" +import {getJSONTypes} from "./compile/validate/dataType" +import {eachItem} from "./compile/util" +import * as $dataRefSchema from "./refs/data.json" + +import DefaultUriResolver from "./runtime/uri" + +const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags) +defaultRegExp.code = "new RegExp" + +const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"] +const EXT_SCOPE_NAMES = new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]) + +export type Options = CurrentOptions & DeprecatedOptions + +export interface CurrentOptions { + // strict mode options (NEW) + strict?: boolean | "log" + strictSchema?: boolean | "log" + strictNumbers?: boolean | "log" + strictTypes?: boolean | "log" + strictTuples?: boolean | "log" + strictRequired?: boolean | "log" + allowMatchingProperties?: boolean // disables a strict mode restriction + allowUnionTypes?: boolean + validateFormats?: boolean + // validation and reporting options: + $data?: boolean + allErrors?: boolean + verbose?: boolean + discriminator?: boolean + unicodeRegExp?: boolean + timestamp?: "string" | "date" // JTD only + parseDate?: boolean // JTD only + allowDate?: boolean // JTD only + specialNumbers?: "fast" | "null" // JTD only + $comment?: + | true + | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown) + formats?: {[Name in string]?: Format} + keywords?: Vocabulary + schemas?: AnySchema[] | {[Key in string]?: AnySchema} + logger?: Logger | false + loadSchema?: (uri: string) => Promise + // options to modify validated data: + removeAdditional?: boolean | "all" | "failing" + useDefaults?: boolean | "empty" + coerceTypes?: boolean | "array" + // advanced options: + next?: boolean // NEW + unevaluated?: boolean // NEW + dynamicRef?: boolean // NEW + schemaId?: "id" | "$id" + jtd?: boolean // NEW + meta?: SchemaObject | boolean + defaultMeta?: string | AnySchemaObject + validateSchema?: boolean | "log" + addUsedSchema?: boolean + inlineRefs?: boolean | number + passContext?: boolean + loopRequired?: number + loopEnum?: number // NEW + ownProperties?: boolean + multipleOfPrecision?: number + int32range?: boolean // JTD only + messages?: boolean + code?: CodeOptions // NEW + uriResolver?: UriResolver +} + +export interface CodeOptions { + es5?: boolean + esm?: boolean + lines?: boolean + optimize?: boolean | number + formats?: Code // code to require (or construct) map of available formats - for standalone code + source?: boolean + process?: (code: string, schema?: SchemaEnv) => string + regExp?: RegExpEngine +} + +interface InstanceCodeOptions extends CodeOptions { + regExp: RegExpEngine + optimize: number +} + +interface DeprecatedOptions { + /** @deprecated */ + ignoreKeywordsWithRef?: boolean + /** @deprecated */ + jsPropertySyntax?: boolean // added instead of jsonPointers + /** @deprecated */ + unicode?: boolean +} + +interface RemovedOptions { + format?: boolean + errorDataPath?: "object" | "property" + nullable?: boolean // "nullable" keyword is supported by default + jsonPointers?: boolean + extendRefs?: true | "ignore" | "fail" + missingRefs?: true | "ignore" | "fail" + processCode?: (code: string, schema?: SchemaEnv) => string + sourceCode?: boolean + strictDefaults?: boolean + strictKeywords?: boolean + uniqueItems?: boolean + unknownFormats?: true | string[] | "ignore" + cache?: any + serialize?: (schema: AnySchema) => unknown + ajvErrors?: boolean +} + +type OptionsInfo = { + [K in keyof T]-?: string | undefined +} + +const removedOptions: OptionsInfo = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now.", +} + +const deprecatedOptions: OptionsInfo = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +} + +type RequiredInstanceOptions = { + [K in + | "strictSchema" + | "strictNumbers" + | "strictTypes" + | "strictTuples" + | "strictRequired" + | "inlineRefs" + | "loopRequired" + | "loopEnum" + | "meta" + | "messages" + | "schemaId" + | "addUsedSchema" + | "validateSchema" + | "validateFormats" + | "int32range" + | "unicodeRegExp" + | "uriResolver"]: NonNullable +} & {code: InstanceCodeOptions} + +export type InstanceOptions = Options & RequiredInstanceOptions + +const MAX_EXPRESSION = 200 + +// eslint-disable-next-line complexity +function requiredOptions(o: Options): RequiredInstanceOptions { + const s = o.strict + const _optz = o.code?.optimize + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 + const regExp = o.code?.regExp ?? defaultRegExp + const uriResolver = o.uriResolver ?? DefaultUriResolver + return { + strictSchema: o.strictSchema ?? s ?? true, + strictNumbers: o.strictNumbers ?? s ?? true, + strictTypes: o.strictTypes ?? s ?? "log", + strictTuples: o.strictTuples ?? s ?? "log", + strictRequired: o.strictRequired ?? s ?? false, + code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp}, + loopRequired: o.loopRequired ?? MAX_EXPRESSION, + loopEnum: o.loopEnum ?? MAX_EXPRESSION, + meta: o.meta ?? true, + messages: o.messages ?? true, + inlineRefs: o.inlineRefs ?? true, + schemaId: o.schemaId ?? "$id", + addUsedSchema: o.addUsedSchema ?? true, + validateSchema: o.validateSchema ?? true, + validateFormats: o.validateFormats ?? true, + unicodeRegExp: o.unicodeRegExp ?? true, + int32range: o.int32range ?? true, + uriResolver: uriResolver, + } +} + +export interface Logger { + log(...args: unknown[]): unknown + warn(...args: unknown[]): unknown + error(...args: unknown[]): unknown +} + +export default class Ajv { + opts: InstanceOptions + errors?: ErrorObject[] | null // errors from the last validation + logger: Logger + // shared external scope values for compiled functions + readonly scope: ValueScope + readonly schemas: {[Key in string]?: SchemaEnv} = {} + readonly refs: {[Ref in string]?: SchemaEnv | string} = {} + readonly formats: {[Name in string]?: AddedFormat} = Object.create(null) + readonly RULES: ValidationRules + readonly _compilations: Set = new Set() + private readonly _loading: {[Ref in string]?: Promise} = {} + private readonly _cache: Map = new Map() + private readonly _metaOpts: InstanceOptions + + static ValidationError = ValidationError + static MissingRefError = MissingRefError + + constructor(opts: Options = {}) { + opts = this.opts = {...opts, ...requiredOptions(opts)} + const {es5, lines} = this.opts.code + + this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines}) + this.logger = getLogger(opts.logger) + const formatOpt = opts.validateFormats + opts.validateFormats = false + + this.RULES = getRules() + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED") + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn") + this._metaOpts = getMetaSchemaOptions.call(this) + + if (opts.formats) addInitialFormats.call(this) + this._addVocabularies() + this._addDefaultMetaSchema() + if (opts.keywords) addInitialKeywords.call(this, opts.keywords) + if (typeof opts.meta == "object") this.addMetaSchema(opts.meta) + addInitialSchemas.call(this) + opts.validateFormats = formatOpt + } + + _addVocabularies(): void { + this.addKeyword("$async") + } + + _addDefaultMetaSchema(): void { + const {$data, meta, schemaId} = this.opts + let _dataRefSchema: SchemaObject = $dataRefSchema + if (schemaId === "id") { + _dataRefSchema = {...$dataRefSchema} + _dataRefSchema.id = _dataRefSchema.$id + delete _dataRefSchema.$id + } + if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + const {meta, schemaId} = this.opts + return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined) + } + + // Validate data using schema + // AnySchema will be compiled and cached using schema itself as a key for Map + validate(schema: Schema | string, data: unknown): boolean + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise + validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + validate(schema: JTDSchemaType, data: unknown): data is T + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars + validate( + schema: T, + data: unknown + ): data is JTDDataType + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + validate(schema: AsyncSchema, data: unknown | T): Promise + validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise + validate( + schemaKeyRef: AnySchema | string, // key, ref or schema object + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + data: unknown | T // to be validated + ): boolean | Promise { + let v: AnyValidateFunction | undefined + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef) + if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`) + } else { + v = this.compile(schemaKeyRef) + } + + const valid = v(data) + if (!("$async" in v)) this.errors = v.errors + return valid + } + + // Create validation function for passed schema + // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords. + compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars + compile( + schema: T, + _meta?: boolean + ): ValidateFunction> + compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction { + const sch = this._addSchema(schema, _meta) + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction + } + + // Creates validating function for passed schema with asynchronous loading of missing schemas. + // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. + // TODO allow passing schema URI + // meta - optional true to compile meta-schema + compileAsync( + schema: SchemaObject | JSONSchemaType, + _meta?: boolean + ): Promise> + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise> + compileAsync(schema: AsyncSchema, meta?: boolean): Promise> + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function") + } + const {loadSchema} = this.opts + return runCompileAsync.call(this, schema, meta) + + async function runCompileAsync( + this: Ajv, + _schema: AnySchemaObject, + _meta?: boolean + ): Promise { + await loadMetaSchema.call(this, _schema.$schema) + const sch = this._addSchema(_schema, _meta) + return sch.validate || _compileAsync.call(this, sch) + } + + async function loadMetaSchema(this: Ajv, $ref?: string): Promise { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, {$ref}, true) + } + } + + async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise { + try { + return this._compileSchemaEnv(sch) + } catch (e) { + if (!(e instanceof MissingRefError)) throw e + checkLoaded.call(this, e) + await loadMissingSchema.call(this, e.missingSchema) + return _compileAsync.call(this, sch) + } + } + + function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`) + } + } + + async function loadMissingSchema(this: Ajv, ref: string): Promise { + const _schema = await _loadSchema.call(this, ref) + if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema) + if (!this.refs[ref]) this.addSchema(_schema, ref, meta) + } + + async function _loadSchema(this: Ajv, ref: string): Promise { + const p = this._loading[ref] + if (p) return p + try { + return await (this._loading[ref] = loadSchema(ref)) + } finally { + delete this._loading[ref] + } + } + } + + // Adds schema to the instance + addSchema( + schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored + key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ): Ajv { + if (Array.isArray(schema)) { + for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema) + return this + } + let id: string | undefined + if (typeof schema === "object") { + const {schemaId} = this.opts + id = schema[schemaId] + if (id !== undefined && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`) + } + } + key = normalizeId(key || id) + this._checkUnique(key) + this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true) + return this + } + + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema( + schema: AnySchemaObject, + key?: string, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ): Ajv { + this.addSchema(schema, key, true, _validateSchema) + return this + } + + // Validate schema against its meta-schema + validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise { + if (typeof schema == "boolean") return true + let $schema: string | AnySchemaObject | undefined + $schema = schema.$schema + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string") + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta() + if (!$schema) { + this.logger.warn("meta-schema not available") + this.errors = null + return true + } + const valid = this.validate($schema, schema) + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText() + if (this.opts.validateSchema === "log") this.logger.error(message) + else throw new Error(message) + } + return valid + } + + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef: string): AnyValidateFunction | undefined { + let sch + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch + if (sch === undefined) { + const {schemaId} = this.opts + const root = new SchemaEnv({schema: {}, schemaId}) + sch = resolveSchema.call(this, root, keyRef) + if (!sch) return + this.refs[keyRef] = sch + } + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction | undefined + } + + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef) + this._removeAllSchemas(this.refs, schemaKeyRef) + return this + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas) + this._removeAllSchemas(this.refs) + this._cache.clear() + return this + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef) + if (typeof sch == "object") this._cache.delete(sch.schema) + delete this.schemas[schemaKeyRef] + delete this.refs[schemaKeyRef] + return this + } + case "object": { + const cacheKey = schemaKeyRef + this._cache.delete(cacheKey) + let id = schemaKeyRef[this.opts.schemaId] + if (id) { + id = normalizeId(id) + delete this.schemas[id] + delete this.refs[id] + } + return this + } + default: + throw new Error("ajv.removeSchema: invalid parameter") + } + } + + // add "vocabulary" - a collection of keywords + addVocabulary(definitions: Vocabulary): Ajv { + for (const def of definitions) this.addKeyword(def) + return this + } + + addKeyword( + kwdOrDef: string | KeywordDefinition, + def?: KeywordDefinition // deprecated + ): Ajv { + let keyword: string | string[] + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword") + def.keyword = keyword + } + } else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef + keyword = def.keyword + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array") + } + } else { + throw new Error("invalid addKeywords parameters") + } + + checkKeyword.call(this, keyword, def) + if (!def) { + eachItem(keyword, (kwd) => addRule.call(this, kwd)) + return this + } + keywordMetaschema.call(this, def) + const definition: AddedKeywordDefinition = { + ...def, + type: getJSONTypes(def.type), + schemaType: getJSONTypes(def.schemaType), + } + eachItem( + keyword, + definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)) + ) + return this + } + + getKeyword(keyword: string): AddedKeywordDefinition | boolean { + const rule = this.RULES.all[keyword] + return typeof rule == "object" ? rule.definition : !!rule + } + + // Remove keyword + removeKeyword(keyword: string): Ajv { + // TODO return type should be Ajv + const {RULES} = this + delete RULES.keywords[keyword] + delete RULES.all[keyword] + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword) + if (i >= 0) group.rules.splice(i, 1) + } + return this + } + + // Add format + addFormat(name: string, format: Format): Ajv { + if (typeof format == "string") format = new RegExp(format) + this.formats[name] = format + return this + } + + errorsText( + errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors + {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar` + ): string { + if (!errors || errors.length === 0) return "No errors" + return errors + .map((e) => `${dataVar}${e.instancePath} ${e.message}`) + .reduce((text, msg) => text + separator + msg) + } + + $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject { + const rules = this.RULES.all + metaSchema = JSON.parse(JSON.stringify(metaSchema)) + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1) // first segment is an empty string + let keywords = metaSchema + for (const seg of segments) keywords = keywords[seg] as AnySchemaObject + + for (const key in rules) { + const rule = rules[key] + if (typeof rule != "object") continue + const {$data} = rule.definition + const schema = keywords[key] as AnySchemaObject | undefined + if ($data && schema) keywords[key] = schemaOrData(schema) + } + } + + return metaSchema + } + + private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void { + for (const keyRef in schemas) { + const sch = schemas[keyRef] + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef] + } else if (sch && !sch.meta) { + this._cache.delete(sch.schema) + delete schemas[keyRef] + } + } + } + } + + _addSchema( + schema: AnySchema, + meta?: boolean, + baseId?: string, + validateSchema = this.opts.validateSchema, + addSchema = this.opts.addUsedSchema + ): SchemaEnv { + let id: string | undefined + const {schemaId} = this.opts + if (typeof schema == "object") { + id = schema[schemaId] + } else { + if (this.opts.jtd) throw new Error("schema must be object") + else if (typeof schema != "boolean") throw new Error("schema must be object or boolean") + } + let sch = this._cache.get(schema) + if (sch !== undefined) return sch + + baseId = normalizeId(id || baseId) + const localRefs = getSchemaRefs.call(this, schema, baseId) + sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs}) + this._cache.set(sch.schema, sch) + if (addSchema && !baseId.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (baseId) this._checkUnique(baseId) + this.refs[baseId] = sch + } + if (validateSchema) this.validateSchema(schema, true) + return sch + } + + private _checkUnique(id: string): void { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`) + } + } + + private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction { + if (sch.meta) this._compileMetaSchema(sch) + else compileSchema.call(this, sch) + + /* istanbul ignore if */ + if (!sch.validate) throw new Error("ajv implementation error") + return sch.validate + } + + private _compileMetaSchema(sch: SchemaEnv): void { + const currentOpts = this.opts + this.opts = this._metaOpts + try { + compileSchema.call(this, sch) + } finally { + this.opts = currentOpts + } + } +} + +export interface ErrorsTextOptions { + separator?: string + dataVar?: string +} + +function checkOptions( + this: Ajv, + checkOpts: OptionsInfo, + options: Options & RemovedOptions, + msg: string, + log: "warn" | "error" = "error" +): void { + for (const key in checkOpts) { + const opt = key as keyof typeof checkOpts + if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`) + } +} + +function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined { + keyRef = normalizeId(keyRef) // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef] +} + +function addInitialSchemas(this: Ajv): void { + const optsSchemas = this.opts.schemas + if (!optsSchemas) return + if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas) + else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key) +} + +function addInitialFormats(this: Ajv): void { + for (const name in this.opts.formats) { + const format = this.opts.formats[name] + if (format) this.addFormat(name, format) + } +} + +function addInitialKeywords( + this: Ajv, + defs: Vocabulary | {[K in string]?: KeywordDefinition} +): void { + if (Array.isArray(defs)) { + this.addVocabulary(defs) + return + } + this.logger.warn("keywords option as map is deprecated, pass array") + for (const keyword in defs) { + const def = defs[keyword] as KeywordDefinition + if (!def.keyword) def.keyword = keyword + this.addKeyword(def) + } +} + +function getMetaSchemaOptions(this: Ajv): InstanceOptions { + const metaOpts = {...this.opts} + for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt] + return metaOpts +} + +const noLogs = {log() {}, warn() {}, error() {}} + +function getLogger(logger?: Partial | false): Logger { + if (logger === false) return noLogs + if (logger === undefined) return console + if (logger.log && logger.warn && logger.error) return logger as Logger + throw new Error("logger must implement log, warn and error methods") +} + +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i + +function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void { + const {RULES} = this + eachItem(keyword, (kwd) => { + if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`) + if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`) + }) + if (!def) return + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function') + } +} + +function addRule( + this: Ajv, + keyword: string, + definition?: AddedKeywordDefinition, + dataType?: JSONType +): void { + const post = definition?.post + if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"') + const {RULES} = this + let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType) + if (!ruleGroup) { + ruleGroup = {type: dataType, rules: []} + RULES.rules.push(ruleGroup) + } + RULES.keywords[keyword] = true + if (!definition) return + + const rule: Rule = { + keyword, + definition: { + ...definition, + type: getJSONTypes(definition.type), + schemaType: getJSONTypes(definition.schemaType), + }, + } + if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before) + else ruleGroup.rules.push(rule) + RULES.all[keyword] = rule + definition.implements?.forEach((kwd) => this.addKeyword(kwd)) +} + +function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before) + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule) + } else { + ruleGroup.rules.push(rule) + this.logger.warn(`rule ${before} is not defined`) + } +} + +function keywordMetaschema(this: Ajv, def: KeywordDefinition): void { + let {metaSchema} = def + if (metaSchema === undefined) return + if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema) + def.validateSchema = this.compile(metaSchema, true) +} + +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +} + +function schemaOrData(schema: AnySchema): AnySchemaObject { + return {anyOf: [schema, $dataRef]} +} diff --git a/node_modules/ajv/lib/jtd.ts b/node_modules/ajv/lib/jtd.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7e7bce3ba39a6339b9377cee40429daba39af72 --- /dev/null +++ b/node_modules/ajv/lib/jtd.ts @@ -0,0 +1,132 @@ +import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import AjvCore, {CurrentOptions} from "./core" +import jtdVocabulary from "./vocabularies/jtd" +import jtdMetaSchema from "./refs/jtd-schema" +import compileSerializer from "./compile/jtd/serialize" +import compileParser from "./compile/jtd/parse" +import {SchemaEnv} from "./compile" + +const META_SCHEMA_ID = "JTD-meta-schema" + +type JTDOptions = CurrentOptions & { + // strict mode options not supported with JTD: + strict?: never + allowMatchingProperties?: never + allowUnionTypes?: never + validateFormats?: never + // validation and reporting options not supported with JTD: + $data?: never + verbose?: boolean + $comment?: never + formats?: never + loadSchema?: never + // options to modify validated data: + useDefaults?: never + coerceTypes?: never + // advanced options: + next?: never + unevaluated?: never + dynamicRef?: never + meta?: boolean + defaultMeta?: never + inlineRefs?: boolean + loopRequired?: never + multipleOfPrecision?: never +} + +export class Ajv extends AjvCore { + constructor(opts: JTDOptions = {}) { + super({ + ...opts, + jtd: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + this.addVocabulary(jtdVocabulary) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + if (!this.opts.meta) return + this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } + + compileSerializer(schema: SchemaObject): (data: T) => string + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileSerializer(schema: JTDSchemaType): (data: T) => string + compileSerializer(schema: SchemaObject): (data: T) => string { + const sch = this._addSchema(schema) + return sch.serialize || this._compileSerializer(sch) + } + + compileParser(schema: SchemaObject): JTDParser + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileParser(schema: JTDSchemaType): JTDParser + compileParser(schema: SchemaObject): JTDParser { + const sch = this._addSchema(schema) + return (sch.parse || this._compileParser(sch)) as JTDParser + } + + private _compileSerializer(sch: SchemaEnv): (data: T) => string { + compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.serialize) throw new Error("ajv implementation error") + return sch.serialize + } + + private _compileParser(sch: SchemaEnv): JTDParser { + compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.parse) throw new Error("ajv implementation error") + return sch.parse + } +} + +module.exports = exports = Ajv +module.exports.Ajv = Ajv +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, + JTDParser, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {JTDErrorObject} from "./vocabularies/jtd" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} +export {JTDOptions} +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/refs/data.json b/node_modules/ajv/lib/refs/data.json new file mode 100644 index 0000000000000000000000000000000000000000..9ffc9f5ce05484799308bc4c78fd3a8822e9af53 --- /dev/null +++ b/node_modules/ajv/lib/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts b/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6ea7195f019ef1b91c45517db08f42daa2f0673 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts @@ -0,0 +1,28 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 0000000000000000000000000000000000000000..c5e91cf2ac8469eccf444cf6501dba80dccb5c63 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 0000000000000000000000000000000000000000..b8f63734343046b3d4b74bf8a59f2380dbc67fc3 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 0000000000000000000000000000000000000000..f71adbff04fe9ecc6a828823ad5dfa7366f1a60f --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 0000000000000000000000000000000000000000..03ccfce26efeaff5a6e223be5154f238f633c16e --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 0000000000000000000000000000000000000000..0e194326fa133b077af409486ebe1e2dca83feff --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..7027a1279a014a74c170a2558100d2ca37eecac0 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json new file mode 100644 index 0000000000000000000000000000000000000000..54eb7157afed6957bd7074068d7ad99498c668f3 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts b/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e850d08b5cdc8ec9f41ff69581c11844c9c60af --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts @@ -0,0 +1,30 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as unevaluated from "./meta/unevaluated.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format-annotation.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + unevaluated, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json new file mode 100644 index 0000000000000000000000000000000000000000..674c913dab00c66865d82027bdf7748e157365fa --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + "$dynamicAnchor": "meta", + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "prefixItems": {"$ref": "#/$defs/schemaArray"}, + "items": {"$dynamicRef": "#meta"}, + "contains": {"$dynamicRef": "#meta"}, + "additionalProperties": {"$dynamicRef": "#meta"}, + "properties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "propertyNames": {"$dynamicRef": "#meta"}, + "if": {"$dynamicRef": "#meta"}, + "then": {"$dynamicRef": "#meta"}, + "else": {"$dynamicRef": "#meta"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$dynamicRef": "#meta"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$dynamicRef": "#meta"} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json new file mode 100644 index 0000000000000000000000000000000000000000..2ae23ddb5cc30cce43646dc58b86f61b1dc7fc4c --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentSchema": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json new file mode 100644 index 0000000000000000000000000000000000000000..4c8e5cb61657ff226186dd96e5dea6e15eb102e1 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + "$dynamicAnchor": "meta", + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "$ref": "#/$defs/uriReferenceString", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": {"$ref": "#/$defs/uriString"}, + "$ref": {"$ref": "#/$defs/uriReferenceString"}, + "$anchor": {"$ref": "#/$defs/anchorString"}, + "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, + "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, + "$vocabulary": { + "type": "object", + "propertyNames": {"$ref": "#/$defs/uriString"}, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"} + } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json new file mode 100644 index 0000000000000000000000000000000000000000..83c26e35f0042ebada16aba9b0c42bedd46bcb24 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + "$dynamicAnchor": "meta", + + "title": "Format vocabulary meta-schema for annotation results", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json new file mode 100644 index 0000000000000000000000000000000000000000..11946fb5019a3564afb38270af3d7806af39978c --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + "$dynamicAnchor": "meta", + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json new file mode 100644 index 0000000000000000000000000000000000000000..5e4b203b2c26905ccef5ab90c627aaa19ee708bb --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + "$dynamicAnchor": "meta", + + "title": "Unevaluated applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "unevaluatedItems": {"$dynamicRef": "#meta"}, + "unevaluatedProperties": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..e0ae13d9d2063403c60e88282701b4b8f6ccd5f5 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + "$dynamicAnchor": "meta", + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json b/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json new file mode 100644 index 0000000000000000000000000000000000000000..1c68270fdc6e4fa807c75bb32391ce8cb530a497 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/schema", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/unevaluated"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format-annotation"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + "properties": { + "definitions": { + "$comment": "\"definitions\" has been replaced by \"$defs\".", + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "deprecated": true, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", + "type": "object", + "additionalProperties": { + "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] + }, + "deprecated": true, + "default": {} + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-06.json b/node_modules/ajv/lib/refs/json-schema-draft-06.json new file mode 100644 index 0000000000000000000000000000000000000000..5410064ba8df9315d61a34a66245311f1d18db8e --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "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"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "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": "#"} + }, + "default": {} +} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-07.json b/node_modules/ajv/lib/refs/json-schema-draft-07.json new file mode 100644 index 0000000000000000000000000000000000000000..6a74851043623c67cbe2e1cd206da447aff752c3 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/node_modules/ajv/lib/refs/json-schema-secure.json b/node_modules/ajv/lib/refs/json-schema-secure.json new file mode 100644 index 0000000000000000000000000000000000000000..3968abd5d97e7b2cf87db34d5eb211c090b8700f --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/node_modules/ajv/lib/refs/jtd-schema.ts b/node_modules/ajv/lib/refs/jtd-schema.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0198128985137b24b13e40e6f41431f37b86647 --- /dev/null +++ b/node_modules/ajv/lib/refs/jtd-schema.ts @@ -0,0 +1,130 @@ +import {SchemaObject} from "../types" + +type MetaSchema = (root: boolean) => SchemaObject + +const shared: MetaSchema = (root) => { + const sch: SchemaObject = { + nullable: {type: "boolean"}, + metadata: { + optionalProperties: { + union: {elements: {ref: "schema"}}, + }, + additionalProperties: true, + }, + } + if (root) sch.definitions = {values: {ref: "schema"}} + return sch +} + +const emptyForm: MetaSchema = (root) => ({ + optionalProperties: shared(root), +}) + +const refForm: MetaSchema = (root) => ({ + properties: { + ref: {type: "string"}, + }, + optionalProperties: shared(root), +}) + +const typeForm: MetaSchema = (root) => ({ + properties: { + type: { + enum: [ + "boolean", + "timestamp", + "string", + "float32", + "float64", + "int8", + "uint8", + "int16", + "uint16", + "int32", + "uint32", + ], + }, + }, + optionalProperties: shared(root), +}) + +const enumForm: MetaSchema = (root) => ({ + properties: { + enum: {elements: {type: "string"}}, + }, + optionalProperties: shared(root), +}) + +const elementsForm: MetaSchema = (root) => ({ + properties: { + elements: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const propertiesForm: MetaSchema = (root) => ({ + properties: { + properties: {values: {ref: "schema"}}, + }, + optionalProperties: { + optionalProperties: {values: {ref: "schema"}}, + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const optionalPropertiesForm: MetaSchema = (root) => ({ + properties: { + optionalProperties: {values: {ref: "schema"}}, + }, + optionalProperties: { + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const discriminatorForm: MetaSchema = (root) => ({ + properties: { + discriminator: {type: "string"}, + mapping: { + values: { + metadata: { + union: [propertiesForm(false), optionalPropertiesForm(false)], + }, + }, + }, + }, + optionalProperties: shared(root), +}) + +const valuesForm: MetaSchema = (root) => ({ + properties: { + values: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const schema: MetaSchema = (root) => ({ + metadata: { + union: [ + emptyForm, + refForm, + typeForm, + enumForm, + elementsForm, + propertiesForm, + optionalPropertiesForm, + discriminatorForm, + valuesForm, + ].map((s) => s(root)), + }, +}) + +const jtdMetaSchema: SchemaObject = { + definitions: { + schema: schema(false), + }, + ...schema(true), +} + +export default jtdMetaSchema diff --git a/node_modules/ajv/lib/runtime/equal.ts b/node_modules/ajv/lib/runtime/equal.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cb00631a2363720e822255d0911a54439512c3c --- /dev/null +++ b/node_modules/ajv/lib/runtime/equal.ts @@ -0,0 +1,7 @@ +// https://github.com/ajv-validator/ajv/issues/889 +import * as equal from "fast-deep-equal" + +type Equal = typeof equal & {code: string} +;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default' + +export default equal as Equal diff --git a/node_modules/ajv/lib/runtime/parseJson.ts b/node_modules/ajv/lib/runtime/parseJson.ts new file mode 100644 index 0000000000000000000000000000000000000000..472e5e50786f2cff1092ac1353508ac0fcebce9e --- /dev/null +++ b/node_modules/ajv/lib/runtime/parseJson.ts @@ -0,0 +1,177 @@ +const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/ + +export function parseJson(s: string, pos: number): unknown { + let endPos: number | undefined + parseJson.message = undefined + let matches: RegExpExecArray | null + if (pos) s = s.slice(pos) + try { + parseJson.position = pos + s.length + return JSON.parse(s) + } catch (e) { + matches = rxParseJson.exec((e as Error).message) + if (!matches) { + parseJson.message = "unexpected end" + return undefined + } + endPos = +matches[1] + const c = s[endPos] + s = s.slice(0, endPos) + parseJson.position = pos + endPos + try { + return JSON.parse(s) + } catch (e1) { + parseJson.message = `unexpected token ${c}` + return undefined + } + } +} + +parseJson.message = undefined as string | undefined +parseJson.position = 0 as number +parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson' + +export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined { + let numStr = "" + let c: string + parseJsonNumber.message = undefined + if (s[pos] === "-") { + numStr += "-" + pos++ + } + if (s[pos] === "0") { + numStr += "0" + pos++ + } else { + if (!parseDigits(maxDigits)) { + errorMessage() + return undefined + } + } + if (maxDigits) { + parseJsonNumber.position = pos + return +numStr + } + if (s[pos] === ".") { + numStr += "." + pos++ + if (!parseDigits()) { + errorMessage() + return undefined + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e" + pos++ + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c + pos++ + } + if (!parseDigits()) { + errorMessage() + return undefined + } + } + parseJsonNumber.position = pos + return +numStr + + function parseDigits(maxLen?: number): boolean { + let digit = false + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true + numStr += c + pos++ + } + return digit + } + + function errorMessage(): void { + parseJsonNumber.position = pos + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end" + } +} + +parseJsonNumber.message = undefined as string | undefined +parseJsonNumber.position = 0 as number +parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber' + +const escapedChars: {[X in string]?: string} = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +} + +const CODE_A: number = "a".charCodeAt(0) +const CODE_0: number = "0".charCodeAt(0) + +export function parseJsonString(s: string, pos: number): string | undefined { + let str = "" + let c: string | undefined + parseJsonString.message = undefined + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++] + if (c === '"') break + if (c === "\\") { + c = s[pos] + if (c in escapedChars) { + str += escapedChars[c] + pos++ + } else if (c === "u") { + pos++ + let count = 4 + let code = 0 + while (count--) { + code <<= 4 + c = s[pos] + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (c === undefined) { + errorMessage("unexpected end") + return undefined + } + c = c.toLowerCase() + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10 + } else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0 + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + pos++ + } + str += String.fromCharCode(code) + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } else if (c === undefined) { + errorMessage("unexpected end") + return undefined + } else { + if (c.charCodeAt(0) >= 0x20) { + str += c + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + } + } + parseJsonString.position = pos + return str + + function errorMessage(msg: string): void { + parseJsonString.position = pos + parseJsonString.message = msg + } +} + +parseJsonString.message = undefined as string | undefined +parseJsonString.position = 0 as number +parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString' diff --git a/node_modules/ajv/lib/runtime/quote.ts b/node_modules/ajv/lib/runtime/quote.ts new file mode 100644 index 0000000000000000000000000000000000000000..1160e6a23807cf7fc0f4d036ddc45bd962562275 --- /dev/null +++ b/node_modules/ajv/lib/runtime/quote.ts @@ -0,0 +1,31 @@ +const rxEscapable = + // eslint-disable-next-line no-control-regex, no-misleading-character-class + /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g + +const escaped: {[K in string]?: string} = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +} + +export default function quote(s: string): string { + rxEscapable.lastIndex = 0 + return ( + '"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a] + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) + }) + : s) + + '"' + ) +} + +quote.code = 'require("ajv/dist/runtime/quote").default' diff --git a/node_modules/ajv/lib/runtime/re2.ts b/node_modules/ajv/lib/runtime/re2.ts new file mode 100644 index 0000000000000000000000000000000000000000..0c769bc7aefc5aa1924e2be877d39bc59670ab3f --- /dev/null +++ b/node_modules/ajv/lib/runtime/re2.ts @@ -0,0 +1,6 @@ +import * as re2 from "re2" + +type Re2 = typeof re2 & {code: string} +;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default' + +export default re2 as Re2 diff --git a/node_modules/ajv/lib/runtime/timestamp.ts b/node_modules/ajv/lib/runtime/timestamp.ts new file mode 100644 index 0000000000000000000000000000000000000000..1625f9a40f4443fde14743a6a8ecb6c1dc8fb819 --- /dev/null +++ b/node_modules/ajv/lib/runtime/timestamp.ts @@ -0,0 +1,46 @@ +const DT_SEPARATOR = /t|\s/i +const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/ +const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + +export default function validTimestamp(str: string, allowDate: boolean): boolean { + // http://tools.ietf.org/html/rfc3339#section-5.6 + const dt: string[] = str.split(DT_SEPARATOR) + return ( + (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || + (allowDate && dt.length === 1 && validDate(dt[0])) + ) +} + +function validDate(str: string): boolean { + const matches: string[] | null = DATE.exec(str) + if (!matches) return false + const y: number = +matches[1] + const m: number = +matches[2] + const d: number = +matches[3] + return ( + m >= 1 && + m <= 12 && + d >= 1 && + (d <= DAYS[m] || + // leap year: https://tools.ietf.org/html/rfc3339#appendix-C + (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) + ) +} + +function validTime(str: string): boolean { + const matches: string[] | null = TIME.exec(str) + if (!matches) return false + const hr: number = +matches[1] + const min: number = +matches[2] + const sec: number = +matches[3] + const tzH: number = +(matches[4] || 0) + const tzM: number = +(matches[5] || 0) + return ( + (hr <= 23 && min <= 59 && sec <= 59) || + // leap second + (hr - tzH === 23 && min - tzM === 59 && sec === 60) + ) +} + +validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default' diff --git a/node_modules/ajv/lib/runtime/ucs2length.ts b/node_modules/ajv/lib/runtime/ucs2length.ts new file mode 100644 index 0000000000000000000000000000000000000000..47d8292b83fde4619bdbf28b89e6720824a97164 --- /dev/null +++ b/node_modules/ajv/lib/runtime/ucs2length.ts @@ -0,0 +1,20 @@ +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +export default function ucs2length(str: string): number { + const len = str.length + let length = 0 + let pos = 0 + let value: number + while (pos < len) { + length++ + value = str.charCodeAt(pos++) + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos) + if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate + } + } + return length +} + +ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default' diff --git a/node_modules/ajv/lib/runtime/uri.ts b/node_modules/ajv/lib/runtime/uri.ts new file mode 100644 index 0000000000000000000000000000000000000000..5450549cd5a3968f163460d3c0fb1aeb7ffc2b2c --- /dev/null +++ b/node_modules/ajv/lib/runtime/uri.ts @@ -0,0 +1,6 @@ +import * as uri from "fast-uri" + +type URI = typeof uri & {code: string} +;(uri as URI).code = 'require("ajv/dist/runtime/uri").default' + +export default uri as URI diff --git a/node_modules/ajv/lib/runtime/validation_error.ts b/node_modules/ajv/lib/runtime/validation_error.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d19a46a2245c667f479d7ee51d1d9558cd9ae90 --- /dev/null +++ b/node_modules/ajv/lib/runtime/validation_error.ts @@ -0,0 +1,13 @@ +import type {ErrorObject} from "../types" + +export default class ValidationError extends Error { + readonly errors: Partial[] + readonly ajv: true + readonly validation: true + + constructor(errors: Partial[]) { + super("validation failed") + this.errors = errors + this.ajv = this.validation = true + } +} diff --git a/node_modules/ajv/lib/standalone/index.ts b/node_modules/ajv/lib/standalone/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6129ce9e5ebab51fe4f53ffa86dbacd12878ed9 --- /dev/null +++ b/node_modules/ajv/lib/standalone/index.ts @@ -0,0 +1,100 @@ +import type AjvCore from "../core" +import type {AnyValidateFunction, SourceCode} from "../types" +import type {SchemaEnv} from "../compile" +import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope" +import {_, nil, _Code, Code, getProperty, getEsmExportName} from "../compile/codegen/code" + +function standaloneCode( + ajv: AjvCore, + refsOrFunc?: {[K in string]?: string} | AnyValidateFunction +): string { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option") + } + const {_n} = ajv.scope.opts + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => + sch.meta ? undefined : ajv.compile(sch.schema) + ) + + function getValidate(id: string): AnyValidateFunction { + const v = ajv.getSchema(id) + if (!v) throw new Error(`moduleCode: no schema with id ${id}`) + return v + } + + function funcExportCode(source?: SourceCode): string { + const usedValues: UsedScopeValues = {} + const n = source?.validateName + const vCode = validateCode(usedValues, source) + if (ajv.opts.code.esm) { + // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value + return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}` + } + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}` + } + + function multiExportsCode( + schemas: {[K in string]?: T}, + getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined + ): string { + const usedValues: UsedScopeValues = {} + let code = _`"use strict";` + for (const name in schemas) { + const v = getValidateFunc(schemas[name] as T) + if (v) { + const vCode = validateCode(usedValues, v.source) + const exportSyntax = ajv.opts.code.esm + ? _`export const ${getEsmExportName(name)}` + : _`exports${getProperty(name)}` + code = _`${code}${_n}${exportSyntax} = ${v.source?.validateName};${_n}${vCode}` + } + } + return `${code}` + } + + function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code { + if (!s) throw new Error('moduleCode: function does not have "source" property') + if (usedState(s.validateName) === UsedValueState.Completed) return nil + setUsedState(s.validateName, UsedValueState.Started) + + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode) + const code = new _Code(`${scopeCode}${_n}${s.validateCode}`) + return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code + + function refValidateCode(n: ValueScopeName): Code | undefined { + const vRef = n.value?.ref + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef as AnyValidateFunction + return validateCode(usedValues, v.source) + } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const {validate, validateName} = vRef as SchemaEnv + if (!validateName) throw new Error("ajv internal error") + const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const + const wrapper = _`${def} ${n} = {validate: ${validateName}};` + if (usedState(validateName) === UsedValueState.Started) return wrapper + const vCode = validateCode(usedValues, validate?.source) + return _`${wrapper}${_n}${vCode}` + } + return undefined + } + + function usedState(name: ValueScopeName): UsedValueState | undefined { + return usedValues[name.prefix]?.get(name) + } + + function setUsedState(name: ValueScopeName, state: UsedValueState): void { + const {prefix} = name + const names = (usedValues[prefix] = usedValues[prefix] || new Map()) + names.set(name, state) + } + } +} + +module.exports = exports = standaloneCode +Object.defineProperty(exports, "__esModule", {value: true}) + +export default standaloneCode diff --git a/node_modules/ajv/lib/standalone/instance.ts b/node_modules/ajv/lib/standalone/instance.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4b2c30b58f0ebc89b4c8e1010e5976216c0042f --- /dev/null +++ b/node_modules/ajv/lib/standalone/instance.ts @@ -0,0 +1,36 @@ +import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core" +import standaloneCode from "." +import * as requireFromString from "require-from-string" + +export default class AjvPack { + errors?: ErrorObject[] | null // errors from the last validation + constructor(readonly ajv: Ajv) {} + + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise { + return Ajv.prototype.validate.call(this, schemaKeyRef, data) + } + + compile(schema: AnySchema, meta?: boolean): AnyValidateFunction { + return this.getStandalone(this.ajv.compile(schema, meta)) + } + + getSchema(keyRef: string): AnyValidateFunction | undefined { + const v = this.ajv.getSchema(keyRef) + if (!v) return undefined + return this.getStandalone(v) + } + + private getStandalone(v: AnyValidateFunction): AnyValidateFunction { + return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction + } + + addSchema(...args: Parameters): AjvPack { + this.ajv.addSchema.call(this.ajv, ...args) + return this + } + + addKeyword(...args: Parameters): AjvPack { + this.ajv.addKeyword.call(this.ajv, ...args) + return this + } +} diff --git a/node_modules/ajv/lib/types/index.ts b/node_modules/ajv/lib/types/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..39bc51b0b99d79b09e3e5f0e2d0d48e7bf37c069 --- /dev/null +++ b/node_modules/ajv/lib/types/index.ts @@ -0,0 +1,244 @@ +import {URIComponent} from "fast-uri" +import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen" +import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile" +import type {JSONType} from "../compile/rules" +import type {KeywordCxt} from "../compile/validate" +import type Ajv from "../core" + +interface _SchemaObject { + id?: string + $id?: string + $schema?: string + [x: string]: any // TODO +} + +export interface SchemaObject extends _SchemaObject { + id?: string + $id?: string + $schema?: string + $async?: false + [x: string]: any // TODO +} + +export interface AsyncSchema extends _SchemaObject { + $async: true +} + +export type AnySchemaObject = SchemaObject | AsyncSchema + +export type Schema = SchemaObject | boolean + +export type AnySchema = Schema | AsyncSchema + +export type SchemaMap = {[Key in string]?: AnySchema} + +export interface SourceCode { + validateName: ValueScopeName + validateCode: string + scopeValues: ScopeValueSets + evaluated?: Code +} + +export interface DataValidationCxt { + instancePath: string + parentData: {[K in T]: any} // object or array + parentDataProperty: T // string or number + rootData: Record | any[] + dynamicAnchors: {[Ref in string]?: ValidateFunction} +} + +export interface ValidateFunction { + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T + errors?: null | ErrorObject[] + evaluated?: Evaluated + schema: AnySchema + schemaEnv: SchemaEnv + source?: SourceCode +} + +export interface JTDParser { + (json: string): T | undefined + message?: string + position?: number +} + +export type EvaluatedProperties = {[K in string]?: true} | true + +export type EvaluatedItems = number | true + +export interface Evaluated { + // determined at compile time if staticProps/Items is true + props?: EvaluatedProperties + items?: EvaluatedItems + // whether props/items determined at compile time + dynamicProps: boolean + dynamicItems: boolean +} + +export interface AsyncValidateFunction extends ValidateFunction { + (...args: Parameters>): Promise + $async: true +} + +export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction + +export interface ErrorObject, S = unknown> { + keyword: K + instancePath: string + schemaPath: string + params: P + // Added to validation errors of "propertyNames" keyword schema + propertyName?: string + // Excluded if option `messages` set to false. + message?: string + // These are added with the `verbose` option. + schema?: S + parentSchema?: AnySchemaObject + data?: unknown +} + +export type ErrorNoParams = ErrorObject, S> + +interface _KeywordDef { + keyword: string | string[] + type?: JSONType | JSONType[] // data types that keyword applies to + schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema + allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema + $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference) + implements?: string[] // other schema keywords that this keyword implements + before?: string // keyword should be executed before this keyword (should be applicable to the same type) + post?: boolean // keyword should be executed after other keywords without post flag + metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable + validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed + dependencies?: string[] // keywords that must be present in the same schema + error?: KeywordErrorDefinition + $dataError?: KeywordErrorDefinition +} + +export interface CodeKeywordDefinition extends _KeywordDef { + code: (cxt: KeywordCxt, ruleType?: string) => void + trackErrors?: boolean +} + +export type MacroKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaCxt +) => AnySchema + +export type CompileKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaObjCxt +) => DataValidateFunction + +export interface DataValidateFunction { + (...args: Parameters): boolean | Promise + errors?: Partial[] +} + +export interface SchemaValidateFunction { + ( + schema: any, + data: any, + parentSchema?: AnySchemaObject, + dataCxt?: DataValidationCxt + ): boolean | Promise + errors?: Partial[] +} + +export interface FuncKeywordDefinition extends _KeywordDef { + validate?: SchemaValidateFunction | DataValidateFunction + compile?: CompileKeywordFunc + // schema: false makes validate not to expect schema (DataValidateFunction) + schema?: boolean // requires "validate" + modifying?: boolean + async?: boolean + valid?: boolean + errors?: boolean | "full" +} + +export interface MacroKeywordDefinition extends FuncKeywordDefinition { + macro: MacroKeywordFunc +} + +export type KeywordDefinition = + | CodeKeywordDefinition + | FuncKeywordDefinition + | MacroKeywordDefinition + +export type AddedKeywordDefinition = KeywordDefinition & { + type: JSONType[] + schemaType: JSONType[] +} + +export interface KeywordErrorDefinition { + message: string | Code | ((cxt: KeywordErrorCxt) => string | Code) + params?: Code | ((cxt: KeywordErrorCxt) => Code) +} + +export type Vocabulary = (KeywordDefinition | string)[] + +export interface KeywordErrorCxt { + gen: CodeGen + keyword: string + data: Name + $data?: string | false + schema: any // TODO + parentSchema?: AnySchemaObject + schemaCode: Code | number | boolean + schemaValue: Code | number | boolean + schemaType?: JSONType[] + errsCount?: Name + params: KeywordCxtParams + it: SchemaCxt +} + +export type KeywordCxtParams = {[P in string]?: Code | string | number} + +export type FormatValidator = (data: T) => boolean + +export type FormatCompare = (data1: T, data2: T) => number | undefined + +export type AsyncFormatValidator = (data: T) => Promise + +export interface FormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: FormatValidator | (T extends string ? string | RegExp : never) + async?: false | undefined + compare?: FormatCompare +} + +export interface AsyncFormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: AsyncFormatValidator + async: true + compare?: FormatCompare +} + +export type AddedFormat = + | true + | RegExp + | FormatValidator + | FormatDefinition + | FormatDefinition + | AsyncFormatDefinition + | AsyncFormatDefinition + +export type Format = AddedFormat | string + +export interface RegExpEngine { + (pattern: string, u: string): RegExpLike + code: string +} + +export interface RegExpLike { + test: (s: string) => boolean +} + +export interface UriResolver { + parse(uri: string): URIComponent + resolve(base: string, path: string): string + serialize(component: URIComponent): string +} diff --git a/node_modules/ajv/lib/types/json-schema.ts b/node_modules/ajv/lib/types/json-schema.ts new file mode 100644 index 0000000000000000000000000000000000000000..065c972e54a179b74e9dee48fdea8a1c2d45c8a1 --- /dev/null +++ b/node_modules/ajv/lib/types/json-schema.ts @@ -0,0 +1,187 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ +type StrictNullChecksWrapper = undefined extends null + ? `strictNullChecks must be true in tsconfig to use ${Name}` + : Type + +type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void + ? I + : never + +export type SomeJSONSchema = UncheckedJSONSchemaType + +type UncheckedPartialSchema = Partial> + +export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema> + +type JSONType = IsPartial extends true + ? T | undefined + : T + +interface NumberKeywords { + minimum?: number + maximum?: number + exclusiveMinimum?: number + exclusiveMaximum?: number + multipleOf?: number + format?: string +} + +interface StringKeywords { + minLength?: number + maxLength?: number + pattern?: string + format?: string +} + +type UncheckedJSONSchemaType = ( + | // these two unions allow arbitrary unions of types + { + anyOf: readonly UncheckedJSONSchemaType[] + } + | { + oneOf: readonly UncheckedJSONSchemaType[] + } + // this union allows for { type: (primitive)[] } style schemas + | ({ + type: readonly (T extends number + ? JSONType<"number" | "integer", IsPartial> + : T extends string + ? JSONType<"string", IsPartial> + : T extends boolean + ? JSONType<"boolean", IsPartial> + : never)[] + } & UnionToIntersection< + T extends number + ? NumberKeywords + : T extends string + ? StringKeywords + : T extends boolean + ? // eslint-disable-next-line @typescript-eslint/ban-types + {} + : never + >) + // this covers "normal" types; it's last so typescript looks to it first for errors + | ((T extends number + ? { + type: JSONType<"number" | "integer", IsPartial> + } & NumberKeywords + : T extends string + ? { + type: JSONType<"string", IsPartial> + } & StringKeywords + : T extends boolean + ? { + type: JSONType<"boolean", IsPartial> + } + : T extends readonly [any, ...any[]] + ? { + // JSON AnySchema for tuple + type: JSONType<"array", IsPartial> + items: { + readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable + } & {length: T["length"]} + minItems: T["length"] + } & ({maxItems: T["length"]} | {additionalItems: false}) + : T extends readonly any[] + ? { + type: JSONType<"array", IsPartial> + items: UncheckedJSONSchemaType + contains?: UncheckedPartialSchema + minItems?: number + maxItems?: number + minContains?: number + maxContains?: number + uniqueItems?: true + additionalItems?: never + } + : T extends Record + ? { + // JSON AnySchema for records and dictionaries + // "required" is not optional because it is often forgotten + // "properties" are optional for more concise dictionary schemas + // "patternProperties" and can be only used with interfaces that have string index + type: JSONType<"object", IsPartial> + additionalProperties?: boolean | UncheckedJSONSchemaType + unevaluatedProperties?: boolean | UncheckedJSONSchemaType + properties?: IsPartial extends true + ? Partial> + : UncheckedPropertiesSchema + patternProperties?: Record> + propertyNames?: Omit, "type"> & {type?: "string"} + dependencies?: {[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema} + dependentRequired?: {[K in keyof T]?: readonly (keyof T)[]} + dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema} + minProperties?: number + maxProperties?: number + } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties + ? {required: readonly (keyof T)[]} + : [UncheckedRequiredMembers] extends [never] + ? {required?: readonly UncheckedRequiredMembers[]} + : {required: readonly UncheckedRequiredMembers[]}) + : T extends null + ? { + type: JSONType<"null", IsPartial> + nullable: true + } + : never) & { + allOf?: readonly UncheckedPartialSchema[] + anyOf?: readonly UncheckedPartialSchema[] + oneOf?: readonly UncheckedPartialSchema[] + if?: UncheckedPartialSchema + then?: UncheckedPartialSchema + else?: UncheckedPartialSchema + not?: UncheckedPartialSchema + }) +) & { + [keyword: string]: any + $id?: string + $ref?: string + $defs?: Record> + definitions?: Record> +} + +export type JSONSchemaType = StrictNullChecksWrapper< + "JSONSchemaType", + UncheckedJSONSchemaType +> + +type Known = + | {[key: string]: Known} + | [Known, ...Known[]] + | Known[] + | number + | string + | boolean + | null + +type UncheckedPropertiesSchema = { + [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | {$ref: string} +} + +export type PropertiesSchema = StrictNullChecksWrapper< + "PropertiesSchema", + UncheckedPropertiesSchema +> + +type UncheckedRequiredMembers = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +export type RequiredMembers = StrictNullChecksWrapper< + "RequiredMembers", + UncheckedRequiredMembers +> + +type Nullable = undefined extends T + ? { + nullable: true + const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const + enum?: readonly (T | null)[] // `null` must be explicitly included in "enum" for `null` to pass + default?: T | null + } + : { + nullable?: false + const?: T + enum?: readonly T[] + default?: T + } diff --git a/node_modules/ajv/lib/types/jtd-schema.ts b/node_modules/ajv/lib/types/jtd-schema.ts new file mode 100644 index 0000000000000000000000000000000000000000..61b2bde81d5f5d407971855d0a2c8125aeb53463 --- /dev/null +++ b/node_modules/ajv/lib/types/jtd-schema.ts @@ -0,0 +1,273 @@ +/** numeric strings */ +type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +/** string strings */ +type StringType = "string" | "timestamp" + +/** Generic JTD Schema without inference of the represented type */ +export type SomeJTDSchemaType = ( + | // ref + {ref: string} + // primitives + | {type: NumberType | StringType | "boolean"} + // enum + | {enum: string[]} + // elements + | {elements: SomeJTDSchemaType} + // values + | {values: SomeJTDSchemaType} + // properties + | { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + | { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + // discriminator + | {discriminator: string; mapping: Record} + // empty + // NOTE see the end of + // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + // eslint-disable-next-line @typescript-eslint/ban-types + | {} +) & { + nullable?: boolean + metadata?: Record + definitions?: Record +} + +/** required keys of an object, not undefined */ +type RequiredKeys = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +/** optional or undifined-able keys of an object */ +type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] ? K : never +}[keyof T] + +/** type is true if T is a union type */ +type IsUnion_ = false extends ( + T extends unknown ? ([U] extends [T] ? false : true) : never +) + ? false + : true +type IsUnion = IsUnion_ + +/** type is true if T is identically E */ +type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false + +/** type is true if T or null is identically E or null*/ +type NullTypeEquality = TypeEquality + +/** gets only the string literals of a type or null if a type isn't a string literal */ +type EnumString = [T] extends [never] + ? null + : T extends string + ? string extends T + ? null + : T + : null + +/** true if type is a union of string literals */ +type IsEnum = null extends EnumString ? false : true + +/** true only if all types are array types (not tuples) */ +// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays +// have an index at every number +type IsElements = false extends IsUnion + ? [T] extends [readonly unknown[]] + ? undefined extends T[0.5] + ? false + : true + : false + : false + +/** true if the the type is a values type */ +type IsValues = false extends IsUnion ? TypeEquality : false + +/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ +type IsRecord = Union extends IsUnion + ? null extends EnumString + ? false + : true + : false + +/** true if type represents an empty record */ +type IsEmptyRecord = [T] extends [Record] + ? [T] extends [never] + ? false + : true + : false + +/** actual schema */ +export type JTDSchemaType = Record> = ( + | // refs - where null wasn't specified, must match exactly + (null extends EnumString + ? never + : + | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false}) + // nulled refs - if ref is nullable and nullable is specified, then it can + // match either null or non-null definitions + | (null extends T + ? { + [K in keyof D]: [Exclude] extends [Exclude] + ? {ref: K} + : never + }[keyof D] & {nullable: true} + : never)) + // empty - empty schemas also treat nullable differently in that it's now fully ignored + | (unknown extends T ? {nullable?: boolean} : never) + // all other types // numbers - only accepts the type number + | ((true extends NullTypeEquality + ? {type: NumberType} + : // booleans - accepts the type boolean + true extends NullTypeEquality + ? {type: "boolean"} + : // strings - only accepts the type string + true extends NullTypeEquality + ? {type: StringType} + : // strings - only accepts the type Date + true extends NullTypeEquality + ? {type: "timestamp"} + : // enums - only accepts union of string literals + // TODO we can't actually check that everything in the union was specified + true extends IsEnum> + ? {enum: EnumString>[]} + : // arrays - only accepts arrays, could be array of unions to be resolved later + true extends IsElements> + ? T extends readonly (infer E)[] + ? { + elements: JTDSchemaType + } + : never + : // empty properties + true extends IsEmptyRecord> + ? + | {properties: Record; optionalProperties?: Record} + | {optionalProperties: Record} + : // values + true extends IsValues> + ? T extends Record + ? { + values: JTDSchemaType + } + : never + : // properties + true extends IsRecord, false> + ? ([RequiredKeys>] extends [never] + ? { + properties?: Record + } + : { + properties: {[K in RequiredKeys]: JTDSchemaType} + }) & + ([OptionalKeys>] extends [never] + ? { + optionalProperties?: Record + } + : { + optionalProperties: { + [K in OptionalKeys]: JTDSchemaType, D> + } + }) & { + additionalProperties?: boolean + } + : // discriminator + true extends IsRecord, true> + ? { + [K in keyof Exclude]-?: Exclude[K] extends string + ? { + discriminator: K + mapping: { + // TODO currently allows descriminator to be present in schema + [M in Exclude[K]]: JTDSchemaType< + Omit ? T : never, K>, + D + > + } + } + : never + }[keyof Exclude] + : never) & + (null extends T + ? { + nullable: true + } + : {nullable?: false})) +) & { + // extra properties + metadata?: Record + // TODO these should only be allowed at the top level + definitions?: {[K in keyof D]: JTDSchemaType} +} + +type JTDDataDef> = + | // ref + (S extends {ref: string} + ? D extends {[K in S["ref"]]: infer V} + ? JTDDataDef + : never + : // type + S extends {type: NumberType} + ? number + : S extends {type: "boolean"} + ? boolean + : S extends {type: "string"} + ? string + : S extends {type: "timestamp"} + ? string | Date + : // enum + S extends {enum: readonly (infer E)[]} + ? string extends E + ? never + : [E] extends [string] + ? E + : never + : // elements + S extends {elements: infer E} + ? JTDDataDef[] + : // properties + S extends { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : S extends { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : // values + S extends {values: infer V} + ? Record> + : // discriminator + S extends {discriminator: infer M; mapping: Record} + ? [M] extends [string] + ? { + [K in keyof S["mapping"]]: JTDDataDef & {[KM in M]: K} + }[keyof S["mapping"]] + : never + : // empty + unknown) + | (S extends {nullable: true} ? null : never) + +export type JTDDataType = S extends {definitions: Record} + ? JTDDataDef + : JTDDataDef> diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts new file mode 100644 index 0000000000000000000000000000000000000000..755e5b3daf551d68ffbe3bd45884ee650094a46d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts @@ -0,0 +1,56 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "additionalItems" as const, + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {parentSchema, it} = cxt + const {items} = parentSchema + if (!Array.isArray(items)) { + checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') + return + } + validateAdditionalItems(cxt, items) + }, +} + +export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void { + const {gen, schema, data, keyword, it} = cxt + it.items = true + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items.length}) + cxt.pass(_`${len} <= ${items.length}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var + gen.if(not(valid), () => validateItems(valid)) + cxt.ok(valid) + } + + function validateItems(valid: Name): void { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfb511ce5100f4902f0f9c17ce7d7886e95fcabc --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts @@ -0,0 +1,118 @@ +import type { + CodeKeywordDefinition, + AddedKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import {allSchemaProperties, usePattern, isOwnProperty} from "../code" +import {_, nil, or, not, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import type {SubschemaArgs} from "../../compile/validate/subschema" +import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util" + +export type AdditionalPropertiesError = ErrorObject< + "additionalProperties", + {additionalProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have additional properties", + params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +} + +const def: CodeKeywordDefinition & AddedKeywordDefinition = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const {gen, schema, parentSchema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, opts} = it + it.props = true + if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return + const props = allSchemaProperties(parentSchema.properties) + const patProps = allSchemaProperties(parentSchema.patternProperties) + checkAdditionalProperties() + cxt.ok(_`${errsCount} === ${N.errors}`) + + function checkAdditionalProperties(): void { + gen.forIn("key", data, (key: Name) => { + if (!props.length && !patProps.length) additionalPropertyCode(key) + else gen.if(isAdditional(key), () => additionalPropertyCode(key)) + }) + } + + function isAdditional(key: Name): Code { + let definedProp: Code + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties") + definedProp = isOwnProperty(gen, propsSchema as Code, key) + } else if (props.length) { + definedProp = or(...props.map((p) => _`${key} === ${p}`)) + } else { + definedProp = nil + } + if (patProps.length) { + definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`)) + } + return not(definedProp) + } + + function deleteAdditional(key: Name): void { + gen.code(_`delete ${data}[${key}]`) + } + + function additionalPropertyCode(key: Name): void { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key) + return + } + + if (schema === false) { + cxt.setParams({additionalProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false) + gen.if(not(valid), () => { + cxt.reset() + deleteAdditional(key) + }) + } else { + applyAdditionalSchema(key, valid) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + } + + function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void { + const subschema: SubschemaArgs = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: Type.Str, + } + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }) + } + cxt.subschema(subschema, valid) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/allOf.ts b/node_modules/ajv/lib/vocabularies/applicator/allOf.ts new file mode 100644 index 0000000000000000000000000000000000000000..cdfa86ff431396a7cf68b937cb9baa69d4e79f29 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/allOf.ts @@ -0,0 +1,22 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "allOf", + schemaType: "array", + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const valid = gen.name("valid") + schema.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid) + cxt.ok(valid) + cxt.mergeEvaluated(schCxt) + }) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts b/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts new file mode 100644 index 0000000000000000000000000000000000000000..bd331b5ae98a72f1a6d79aacdf2d4babd16bde35 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import {validateUnion} from "../code" + +export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]> + +const def: CodeKeywordDefinition = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in anyOf"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/contains.ts b/node_modules/ajv/lib/vocabularies/applicator/contains.ts new file mode 100644 index 0000000000000000000000000000000000000000..d88675c6c2a21db9fa9e0ce497646fda1bf5d5a6 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/contains.ts @@ -0,0 +1,109 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type ContainsError = ErrorObject< + "contains", + {minContains: number; maxContains?: number}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: ({params: {min, max}}) => + max === undefined + ? str`must contain at least ${min} valid item(s)` + : str`must contain at least ${min} and no more than ${max} valid item(s)`, + params: ({params: {min, max}}) => + max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + let min: number + let max: number | undefined + const {minContains, maxContains} = parentSchema + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains + max = maxContains + } else { + min = 1 + } + const len = gen.const("len", _`${data}.length`) + cxt.setParams({min, max}) + if (max === undefined && min === 0) { + checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`) + return + } + if (max !== undefined && min > max) { + checkStrictMode(it, `"minContains" > "maxContains" is always invalid`) + cxt.fail() + return + } + if (alwaysValidSchema(it, schema)) { + let cond = _`${len} >= ${min}` + if (max !== undefined) cond = _`${cond} && ${len} <= ${max}` + cxt.pass(cond) + return + } + + it.items = true + const valid = gen.name("valid") + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())) + } else if (min === 0) { + gen.let(valid, true) + if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount) + } else { + gen.let(valid, false) + validateItemsWithCount() + } + cxt.result(valid, () => cxt.reset()) + + function validateItemsWithCount(): void { + const schValid = gen.name("_valid") + const count = gen.let("count", 0) + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) + } + + function validateItems(_valid: Name, block: () => void): void { + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword: "contains", + dataProp: i, + dataPropType: Type.Num, + compositeRule: true, + }, + _valid + ) + block() + }) + } + + function checkLimits(count: Name): void { + gen.code(_`${count}++`) + if (max === undefined) { + gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break()) + } else { + gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break()) + if (min === 1) gen.assign(valid, true) + else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true)) + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts b/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6761128698689ce1d4699c33a3b128516157eeb --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts @@ -0,0 +1,112 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaMap, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code" + +export type PropertyDependencies = {[K in string]?: string[]} + +export interface DependenciesErrorParams { + property: string + missingProperty: string + depsCount: number + deps: string // TODO change to string[] +} + +type SchemaDependencies = SchemaMap + +export type DependenciesError = ErrorObject< + "dependencies", + DependenciesErrorParams, + {[K in string]?: string[] | AnySchema} +> + +export const error: KeywordErrorDefinition = { + message: ({params: {property, depsCount, deps}}) => { + const property_ies = depsCount === 1 ? "property" : "properties" + return str`must have ${property_ies} ${deps} when property ${property} is present` + }, + params: ({params: {property, depsCount, deps, missingProperty}}) => + _`{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, // TODO change to reference +} + +const def: CodeKeywordDefinition = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const [propDeps, schDeps] = splitDependencies(cxt) + validatePropertyDeps(cxt, propDeps) + validateSchemaDeps(cxt, schDeps) + }, +} + +function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] { + const propertyDeps: PropertyDependencies = {} + const schemaDeps: SchemaDependencies = {} + for (const key in schema) { + if (key === "__proto__") continue + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps + deps[key] = schema[key] + } + return [propertyDeps, schemaDeps] +} + +export function validatePropertyDeps( + cxt: KeywordCxt, + propertyDeps: {[K in string]?: string[]} = cxt.schema +): void { + const {gen, data, it} = cxt + if (Object.keys(propertyDeps).length === 0) return + const missing = gen.let("missing") + for (const prop in propertyDeps) { + const deps = propertyDeps[prop] as string[] + if (deps.length === 0) continue + const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties) + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }) + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + checkReportMissingProp(cxt, depProp) + } + }) + } else { + gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`) + reportMissingProp(cxt, missing) + gen.else() + } + } +} + +export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + for (const prop in schemaDeps) { + if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => { + const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid) + cxt.mergeValidEvaluated(schCxt, valid) + }, + () => gen.var(valid, true) // TODO var + ) + cxt.ok(valid) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts b/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbd3ae45c38f2e0a4c958a83694eaf5844440e7e --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts @@ -0,0 +1,11 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateSchemaDeps} from "./dependencies" + +const def: CodeKeywordDefinition = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => validateSchemaDeps(cxt), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/if.ts b/node_modules/ajv/lib/vocabularies/applicator/if.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a40d5e3ad2ca0ee8bffb0bc10c361580a15378f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/if.ts @@ -0,0 +1,80 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {SchemaObjCxt} from "../../compile" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" + +export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params}) => str`must match "${params.ifClause}" schema`, + params: ({params}) => _`{failingKeyword: ${params.ifClause}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, parentSchema, it} = cxt + if (parentSchema.then === undefined && parentSchema.else === undefined) { + checkStrictMode(it, '"if" without "then" and "else" is ignored') + } + const hasThen = hasSchema(it, "then") + const hasElse = hasSchema(it, "else") + if (!hasThen && !hasElse) return + + const valid = gen.let("valid", true) + const schValid = gen.name("_valid") + validateIf() + cxt.reset() + + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause") + cxt.setParams({ifClause}) + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)) + } else if (hasThen) { + gen.if(schValid, validateClause("then")) + } else { + gen.if(not(schValid), validateClause("else")) + } + + cxt.pass(valid, () => cxt.error(true)) + + function validateIf(): void { + const schCxt = cxt.subschema( + { + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + schValid + ) + cxt.mergeEvaluated(schCxt) + } + + function validateClause(keyword: string, ifClause?: Name): () => void { + return () => { + const schCxt = cxt.subschema({keyword}, schValid) + gen.assign(valid, schValid) + cxt.mergeValidEvaluated(schCxt, valid) + if (ifClause) gen.assign(ifClause, _`${keyword}`) + else cxt.setParams({ifClause: keyword}) + } + } + }, +} + +function hasSchema(it: SchemaObjCxt, keyword: string): boolean { + const schema = it.schema[keyword] + return schema !== undefined && !alwaysValidSchema(it, schema) +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/index.ts b/node_modules/ajv/lib/vocabularies/applicator/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc527169967c8e3ae32b13ee19c9ad20dc5794cc --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/index.ts @@ -0,0 +1,53 @@ +import type {ErrorNoParams, Vocabulary} from "../../types" +import additionalItems, {AdditionalItemsError} from "./additionalItems" +import prefixItems from "./prefixItems" +import items from "./items" +import items2020, {ItemsError} from "./items2020" +import contains, {ContainsError} from "./contains" +import dependencies, {DependenciesError} from "./dependencies" +import propertyNames, {PropertyNamesError} from "./propertyNames" +import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties" +import properties from "./properties" +import patternProperties from "./patternProperties" +import notKeyword, {NotKeywordError} from "./not" +import anyOf, {AnyOfError} from "./anyOf" +import oneOf, {OneOfError} from "./oneOf" +import allOf from "./allOf" +import ifKeyword, {IfKeywordError} from "./if" +import thenElse from "./thenElse" + +export default function getApplicator(draft2020 = false): Vocabulary { + const applicator = [ + // any + notKeyword, + anyOf, + oneOf, + allOf, + ifKeyword, + thenElse, + // object + propertyNames, + additionalProperties, + dependencies, + properties, + patternProperties, + ] + // array + if (draft2020) applicator.push(prefixItems, items2020) + else applicator.push(additionalItems, items) + applicator.push(contains) + return applicator +} + +export type ApplicatorKeywordError = + | ErrorNoParams<"false schema"> + | AdditionalItemsError + | ItemsError + | ContainsError + | AdditionalPropertiesError + | DependenciesError + | IfKeywordError + | AnyOfError + | OneOfError + | NotKeywordError + | PropertyNamesError diff --git a/node_modules/ajv/lib/vocabularies/applicator/items.ts b/node_modules/ajv/lib/vocabularies/applicator/items.ts new file mode 100644 index 0000000000000000000000000000000000000000..033cb3977342222bc90a44251bc9366b151cff9f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/items.ts @@ -0,0 +1,59 @@ +import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util" +import {validateArray} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt: KeywordCxt) { + const {schema, it} = cxt + if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema) + it.items = true + if (alwaysValidSchema(it, schema)) return + cxt.ok(validateArray(cxt)) + }, +} + +export function validateTuple( + cxt: KeywordCxt, + extraItems: string, + schArr: AnySchema[] = cxt.schema +): void { + const {gen, parentSchema, data, keyword, it} = cxt + checkStrictTuple(parentSchema) + if (it.opts.unevaluated && schArr.length && it.items !== true) { + it.items = mergeEvaluated.items(gen, schArr.length, it.items) + } + const valid = gen.name("valid") + const len = gen.const("len", _`${data}.length`) + schArr.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + gen.if(_`${len} > ${i}`, () => + cxt.subschema( + { + keyword, + schemaProp: i, + dataProp: i, + }, + valid + ) + ) + cxt.ok(valid) + }) + + function checkStrictTuple(sch: AnySchemaObject): void { + const {opts, errSchemaPath} = it + const l = schArr.length + const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false) + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"` + checkStrictMode(it, msg, opts.strictTuples) + } + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/items2020.ts b/node_modules/ajv/lib/vocabularies/applicator/items2020.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a99b08d59adc2ce8fc6c785a5ccc34c0960c1f9 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/items2020.ts @@ -0,0 +1,36 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {validateAdditionalItems} from "./additionalItems" + +export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {schema, parentSchema, it} = cxt + const {prefixItems} = parentSchema + it.items = true + if (alwaysValidSchema(it, schema)) return + if (prefixItems) validateAdditionalItems(cxt, prefixItems) + else cxt.ok(validateArray(cxt)) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/not.ts b/node_modules/ajv/lib/vocabularies/applicator/not.ts new file mode 100644 index 0000000000000000000000000000000000000000..8691db0bf229b778f88a373110311dff1c69c1dc --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/not.ts @@ -0,0 +1,38 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +export type NotKeywordError = ErrorNoParams<"not", AnySchema> + +const def: CodeKeywordDefinition = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) { + cxt.fail() + return + } + + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + valid + ) + + cxt.failResult( + valid, + () => cxt.reset(), + () => cxt.error() + ) + }, + error: {message: "must NOT be valid"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts b/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts new file mode 100644 index 0000000000000000000000000000000000000000..c25353ffd648c45dce2433c14cb27841763d5435 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts @@ -0,0 +1,82 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, Name} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {SchemaCxt} from "../../compile" + +export type OneOfError = ErrorObject< + "oneOf", + {passingSchemas: [number, number] | null}, + AnySchema[] +> + +const error: KeywordErrorDefinition = { + message: "must match exactly one schema in oneOf", + params: ({params}) => _`{passingSchemas: ${params.passing}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + if (it.opts.discriminator && parentSchema.discriminator) return + const schArr: AnySchema[] = schema + const valid = gen.let("valid", false) + const passing = gen.let("passing", null) + const schValid = gen.name("_valid") + cxt.setParams({passing}) + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + + gen.block(validateOneOf) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) + + function validateOneOf(): void { + schArr.forEach((sch: AnySchema, i: number) => { + let schCxt: SchemaCxt | undefined + if (alwaysValidSchema(it, sch)) { + gen.var(schValid, true) + } else { + schCxt = cxt.subschema( + { + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, + schValid + ) + } + + if (i > 0) { + gen + .if(_`${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, _`[${passing}, ${i}]`) + .else() + } + + gen.if(schValid, () => { + gen.assign(valid, true) + gen.assign(passing, i) + if (schCxt) cxt.mergeEvaluated(schCxt, Name) + }) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea624e230dddb3d71320eb5255a2b89bae5f20b0 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts @@ -0,0 +1,91 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {allSchemaProperties, usePattern} from "../code" +import {_, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" +import {evaluatedPropsToName, Type} from "../../compile/util" +import {AnySchema} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, data, parentSchema, it} = cxt + const {opts} = it + const patterns = allSchemaProperties(schema) + const alwaysValidPatterns = patterns.filter((p) => + alwaysValidSchema(it, schema[p] as AnySchema) + ) + + if ( + patterns.length === 0 || + (alwaysValidPatterns.length === patterns.length && + (!it.opts.unevaluated || it.props === true)) + ) { + return + } + + const checkProperties = + opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties + const valid = gen.name("valid") + if (it.props !== true && !(it.props instanceof Name)) { + it.props = evaluatedPropsToName(gen, it.props) + } + const {props} = it + validatePatternProperties() + + function validatePatternProperties(): void { + for (const pat of patterns) { + if (checkProperties) checkMatchingProperties(pat) + if (it.allErrors) { + validateProperties(pat) + } else { + gen.var(valid, true) // TODO var + validateProperties(pat) + gen.if(valid) + } + } + } + + function checkMatchingProperties(pat: string): void { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + checkStrictMode( + it, + `property ${prop} matches pattern ${pat} (use allowMatchingProperties)` + ) + } + } + } + + function validateProperties(pat: string): void { + gen.forIn("key", data, (key) => { + gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat) + if (!alwaysValid) { + cxt.subschema( + { + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + } + + if (it.opts.unevaluated && props !== true) { + gen.assign(_`${props}[${key}]`, true) + } else if (!alwaysValid && !it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if(not(valid), () => gen.break()) + } + }) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts b/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts new file mode 100644 index 0000000000000000000000000000000000000000..008fb2db1d8dd898fa79226d118530af2628c2c8 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateTuple} from "./items" + +const def: CodeKeywordDefinition = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => validateTuple(cxt, "items"), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/properties.ts b/node_modules/ajv/lib/vocabularies/applicator/properties.ts new file mode 100644 index 0000000000000000000000000000000000000000..a55b19ce5b77d180ce94cb063946a08d22824bd1 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/properties.ts @@ -0,0 +1,57 @@ +import type {CodeKeywordDefinition} from "../../types" +import {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties} from "../code" +import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util" +import apDef from "./additionalProperties" + +const def: CodeKeywordDefinition = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + apDef.code(new KeywordCxt(it, apDef, "additionalProperties")) + } + const allProps = allSchemaProperties(schema) + for (const prop of allProps) { + it.definedProperties.add(prop) + } + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = mergeEvaluated.props(gen, toHash(allProps), it.props) + } + const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p])) + if (properties.length === 0) return + const valid = gen.name("valid") + + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop) + } else { + gen.if(propertyInData(gen, data, prop, it.opts.ownProperties)) + applyPropertySchema(prop) + if (!it.allErrors) gen.else().var(valid, true) + gen.endIf() + } + cxt.it.definedProperties.add(prop) + cxt.ok(valid) + } + + function hasDefault(prop: string): boolean | undefined { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined + } + + function applyPropertySchema(prop: string): void { + cxt.subschema( + { + keyword: "properties", + schemaProp: prop, + dataProp: prop, + }, + valid + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts b/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c54d605258600f3e98d4eeb17e87256be6b9f3f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts @@ -0,0 +1,50 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" + +export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: "property name must be valid", + params: ({params}) => _`{propertyName: ${params.propertyName}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + + gen.forIn("key", data, (key) => { + cxt.setParams({propertyName: key}) + cxt.subschema( + { + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + }, + valid + ) + gen.if(not(valid), () => { + cxt.error(true) + if (!it.allErrors) gen.break() + }) + }) + + cxt.ok(valid) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts b/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts new file mode 100644 index 0000000000000000000000000000000000000000..5055182e89141a257630516d96a52ec2917f72b6 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts @@ -0,0 +1,13 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/code.ts b/node_modules/ajv/lib/vocabularies/code.ts new file mode 100644 index 0000000000000000000000000000000000000000..92cdd5b04ef30e0ed6f3c9025752f0acf59370eb --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/code.ts @@ -0,0 +1,168 @@ +import type {AnySchema, SchemaMap} from "../types" +import type {SchemaCxt} from "../compile" +import type {KeywordCxt} from "../compile/validate" +import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" +import {alwaysValidSchema, Type} from "../compile/util" +import N from "../compile/names" +import {useFunc} from "../compile/util" +export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void { + const {gen, data, it} = cxt + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { + cxt.setParams({missingProperty: _`${prop}`}, true) + cxt.error() + }) +} + +export function checkMissingProp( + {gen, data, it: {opts}}: KeywordCxt, + properties: string[], + missing: Name +): Code { + return or( + ...properties.map((prop) => + and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`) + ) + ) +} + +export function reportMissingProp(cxt: KeywordCxt, missing: Name): void { + cxt.setParams({missingProperty: missing}, true) + cxt.error() +} + +export function hasPropFunc(gen: CodeGen): Name { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: _`Object.prototype.hasOwnProperty`, + }) +} + +export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code { + return _`${hasPropFunc(gen)}.call(${data}, ${property})` +} + +export function propertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} !== undefined` + return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond +} + +export function noPropertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} === undefined` + return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond +} + +export function allSchemaProperties(schemaMap?: SchemaMap): string[] { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [] +} + +export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] { + return allSchemaProperties(schemaMap).filter( + (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema) + ) +} + +export function callValidateCode( + {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt, + func: Code, + context: Code, + passSchema?: boolean +): Code { + const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data + const valCxt: [Name, Code | number][] = [ + [N.instancePath, strConcat(N.instancePath, errorPath)], + [N.parentData, it.parentData], + [N.parentDataProperty, it.parentDataProperty], + [N.rootData, N.rootData], + ] + if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors]) + const args = _`${dataAndSchema}, ${gen.object(...valCxt)}` + return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})` +} + +const newRegExp = _`new RegExp` + +export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { + const u = opts.unicodeRegExp ? "u" : "" + const {regExp} = opts.code + const rx = regExp(pattern, u) + + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`, + }) +} + +export function validateArray(cxt: KeywordCxt): Name { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + if (it.allErrors) { + const validArr = gen.let("valid", true) + validateItems(() => gen.assign(validArr, false)) + return validArr + } + gen.var(valid, true) + validateItems(() => gen.break()) + return valid + + function validateItems(notValid: () => void): void { + const len = gen.const("len", _`${data}.length`) + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword, + dataProp: i, + dataPropType: Type.Num, + }, + valid + ) + gen.if(not(valid), notValid) + }) + } +} + +export function validateUnion(cxt: KeywordCxt): void { + const {gen, schema, keyword, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch)) + if (alwaysValid && !it.opts.unevaluated) return + + const valid = gen.let("valid", false) + const schValid = gen.name("_valid") + + gen.block(() => + schema.forEach((_sch: AnySchema, i: number) => { + const schCxt = cxt.subschema( + { + keyword, + schemaProp: i, + compositeRule: true, + }, + schValid + ) + gen.assign(valid, _`${valid} || ${schValid}`) + const merged = cxt.mergeValidEvaluated(schCxt, schValid) + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) gen.if(not(valid)) + }) + ) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) +} diff --git a/node_modules/ajv/lib/vocabularies/core/id.ts b/node_modules/ajv/lib/vocabularies/core/id.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa36c4bb20f45046bb46fc998ca39fa2d9589811 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/id.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/core/index.ts b/node_modules/ajv/lib/vocabularies/core/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..e63e2895d08710745fe5785bbdb1aaf155e05407 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/index.ts @@ -0,0 +1,16 @@ +import type {Vocabulary} from "../../types" +import idKeyword from "./id" +import refKeyword from "./ref" + +const core: Vocabulary = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + {keyword: "$comment"}, + "definitions", + idKeyword, + refKeyword, +] + +export default core diff --git a/node_modules/ajv/lib/vocabularies/core/ref.ts b/node_modules/ajv/lib/vocabularies/core/ref.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d59fbcb2a99564106fdcafe244f693bc88e3ea2 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/ref.ts @@ -0,0 +1,129 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import MissingRefError from "../../compile/ref_error" +import {callValidateCode} from "../code" +import {_, nil, stringify, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, resolveRef} from "../../compile" +import {mergeEvaluated} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$ref", + schemaType: "string", + code(cxt: KeywordCxt): void { + const {gen, schema: $ref, it} = cxt + const {baseId, schemaEnv: env, validateName, opts, self} = it + const {root} = env + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef() + const schOrEnv = resolveRef.call(self, root, baseId, $ref) + if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref) + if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) + return inlineRefSchema(schOrEnv) + + function callRootRef(): void { + if (env === root) return callRef(cxt, validateName, env, env.$async) + const rootName = gen.scopeValue("root", {ref: root}) + return callRef(cxt, _`${rootName}.validate`, root, root.$async) + } + + function callValidate(sch: SchemaEnv): void { + const v = getValidate(cxt, sch) + callRef(cxt, v, sch, sch.$async) + } + + function inlineRefSchema(sch: AnySchema): void { + const schName = gen.scopeValue( + "schema", + opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch} + ) + const valid = gen.name("valid") + const schCxt = cxt.subschema( + { + schema: sch, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: $ref, + }, + valid + ) + cxt.mergeEvaluated(schCxt) + cxt.ok(valid) + } + }, +} + +export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code { + const {gen} = cxt + return sch.validate + ? gen.scopeValue("validate", {ref: sch.validate}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.validate` +} + +export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void { + const {gen, it} = cxt + const {allErrors, schemaEnv: env, opts} = it + const passCxt = opts.passContext ? N.this : nil + if ($async) callAsyncRef() + else callSyncRef() + + function callAsyncRef(): void { + if (!env.$async) throw new Error("async schema referenced by sync schema") + const valid = gen.let("valid") + gen.try( + () => { + gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`) + addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result + if (!allErrors) gen.assign(valid, true) + }, + (e) => { + gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e)) + addErrorsFrom(e) + if (!allErrors) gen.assign(valid, false) + } + ) + cxt.ok(valid) + } + + function callSyncRef(): void { + cxt.result( + callValidateCode(cxt, v, passCxt), + () => addEvaluatedFrom(v), + () => addErrorsFrom(v) + ) + } + + function addErrorsFrom(source: Code): void { + const errs = _`${source}.errors` + gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged + gen.assign(N.errors, _`${N.vErrors}.length`) + } + + function addEvaluatedFrom(source: Code): void { + if (!it.opts.unevaluated) return + const schEvaluated = sch?.validate?.evaluated + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props) + } + } else { + const props = gen.var("props", _`${source}.evaluated.props`) + it.props = mergeEvaluated.props(gen, props, it.props, Name) + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items) + } + } else { + const items = gen.var("items", _`${source}.evaluated.items`) + it.items = mergeEvaluated.items(gen, items, it.items, Name) + } + } + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/index.ts b/node_modules/ajv/lib/vocabularies/discriminator/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..19ae6049f3464d2dd7518de70a9f10842aa88d66 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/discriminator/index.ts @@ -0,0 +1,113 @@ +import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Name} from "../../compile/codegen" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" +import {resolveRef, SchemaEnv} from "../../compile" +import MissingRefError from "../../compile/ref_error" +import {schemaHasRulesButRef} from "../../compile/util" + +export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: ({params: {discrError, tagName}}) => + discrError === DiscrError.Tag + ? `tag "${tagName}" must be string` + : `value of tag "${tagName}" must be in oneOf`, + params: ({params: {discrError, tag, tagName}}) => + _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const {gen, data, schema, parentSchema, it} = cxt + const {oneOf} = parentSchema + if (!it.opts.discriminator) { + throw new Error("discriminator: requires discriminator option") + } + const tagName = schema.propertyName + if (typeof tagName != "string") throw new Error("discriminator: requires propertyName") + if (schema.mapping) throw new Error("discriminator: mapping is not supported") + if (!oneOf) throw new Error("discriminator: requires oneOf keyword") + const valid = gen.let("valid", false) + const tag = gen.const("tag", _`${data}${getProperty(tagName)}`) + gen.if( + _`typeof ${tag} == "string"`, + () => validateMapping(), + () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName}) + ) + cxt.ok(valid) + + function validateMapping(): void { + const mapping = getMapping() + gen.if(false) + for (const tagValue in mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(mapping[tagValue])) + } + gen.else() + cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName}) + gen.endIf() + } + + function applyTagSchema(schemaProp?: number): Name { + const _valid = gen.name("valid") + const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid) + cxt.mergeEvaluated(schCxt, Name) + return _valid + } + + function getMapping(): {[T in string]?: number} { + const oneOfMapping: {[T in string]?: number} = {} + const topRequired = hasRequired(parentSchema) + let tagRequired = true + for (let i = 0; i < oneOf.length; i++) { + let sch = oneOf[i] + if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) { + const ref = sch.$ref + sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref) + if (sch instanceof SchemaEnv) sch = sch.schema + if (sch === undefined) throw new MissingRefError(it.opts.uriResolver, it.baseId, ref) + } + const propSch = sch?.properties?.[tagName] + if (typeof propSch != "object") { + throw new Error( + `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"` + ) + } + tagRequired = tagRequired && (topRequired || hasRequired(sch)) + addMappings(propSch, i) + } + if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`) + return oneOfMapping + + function hasRequired({required}: AnySchemaObject): boolean { + return Array.isArray(required) && required.includes(tagName) + } + + function addMappings(sch: AnySchemaObject, i: number): void { + if (sch.const) { + addMapping(sch.const, i) + } else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i) + } + } else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`) + } + } + + function addMapping(tagValue: unknown, i: number): void { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`) + } + oneOfMapping[tagValue] = i + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/types.ts b/node_modules/ajv/lib/vocabularies/discriminator/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..bee5a278508e4926b85cf397fb601a7a3c2a78cb --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/discriminator/types.ts @@ -0,0 +1,12 @@ +import type {ErrorObject} from "../../types" + +export enum DiscrError { + Tag = "tag", + Mapping = "mapping", +} + +export type DiscrErrorObj = ErrorObject< + "discriminator", + {error: E; tag: string; tagValue: unknown}, + string +> diff --git a/node_modules/ajv/lib/vocabularies/draft2020.ts b/node_modules/ajv/lib/vocabularies/draft2020.ts new file mode 100644 index 0000000000000000000000000000000000000000..47fbf0ee6d75112abf222611ca514973833c8b53 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/draft2020.ts @@ -0,0 +1,23 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import dynamicVocabulary from "./dynamic" +import nextVocabulary from "./next" +import unevaluatedVocabulary from "./unevaluated" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft2020Vocabularies: Vocabulary[] = [ + dynamicVocabulary, + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(true), + formatVocabulary, + metadataVocabulary, + contentVocabulary, + nextVocabulary, + unevaluatedVocabulary, +] + +export default draft2020Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/draft7.ts b/node_modules/ajv/lib/vocabularies/draft7.ts new file mode 100644 index 0000000000000000000000000000000000000000..226a644aa428d808c22dfd6808392fada925ae5e --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/draft7.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft7Vocabularies: Vocabulary[] = [ + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(), + formatVocabulary, + metadataVocabulary, + contentVocabulary, +] + +export default draft7Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca1adb912af0347a3bb8e18ca50cf51405f2ba1f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts @@ -0,0 +1,31 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, compileSchema} from "../../compile" +import {getValidate} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +} + +export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void { + const {gen, it} = cxt + it.schemaEnv.root.dynamicAnchors[anchor] = true + const v = _`${N.dynamicAnchors}${getProperty(anchor)}` + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt) + gen.if(_`!${v}`, () => gen.assign(v, validate)) +} + +function _getValidate(cxt: KeywordCxt): Code { + const {schemaEnv, schema, self} = cxt.it + const {root, baseId, localRefs, meta} = schemaEnv.root + const {schemaId} = self.opts + const sch = new SchemaEnv({schema, schemaId, root, baseId, localRefs, meta}) + compileSchema.call(self, sch) + return getValidate(cxt, sch) +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a573f33024b4fc5045f17f0c251a3d6c75a22a7 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts @@ -0,0 +1,51 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {callRef} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export function dynamicRef(cxt: KeywordCxt, ref: string): void { + const {gen, keyword, it} = cxt + if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`) + const anchor = ref.slice(1) + if (it.allErrors) { + _dynamicRef() + } else { + const valid = gen.let("valid", false) + _dynamicRef(valid) + cxt.ok(valid) + } + + function _dynamicRef(valid?: Name): void { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`) + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)) + } else { + _callRef(it.validateName, valid)() + } + } + + function _callRef(validate: Code, valid?: Name): () => void { + return valid + ? () => + gen.block(() => { + callRef(cxt, validate) + gen.let(valid, true) + }) + : () => callRef(cxt, validate) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/index.ts b/node_modules/ajv/lib/vocabularies/dynamic/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d521db6638b890151a7a901991f91793553dab0 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/index.ts @@ -0,0 +1,9 @@ +import type {Vocabulary} from "../../types" +import dynamicAnchor from "./dynamicAnchor" +import dynamicRef from "./dynamicRef" +import recursiveAnchor from "./recursiveAnchor" +import recursiveRef from "./recursiveRef" + +const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef] + +export default dynamic diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts new file mode 100644 index 0000000000000000000000000000000000000000..25f3db96bf07a2c60fc3eb860ea93ee6337e0137 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicAnchor} from "./dynamicAnchor" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) dynamicAnchor(cxt, "") + else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored") + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts new file mode 100644 index 0000000000000000000000000000000000000000..c84af0f05785affe11983f39f605a53502358c67 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicRef} from "./dynamicRef" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/errors.ts b/node_modules/ajv/lib/vocabularies/errors.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9ca3f02f040298cd2b2faff35740eaae6ea098e --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/errors.ts @@ -0,0 +1,18 @@ +import type {TypeError} from "../compile/validate/dataType" +import type {ApplicatorKeywordError} from "./applicator" +import type {ValidationKeywordError} from "./validation" +import type {FormatError} from "./format/format" +import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties" +import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems" +import type {DependentRequiredError} from "./validation/dependentRequired" +import type {DiscriminatorError} from "./discriminator" + +export type DefinedError = + | TypeError + | ApplicatorKeywordError + | ValidationKeywordError + | FormatError + | UnevaluatedPropertiesError + | UnevaluatedItemsError + | DependentRequiredError + | DiscriminatorError diff --git a/node_modules/ajv/lib/vocabularies/format/format.ts b/node_modules/ajv/lib/vocabularies/format/format.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b1c13e764375dbb4dff021426a377f8103ab54f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/format/format.ts @@ -0,0 +1,120 @@ +import type { + AddedFormat, + FormatValidator, + AsyncFormatValidator, + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, nil, or, Code, getProperty, regexpCode} from "../../compile/codegen" + +type FormatValidate = + | FormatValidator + | FormatValidator + | AsyncFormatValidator + | AsyncFormatValidator + | RegExp + | string + | true + +export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match format "${schemaCode}"`, + params: ({schemaCode}) => _`{format: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt, ruleType?: string) { + const {gen, data, $data, schema, schemaCode, it} = cxt + const {opts, errSchemaPath, schemaEnv, self} = it + if (!opts.validateFormats) return + + if ($data) validate$DataFormat() + else validateFormat() + + function validate$DataFormat(): void { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }) + const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`) + const fType = gen.let("fType") + const format = gen.let("format") + // TODO simplify + gen.if( + _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, + () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`), + () => gen.assign(fType, _`"string"`).assign(format, fDef) + ) + cxt.fail$data(or(unknownFmt(), invalidFmt())) + + function unknownFmt(): Code { + if (opts.strictSchema === false) return nil + return _`${schemaCode} && !${format}` + } + + function invalidFmt(): Code { + const callFormat = schemaEnv.$async + ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : _`${format}(${data})` + const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))` + return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}` + } + } + + function validateFormat(): void { + const formatDef: AddedFormat | undefined = self.formats[schema] + if (!formatDef) { + unknownFormat() + return + } + if (formatDef === true) return + const [fmtType, format, fmtRef] = getFormat(formatDef) + if (fmtType === ruleType) cxt.pass(validCondition()) + + function unknownFormat(): void { + if (opts.strictSchema === false) { + self.logger.warn(unknownMsg()) + return + } + throw new Error(unknownMsg()) + + function unknownMsg(): string { + return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"` + } + } + + function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] { + const code = + fmtDef instanceof RegExp + ? regexpCode(fmtDef) + : opts.code.formats + ? _`${opts.code.formats}${getProperty(schema)}` + : undefined + const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code}) + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`] + } + + return ["string", fmtDef, fmt] + } + + function validCondition(): Code { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) throw new Error("async format in sync schema") + return _`await ${fmtRef}(${data})` + } + return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})` + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/format/index.ts b/node_modules/ajv/lib/vocabularies/format/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..bca2f5b3d817051e07bd768888ed7142e63c4c97 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/format/index.ts @@ -0,0 +1,6 @@ +import type {Vocabulary} from "../../types" +import formatKeyword from "./format" + +const format: Vocabulary = [formatKeyword] + +export default format diff --git a/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts b/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts new file mode 100644 index 0000000000000000000000000000000000000000..f487c97f84332592ca90b09d5c046a87afd57f9b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts @@ -0,0 +1,89 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not, getProperty, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" + +export type JTDDiscriminatorError = + | _JTDTypeError<"discriminator", "object", string> + | DiscrErrorObj + | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? params.discrError === DiscrError.Tag + ? `tag "${schema}" must be string` + : `value of tag "${schema}" must be in mapping` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + schemaType: "string", + implements: ["mapping"], + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, parentSchema} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + + gen.if(cond) + validateDiscriminator() + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + cxt.ok(valid) + + function validateDiscriminator(): void { + const tag = gen.const("tag", _`${data}${getProperty(schema)}`) + gen.if(_`${tag} === undefined`) + cxt.error(false, {discrError: DiscrError.Tag, tag}) + gen.elseIf(_`typeof ${tag} == "string"`) + validateMapping(tag) + gen.else() + cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema}) + gen.endIf() + } + + function validateMapping(tag: Name): void { + gen.if(false) + for (const tagValue in parentSchema.mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(tagValue)) + } + gen.else() + cxt.error( + false, + {discrError: DiscrError.Mapping, tag}, + {instancePath: schema, schemaPath: "mapping", parentSchema: true} + ) + gen.endIf() + } + + function applyTagSchema(schemaProp: string): Name { + const _valid = gen.name("valid") + cxt.subschema( + { + keyword: "mapping", + schemaProp, + jtdDiscriminator: schema, + }, + _valid + ) + return _valid + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/elements.ts b/node_modules/ajv/lib/vocabularies/jtd/elements.ts new file mode 100644 index 0000000000000000000000000000000000000000..983af7c0276ed83cf92e5071a2a8a63ef2d522e4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/elements.ts @@ -0,0 +1,32 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {_, not} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "elements", + schemaType: "object", + error: typeError("array"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const [valid] = checkNullable(cxt) + gen.if(not(valid), () => + gen.if( + _`Array.isArray(${data})`, + () => gen.assign(valid, validateArray(cxt)), + () => cxt.error() + ) + ) + cxt.ok(valid) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/enum.ts b/node_modules/ajv/lib/vocabularies/jtd/enum.ts new file mode 100644 index 0000000000000000000000000000000000000000..75464ff8e13f581679d2b33662f34ac79a23e912 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/enum.ts @@ -0,0 +1,45 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, and, Code} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" + +export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, schemaValue, parentSchema, it} = cxt + if (schema.length === 0) throw new Error("enum must have non-empty array") + if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique") + let valid: Code + const isString = _`typeof ${data} == "string"` + if (schema.length >= it.opts.loopEnum) { + let cond: Code + ;[valid, cond] = checkNullable(cxt, isString) + gen.if(cond, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + valid = and(isString, or(...schema.map((value: string) => _`${data} === ${value}`))) + if (parentSchema.nullable) valid = or(_`${data} === null`, valid) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.forOf("v", schemaValue as Code, (v) => + gen.if(_`${valid} = ${data} === ${v}`, () => gen.break()) + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/error.ts b/node_modules/ajv/lib/vocabularies/jtd/error.ts new file mode 100644 index 0000000000000000000000000000000000000000..5069322588ebc486795ec075e49777888bbd8cdf --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/error.ts @@ -0,0 +1,23 @@ +import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" +import {_, Code} from "../../compile/codegen" + +export type _JTDTypeError = ErrorObject< + K, + {type: T; nullable: boolean}, + S +> + +export function typeError(t: string): KeywordErrorDefinition { + return { + message: (cxt) => typeErrorMessage(cxt, t), + params: (cxt) => typeErrorParams(cxt, t), + } +} + +export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { + return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` +} + +export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { + return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` +} diff --git a/node_modules/ajv/lib/vocabularies/jtd/index.ts b/node_modules/ajv/lib/vocabularies/jtd/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7baebc30788d80498e59328809b6b6a312d3315 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/index.ts @@ -0,0 +1,37 @@ +import type {Vocabulary} from "../../types" +import refKeyword from "./ref" +import typeKeyword, {JTDTypeError} from "./type" +import enumKeyword, {JTDEnumError} from "./enum" +import elements, {JTDElementsError} from "./elements" +import properties, {JTDPropertiesError} from "./properties" +import optionalProperties from "./optionalProperties" +import discriminator, {JTDDiscriminatorError} from "./discriminator" +import values, {JTDValuesError} from "./values" +import union from "./union" +import metadata from "./metadata" + +const jtdVocabulary: Vocabulary = [ + "definitions", + refKeyword, + typeKeyword, + enumKeyword, + elements, + properties, + optionalProperties, + discriminator, + values, + union, + metadata, + {keyword: "additionalProperties", schemaType: "boolean"}, + {keyword: "nullable", schemaType: "boolean"}, +] + +export default jtdVocabulary + +export type JTDErrorObject = + | JTDTypeError + | JTDEnumError + | JTDElementsError + | JTDPropertiesError + | JTDDiscriminatorError + | JTDValuesError diff --git a/node_modules/ajv/lib/vocabularies/jtd/metadata.ts b/node_modules/ajv/lib/vocabularies/jtd/metadata.ts new file mode 100644 index 0000000000000000000000000000000000000000..19eeb8c7d5b8f6ed1ab794cc0368f67d4be8bb8a --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/metadata.ts @@ -0,0 +1,24 @@ +import {KeywordCxt} from "../../ajv" +import type {CodeKeywordDefinition} from "../../types" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "metadata", + schemaType: "object", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid) + cxt.ok(valid) + }, +} + +export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void { + if (it.jtdMetadata !== metadata) { + throw new Error(`JTD: "${keyword}" cannot be used in this schema location`) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/nullable.ts b/node_modules/ajv/lib/vocabularies/jtd/nullable.ts new file mode 100644 index 0000000000000000000000000000000000000000..c74b05da72dbd4694ac215d5e5616e9050db283c --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/nullable.ts @@ -0,0 +1,21 @@ +import type {KeywordCxt} from "../../compile/validate" +import {_, not, nil, Code, Name} from "../../compile/codegen" + +export function checkNullable( + {gen, data, parentSchema}: KeywordCxt, + cond: Code = nil +): [Name, Code] { + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.let(valid, _`${data} === null`) + cond = not(valid) + } else { + gen.let(valid, false) + } + return [valid, cond] +} + +export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { + const [valid, cond_] = checkNullable(cxt, cond) + return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] +} diff --git a/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts b/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e91c8d91874407585b29641f22457822079fd66 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts @@ -0,0 +1,15 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {validateProperties, error} from "./properties" + +const def: CodeKeywordDefinition = { + keyword: "optionalProperties", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + if (cxt.parentSchema.properties) return + validateProperties(cxt) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/properties.ts b/node_modules/ajv/lib/vocabularies/jtd/properties.ts new file mode 100644 index 0000000000000000000000000000000000000000..9dd24c5cd62d46a913d644636fc9eacbb7f8a4fe --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/properties.ts @@ -0,0 +1,184 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties, isOwnProperty} from "../code" +import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" +import {_, and, not, Code, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +enum PropError { + Additional = "additional", + Missing = "missing", +} + +type PropKeyword = "properties" | "optionalProperties" + +type PropSchema = {[P in string]?: SchemaObject} + +export type JTDPropertiesError = + | _JTDTypeError + | ErrorObject + | ErrorObject + +export const error: KeywordErrorDefinition = { + message: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? "must NOT have additional properties" + : `must have property '${params.missingProperty}'` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` + : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "properties", + schemaType: "object", + error, + code: validateProperties, +} + +// const error: KeywordErrorDefinition = { +// message: "should NOT have additional properties", +// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +// } + +export function validateProperties(cxt: KeywordCxt): void { + checkMetadata(cxt) + const {gen, data, parentSchema, it} = cxt + const {additionalProperties, nullable} = parentSchema + if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping") + if (commonProperties()) { + throw new Error("JTD: properties and optionalProperties have common members") + } + const [allProps, properties] = schemaProperties("properties") + const [allOptProps, optProperties] = schemaProperties("optionalProperties") + if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { + return + } + + const [valid, cond] = + it.jtdDiscriminator === undefined + ? checkNullableObject(cxt, data) + : [gen.let("valid", false), true] + gen.if(cond, () => + gen.assign(valid, true).block(() => { + validateProps(properties, "properties", true) + validateProps(optProperties, "optionalProperties") + if (!additionalProperties) validateAdditional() + }) + ) + cxt.pass(valid) + + function commonProperties(): boolean { + const props = parentSchema.properties as Record | undefined + const optProps = parentSchema.optionalProperties as Record | undefined + if (!(props && optProps)) return false + for (const p in props) { + if (Object.prototype.hasOwnProperty.call(optProps, p)) return true + } + return false + } + + function schemaProperties(keyword: string): [string[], string[]] { + const schema = parentSchema[keyword] + const allPs = schema ? allSchemaProperties(schema) : [] + if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { + throw new Error(`JTD: discriminator tag used in ${keyword}`) + } + const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p])) + return [allPs, ps] + } + + function validateProps(props: string[], keyword: string, required?: boolean): void { + const _valid = gen.var("valid") + for (const prop of props) { + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => applyPropertySchema(prop, keyword, _valid), + () => missingProperty(prop) + ) + cxt.ok(_valid) + } + + function missingProperty(prop: string): void { + if (required) { + gen.assign(_valid, false) + cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop}) + } else { + gen.assign(_valid, true) + } + } + } + + function applyPropertySchema(prop: string, keyword: string, _valid: Name): void { + cxt.subschema( + { + keyword, + schemaProp: prop, + dataProp: prop, + }, + _valid + ) + } + + function validateAdditional(): void { + gen.forIn("key", data, (key: Name) => { + const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator) + const addOptProp = isAdditional(key, allOptProps, "optionalProperties") + const extra = + addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp) + gen.if(extra, () => { + if (it.opts.removeAdditional) { + gen.code(_`delete ${data}[${key}]`) + } else { + cxt.error( + false, + {propError: PropError.Additional, additionalProperty: key}, + {instancePath: key, parentSchema: true} + ) + if (!it.opts.allErrors) gen.break() + } + }) + }) + } + + function isAdditional( + key: Name, + props: string[], + keyword: string, + jtdDiscriminator?: string + ): Code | true { + let additional: Code | boolean + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword) + additional = not(isOwnProperty(gen, propsSchema as Code, key)) + if (jtdDiscriminator !== undefined) { + additional = and(additional, _`${key} !== ${jtdDiscriminator}`) + } + } else if (props.length || jtdDiscriminator !== undefined) { + const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props) + additional = and(...ps.map((p) => _`${key} !== ${p}`)) + } else { + additional = true + } + return additional + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/ref.ts b/node_modules/ajv/lib/vocabularies/jtd/ref.ts new file mode 100644 index 0000000000000000000000000000000000000000..97646ee1b68885bf004ce2e629421abac07a991d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/ref.ts @@ -0,0 +1,76 @@ +import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {compileSchema, SchemaEnv} from "../../compile" +import {_, not, nil, stringify} from "../../compile/codegen" +import MissingRefError from "../../compile/ref_error" +import N from "../../compile/names" +import {getValidate, callRef} from "../core/ref" +import {checkMetadata} from "./metadata" + +const def: CodeKeywordDefinition = { + keyword: "ref", + schemaType: "string", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema: ref, parentSchema, it} = cxt + const { + schemaEnv: {root}, + } = it + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.var(valid, _`${data} === null`) + gen.if(not(valid), validateJtdRef) + } else { + gen.var(valid, false) + validateJtdRef() + } + cxt.ok(valid) + + function validateJtdRef(): void { + const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] + if (!refSchema) { + throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`) + } + if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) + else inlineRefSchema(refSchema) + } + + function callValidate(schema: AnySchemaObject): void { + const sch = compileSchema.call( + it.self, + new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`}) + ) + const v = getValidate(cxt, sch) + const errsCount = gen.const("_errs", N.errors) + callRef(cxt, v, sch, sch.$async) + gen.assign(valid, _`${errsCount} === ${N.errors}`) + } + + function inlineRefSchema(schema: AnySchemaObject): void { + const schName = gen.scopeValue( + "schema", + it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} + ) + cxt.subschema( + { + schema, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: `/definitions/${ref}`, + }, + valid + ) + } + }, +} + +export function hasRef(schema: AnySchemaObject): boolean { + for (const key in schema) { + let sch: AnySchemaObject + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true + } + return false +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/type.ts b/node_modules/ajv/lib/vocabularies/jtd/type.ts new file mode 100644 index 0000000000000000000000000000000000000000..17274300b70b11b72977a965a4410f21a8f0f19c --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/type.ts @@ -0,0 +1,75 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, nil, or, Code} from "../../compile/codegen" +import validTimestamp from "../../runtime/timestamp" +import {useFunc} from "../../compile/util" +import {checkMetadata} from "./metadata" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType> + +export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +export const intRange: {[T in IntType]: [number, number, number]} = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], +} + +export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType + +const error: KeywordErrorDefinition = { + message: (cxt) => typeErrorMessage(cxt, cxt.schema), + params: (cxt) => typeErrorParams(cxt, cxt.schema), +} + +function timestampCode(cxt: KeywordCxt): Code { + const {gen, data, it} = cxt + const {timestamp, allowDate} = it.opts + if (timestamp === "date") return _`${data} instanceof Date ` + const vts = useFunc(gen, validTimestamp) + const allowDateArg = allowDate ? _`, true` : nil + const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})` + return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString) +} + +const def: CodeKeywordDefinition = { + keyword: "type", + schemaType: "string", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {data, schema, parentSchema, it} = cxt + let cond: Code + switch (schema) { + case "boolean": + case "string": + cond = _`typeof ${data} == ${schema}` + break + case "timestamp": { + cond = timestampCode(cxt) + break + } + case "float32": + case "float64": + cond = _`typeof ${data} == "number"` + break + default: { + const sch = schema as IntType + cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)` + if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { + if (sch === "uint32") cond = _`${cond} && ${data} >= 0` + } else { + const [min, max] = intRange[sch] + cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}` + } + } + } + cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/union.ts b/node_modules/ajv/lib/vocabularies/jtd/union.ts new file mode 100644 index 0000000000000000000000000000000000000000..588f07ab4a96bb88512579ce0cc683eaa5925eb2 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/union.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateUnion} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "union", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in union"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/values.ts b/node_modules/ajv/lib/vocabularies/jtd/values.ts new file mode 100644 index 0000000000000000000000000000000000000000..e64945077647a81d99a6460ae6e86b5394c250c4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/values.ts @@ -0,0 +1,58 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema, Type} from "../../compile/util" +import {not, or, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "values", + schemaType: "object", + error: typeError("object"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + if (alwaysValidSchema(it, schema)) { + gen.if(not(or(cond, valid)), () => cxt.error()) + } else { + gen.if(cond) + gen.assign(valid, validateMap()) + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + } + cxt.ok(valid) + + function validateMap(): Name | boolean { + const _valid = gen.name("valid") + if (it.allErrors) { + const validMap = gen.let("valid", true) + validateValues(() => gen.assign(validMap, false)) + return validMap + } + gen.var(_valid, true) + validateValues(() => gen.break()) + return _valid + + function validateValues(notValid: () => void): void { + gen.forIn("key", data, (key) => { + cxt.subschema( + { + keyword: "values", + dataProp: key, + dataPropType: Type.Str, + }, + _valid + ) + gen.if(not(_valid), notValid) + }) + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/metadata.ts b/node_modules/ajv/lib/vocabularies/metadata.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9d5af85fe921f9cd553e61da6a09234213f0e5b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/metadata.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" + +export const metadataVocabulary: Vocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +] + +export const contentVocabulary: Vocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +] diff --git a/node_modules/ajv/lib/vocabularies/next.ts b/node_modules/ajv/lib/vocabularies/next.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e987ad21241259ff0453a45534d0822fa3b7e58 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/next.ts @@ -0,0 +1,8 @@ +import type {Vocabulary} from "../types" +import dependentRequired from "./validation/dependentRequired" +import dependentSchemas from "./applicator/dependentSchemas" +import limitContains from "./validation/limitContains" + +const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains] + +export default next diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/index.ts b/node_modules/ajv/lib/vocabularies/unevaluated/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7f0815dbb00cfccd96f8910bea06182f9e19993 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/index.ts @@ -0,0 +1,7 @@ +import type {Vocabulary} from "../../types" +import unevaluatedProperties from "./unevaluatedProperties" +import unevaluatedItems from "./unevaluatedItems" + +const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems] + +export default unevaluated diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts new file mode 100644 index 0000000000000000000000000000000000000000..50bf0e7c17873ad2f435a92105745d4aa8ed9d26 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts @@ -0,0 +1,47 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" + +export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + const items = it.items || 0 + if (items === true) return + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items}) + cxt.fail(_`${len} > ${items}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items}`) + gen.if(not(valid), () => validateItems(valid, items)) + cxt.ok(valid) + } + it.items = true + + function validateItems(valid: Name, from: Name | number): void { + gen.forRange("i", from, len, (i) => { + cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e6868fa326dab80317a39e135a4b4deb1d0f2f4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts @@ -0,0 +1,85 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import {_, not, and, Name, Code} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" +import N from "../../compile/names" + +export type UnevaluatedPropertiesError = ErrorObject< + "unevaluatedProperties", + {unevaluatedProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have unevaluated properties", + params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const {gen, schema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, props} = it + if (props instanceof Name) { + gen.if(_`${props} !== true`, () => + gen.forIn("key", data, (key: Name) => + gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)) + ) + ) + } else if (props !== true) { + gen.forIn("key", data, (key: Name) => + props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)) + ) + } + it.props = true + cxt.ok(_`${errsCount} === ${N.errors}`) + + function unevaluatedPropCode(key: Name): void { + if (schema === false) { + cxt.setParams({unevaluatedProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (!alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + + function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code { + return _`!${evaluatedProps} || !${evaluatedProps}[${key}]` + } + + function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code { + const ps: Code[] = [] + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`) + } + return and(...ps) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/const.ts b/node_modules/ajv/lib/vocabularies/validation/const.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3b94a5dcd3d0ad993a83088694b9375089f735d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/const.ts @@ -0,0 +1,28 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type ConstError = ErrorObject<"const", {allowedValue: any}> + +const error: KeywordErrorDefinition = { + message: "must be equal to constant", + params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "const", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schemaCode, schema} = cxt + if ($data || (schema && typeof schema == "object")) { + cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`) + } else { + cxt.fail(_`${schema} !== ${data}`) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts b/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c616cfa9ac79fabdd5e4d2ff19840adec61f813 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts @@ -0,0 +1,23 @@ +import type {CodeKeywordDefinition, ErrorObject} from "../../types" +import { + validatePropertyDeps, + error, + DependenciesErrorParams, + PropertyDependencies, +} from "../applicator/dependencies" + +export type DependentRequiredError = ErrorObject< + "dependentRequired", + DependenciesErrorParams, + PropertyDependencies +> + +const def: CodeKeywordDefinition = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error, + code: (cxt) => validatePropertyDeps(cxt), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/enum.ts b/node_modules/ajv/lib/vocabularies/validation/enum.ts new file mode 100644 index 0000000000000000000000000000000000000000..76377fb02e6a9e8843ba08b2e858a19a067b787b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/enum.ts @@ -0,0 +1,54 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, Name, Code} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, schemaCode, it} = cxt + if (!$data && schema.length === 0) throw new Error("enum must have non-empty array") + const useLoop = schema.length >= it.opts.loopEnum + let eql: Name | undefined + const getEql = (): Name => (eql ??= useFunc(gen, equal)) + + let valid: Code + if (useLoop || $data) { + valid = gen.let("valid") + cxt.block$data(valid, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const vSchema = gen.const("vSchema", schemaCode) + valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i))) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.assign(valid, false) + gen.forOf("v", schemaCode as Code, (v) => + gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()) + ) + } + + function equalCode(vSchema: Name, i: number): Code { + const sch = schema[i] + return typeof sch === "object" && sch !== null + ? _`${getEql()}(${data}, ${vSchema}[${i}])` + : _`${data} === ${sch}` + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/index.ts b/node_modules/ajv/lib/vocabularies/validation/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3531b19628b7dfb2526a81cd38d6c93ee1a54dbe --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/index.ts @@ -0,0 +1,49 @@ +import type {ErrorObject, Vocabulary} from "../../types" +import limitNumber, {LimitNumberError} from "./limitNumber" +import multipleOf, {MultipleOfError} from "./multipleOf" +import limitLength from "./limitLength" +import pattern, {PatternError} from "./pattern" +import limitProperties from "./limitProperties" +import required, {RequiredError} from "./required" +import limitItems from "./limitItems" +import uniqueItems, {UniqueItemsError} from "./uniqueItems" +import constKeyword, {ConstError} from "./const" +import enumKeyword, {EnumError} from "./enum" + +const validation: Vocabulary = [ + // number + limitNumber, + multipleOf, + // string + limitLength, + pattern, + // object + limitProperties, + required, + // array + limitItems, + uniqueItems, + // any + {keyword: "type", schemaType: ["string", "array"]}, + {keyword: "nullable", schemaType: "boolean"}, + constKeyword, + enumKeyword, +] + +export default validation + +type LimitError = ErrorObject< + "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", + {limit: number}, + number | {$data: string} +> + +export type ValidationKeywordError = + | LimitError + | LimitNumberError + | MultipleOfError + | PatternError + | RequiredError + | UniqueItemsError + | ConstError + | EnumError diff --git a/node_modules/ajv/lib/vocabularies/validation/limitContains.ts b/node_modules/ajv/lib/vocabularies/validation/limitContains.ts new file mode 100644 index 0000000000000000000000000000000000000000..8bb43c1a4a66f1d8781181cbd07f06edb76aea02 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitContains.ts @@ -0,0 +1,16 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.contains === undefined) { + checkStrictMode(it, `"${keyword}" without "contains" is ignored`) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitItems.ts b/node_modules/ajv/lib/vocabularies/validation/limitItems.ts new file mode 100644 index 0000000000000000000000000000000000000000..566de8588b3be2fcccdeff56f26338be0dc6fcb4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitItems.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxItems" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} items` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxItems" ? operators.GT : operators.LT + cxt.fail$data(_`${data}.length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitLength.ts b/node_modules/ajv/lib/vocabularies/validation/limitLength.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4f947259549ad3d0e9fe992e5a92a83696e1177 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitLength.ts @@ -0,0 +1,30 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import ucs2length from "../../runtime/ucs2length" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxLength" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} characters` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode, it} = cxt + const op = keyword === "maxLength" ? operators.GT : operators.LT + const len = + it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})` + cxt.fail$data(_`${len} ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts b/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts new file mode 100644 index 0000000000000000000000000000000000000000..5499202efbfec965a9acd8c71e145e79110923d9 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts @@ -0,0 +1,42 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators, Code} from "../../compile/codegen" + +const ops = operators + +type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum" + +type Comparison = "<=" | ">=" | "<" | ">" + +const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = { + maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT}, + minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT}, + exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE}, + exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE}, +} + +export type LimitNumberError = ErrorObject< + Kwd, + {limit: number; comparison: Comparison}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`, + params: ({keyword, schemaCode}) => + _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts b/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts new file mode 100644 index 0000000000000000000000000000000000000000..07fffa8b39a03798262a94da5c55ac6e3e7ce200 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxProperties" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} properties` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxProperties" ? operators.GT : operators.LT + cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts b/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fd79abbd91c41d872ec775441f48b69550e8655 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts @@ -0,0 +1,34 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" + +export type MultipleOfError = ErrorObject< + "multipleOf", + {multipleOf: number}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must be multiple of ${schemaCode}`, + params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, schemaCode, it} = cxt + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision + const res = gen.let("res") + const invalid = prec + ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : _`${res} !== parseInt(${res})` + cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/pattern.ts b/node_modules/ajv/lib/vocabularies/validation/pattern.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb0203b88794d72d91717f1091009766ea0bc548 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/pattern.ts @@ -0,0 +1,39 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {usePattern} from "../code" +import {useFunc} from "../../compile/util" +import {_, str} from "../../compile/codegen" + +export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match pattern "${schemaCode}"`, + params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, schemaCode, it} = cxt + const u = it.opts.unicodeRegExp ? "u" : "" + if ($data) { + const {regExp} = it.opts.code + const regExpCode = regExp.code === "new RegExp" ? _`new RegExp` : useFunc(gen, regExp) + const valid = gen.let("valid") + gen.try( + () => gen.assign(valid, _`${regExpCode}(${schemaCode}, ${u}).test(${data})`), + () => gen.assign(valid, false) + ) + cxt.fail$data(_`!${valid}`) + } else { + const regExp = usePattern(cxt, schema) + cxt.fail$data(_`!${regExp}.test(${data})`) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/required.ts b/node_modules/ajv/lib/vocabularies/validation/required.ts new file mode 100644 index 0000000000000000000000000000000000000000..fea7367ed7b8f0cfeee2a73a1cecaca7f8c0c115 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/required.ts @@ -0,0 +1,98 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import { + checkReportMissingProp, + checkMissingProp, + reportMissingProp, + propertyInData, + noPropertyInData, +} from "../code" +import {_, str, nil, not, Name, Code} from "../../compile/codegen" +import {checkStrictMode} from "../../compile/util" + +export type RequiredError = ErrorObject< + "required", + {missingProperty: string}, + string[] | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`, + params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, schemaCode, data, $data, it} = cxt + const {opts} = it + if (!$data && schema.length === 0) return + const useLoop = schema.length >= opts.loopRequired + if (it.allErrors) allErrorsMode() + else exitOnErrorMode() + + if (opts.strictRequired) { + const props = cxt.parentSchema.properties + const {definedProperties} = cxt.it + for (const requiredKey of schema) { + if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)` + checkStrictMode(it, msg, it.opts.strictRequired) + } + } + } + + function allErrorsMode(): void { + if (useLoop || $data) { + cxt.block$data(nil, loopAllRequired) + } else { + for (const prop of schema) { + checkReportMissingProp(cxt, prop) + } + } + } + + function exitOnErrorMode(): void { + const missing = gen.let("missing") + if (useLoop || $data) { + const valid = gen.let("valid", true) + cxt.block$data(valid, () => loopUntilMissing(missing, valid)) + cxt.ok(valid) + } else { + gen.if(checkMissingProp(cxt, schema, missing)) + reportMissingProp(cxt, missing) + gen.else() + } + } + + function loopAllRequired(): void { + gen.forOf("prop", schemaCode as Code, (prop) => { + cxt.setParams({missingProperty: prop}) + gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()) + }) + } + + function loopUntilMissing(missing: Name, valid: Name): void { + cxt.setParams({missingProperty: missing}) + gen.forOf( + missing, + schemaCode as Code, + () => { + gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties)) + gen.if(not(valid), () => { + cxt.error() + gen.break() + }) + }, + nil + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts b/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts new file mode 100644 index 0000000000000000000000000000000000000000..765c4d04fc2472b774838d06fe13c15a98b58a9b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts @@ -0,0 +1,79 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" +import {_, str, Name} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type UniqueItemsError = ErrorObject< + "uniqueItems", + {i: number; j: number}, + boolean | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {i, j}}) => + str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt + if (!$data && !schema) return + const valid = gen.let("valid") + const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : [] + cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`) + cxt.ok(valid) + + function validateUniqueItems(): void { + const i = gen.let("i", _`${data}.length`) + const j = gen.let("j") + cxt.setParams({i, j}) + gen.assign(valid, true) + gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)) + } + + function canOptimize(): boolean { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array") + } + + function loopN(i: Name, j: Name): void { + const item = gen.name("item") + const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong) + const indices = gen.const("indices", _`{}`) + gen.for(_`;${i}--;`, () => { + gen.let(item, _`${data}[${i}]`) + gen.if(wrongType, _`continue`) + if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`) + gen + .if(_`typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, _`${indices}[${item}]`) + cxt.error() + gen.assign(valid, false).break() + }) + .code(_`${indices}[${item}] = ${i}`) + }) + } + + function loopN2(i: Name, j: Name): void { + const eql = useFunc(gen, equal) + const outer = gen.name("outer") + gen.label(outer).for(_`;${i}--;`, () => + gen.for(_`${j} = ${i}; ${j}--;`, () => + gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error() + gen.assign(valid, false).break(outer) + }) + ) + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/package.json b/node_modules/ajv/package.json new file mode 100644 index 0000000000000000000000000000000000000000..50fa6a639c704492f0a6c0c28a3c86d20321a395 --- /dev/null +++ b/node_modules/ajv/package.json @@ -0,0 +1,126 @@ +{ + "name": "ajv", + "version": "8.20.0", + "description": "Another JSON Schema Validator", + "main": "dist/ajv.js", + "types": "dist/ajv.d.ts", + "files": [ + "lib/", + "dist/", + ".runkit_example.js" + ], + "sideEffects": false, + "scripts": { + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", + "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", + "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-cov": "nyc npm run test-spec", + "rollup": "rm -rf bundle && rollup -c", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "test-karma": "karma start", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-all": "npm run test-cov", + "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", + "test-ci": "AJV_FULL_TEST=true npm test", + "prepublish": "npm run build", + "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", + "docs:dev": "./scripts/prepare-site && vuepress dev docs", + "docs:build": "./scripts/prepare-site && vuepress build docs" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": "ajv-validator/ajv", + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", + "bugs": "https://github.com/ajv-validator/ajv/issues", + "homepage": "https://ajv.js.org", + "runkitExampleFilename": ".runkit_example.js", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "devDependencies": { + "@ajv-validator/config": "^0.5.0", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/chai": "^4.3.11", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.30", + "@types/require-from-string": "^1.2.3", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "ajv-formats": "^3.0.1", + "browserify": "^17.0.0", + "chai": "^4.4.1", + "cross-env": "^7.0.3", + "dayjs": "^1.11.10", + "dayjs-plugin-utc": "^0.1.2", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "glob": "^10.3.10", + "husky": "^9.0.11", + "jimp": "^0.22.10", + "js-beautify": "^1.15.1", + "json-schema-test": "^2.0.0", + "karma": "^6.4.2", + "karma-chrome-launcher": "^3.2.0", + "karma-mocha": "^2.0.1", + "lint-staged": "^15.2.2", + "mocha": "^10.3.0", + "module-from-string": "^3.3.0", + "node-fetch": "^3.3.2", + "nyc": "^15.1.0", + "prettier": "3.0.3", + "re2": "^1.20.9", + "rollup": "^2.79.1", + "rollup-plugin-terser": "^7.0.2", + "ts-node": "^10.9.2", + "tsify": "^5.0.4", + "typescript": "5.3.3", + "uri-js": "^4.4.1" + }, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + }, + "prettier": "@ajv-validator/config/prettierrc.json", + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm test" + } + }, + "lint-staged": { + "*.{json,yaml,js,ts}": "prettier --write" + } +} diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2dbf6af2b6f3b5701c83caaea7ed2210192023a8 --- /dev/null +++ b/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 0000000000000000000000000000000000000000..616ff837d3ff01e028c208062fc699c7f1c8d418 --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89 --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 0000000000000000000000000000000000000000..017f53116a9e2805ccb12efc3c7fcd7e4384735d --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4d848bc36f6b862e5db3effa59ebed515730284e --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ansi-styles/index.d.ts b/node_modules/ansi-styles/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44a907e580f1055a36d44111fda9463ed1cd2d26 --- /dev/null +++ b/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,345 @@ +declare type CSSColor = + | 'aliceblue' + | 'antiquewhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedalmond' + | 'blue' + | 'blueviolet' + | 'brown' + | 'burlywood' + | 'cadetblue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerblue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkblue' + | 'darkcyan' + | 'darkgoldenrod' + | 'darkgray' + | 'darkgreen' + | 'darkgrey' + | 'darkkhaki' + | 'darkmagenta' + | 'darkolivegreen' + | 'darkorange' + | 'darkorchid' + | 'darkred' + | 'darksalmon' + | 'darkseagreen' + | 'darkslateblue' + | 'darkslategray' + | 'darkslategrey' + | 'darkturquoise' + | 'darkviolet' + | 'deeppink' + | 'deepskyblue' + | 'dimgray' + | 'dimgrey' + | 'dodgerblue' + | 'firebrick' + | 'floralwhite' + | 'forestgreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostwhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'green' + | 'greenyellow' + | 'grey' + | 'honeydew' + | 'hotpink' + | 'indianred' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderblush' + | 'lawngreen' + | 'lemonchiffon' + | 'lightblue' + | 'lightcoral' + | 'lightcyan' + | 'lightgoldenrodyellow' + | 'lightgray' + | 'lightgreen' + | 'lightgrey' + | 'lightpink' + | 'lightsalmon' + | 'lightseagreen' + | 'lightskyblue' + | 'lightslategray' + | 'lightslategrey' + | 'lightsteelblue' + | 'lightyellow' + | 'lime' + | 'limegreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'mediumaquamarine' + | 'mediumblue' + | 'mediumorchid' + | 'mediumpurple' + | 'mediumseagreen' + | 'mediumslateblue' + | 'mediumspringgreen' + | 'mediumturquoise' + | 'mediumvioletred' + | 'midnightblue' + | 'mintcream' + | 'mistyrose' + | 'moccasin' + | 'navajowhite' + | 'navy' + | 'oldlace' + | 'olive' + | 'olivedrab' + | 'orange' + | 'orangered' + | 'orchid' + | 'palegoldenrod' + | 'palegreen' + | 'paleturquoise' + | 'palevioletred' + | 'papayawhip' + | 'peachpuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderblue' + | 'purple' + | 'rebeccapurple' + | 'red' + | 'rosybrown' + | 'royalblue' + | 'saddlebrown' + | 'salmon' + | 'sandybrown' + | 'seagreen' + | 'seashell' + | 'sienna' + | 'silver' + | 'skyblue' + | 'slateblue' + | 'slategray' + | 'slategrey' + | 'snow' + | 'springgreen' + | 'steelblue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whitesmoke' + | 'yellow' + | 'yellowgreen'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: CSSColor): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5d82581a13f9900f9dc653b2df9f0027ee8bdda1 --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 0000000000000000000000000000000000000000..75393284d7e474de2c7fb1ee7d09169a6790c7da --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..24883de808be6a7480542114a86034312c026dec --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,152 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/any-promise/.jshintrc b/node_modules/any-promise/.jshintrc new file mode 100644 index 0000000000000000000000000000000000000000..979105e9116a60f71f5416bfe5fe432dcbdfde91 --- /dev/null +++ b/node_modules/any-promise/.jshintrc @@ -0,0 +1,4 @@ +{ + "node":true, + "strict":true +} diff --git a/node_modules/any-promise/.npmignore b/node_modules/any-promise/.npmignore new file mode 100644 index 0000000000000000000000000000000000000000..1354abc0270ba8c759e4df7c401ce10cb014d58b --- /dev/null +++ b/node_modules/any-promise/.npmignore @@ -0,0 +1,7 @@ +.git* +test/ +test-browser/ +build/ +.travis.yml +*.swp +Makefile diff --git a/node_modules/any-promise/LICENSE b/node_modules/any-promise/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9187fe5d7293980d23902787dd6438a56e99dc0b --- /dev/null +++ b/node_modules/any-promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2014-2016 Kevin Beaty + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/any-promise/README.md b/node_modules/any-promise/README.md new file mode 100644 index 0000000000000000000000000000000000000000..174bea4aeb0bd0a7b7af83a9991195bb9b887c97 --- /dev/null +++ b/node_modules/any-promise/README.md @@ -0,0 +1,161 @@ +## Any Promise + +[![Build Status](https://secure.travis-ci.org/kevinbeaty/any-promise.svg)](http://travis-ci.org/kevinbeaty/any-promise) + +Let your library support any ES 2015 (ES6) compatible `Promise` and leave the choice to application authors. The application can *optionally* register its preferred `Promise` implementation and it will be exported when requiring `any-promise` from library code. + +If no preference is registered, defaults to the global `Promise` for newer Node.js versions. The browser version defaults to the window `Promise`, so polyfill or register as necessary. + +### Usage with global Promise: + +Assuming the global `Promise` is the desired implementation: + +```bash +# Install any libraries depending on any-promise +$ npm install mz +``` + +The installed libraries will use global Promise by default. + +```js +// in library +var Promise = require('any-promise') // the global Promise + +function promiseReturningFunction(){ + return new Promise(function(resolve, reject){...}) +} +``` + +### Usage with registration: + +Assuming `bluebird` is the desired Promise implementation: + +```bash +# Install preferred promise library +$ npm install bluebird +# Install any-promise to allow registration +$ npm install any-promise +# Install any libraries you would like to use depending on any-promise +$ npm install mz +``` + +Register your preference in the application entry point before any other `require` of packages that load `any-promise`: + +```javascript +// top of application index.js or other entry point +require('any-promise/register/bluebird') + +// -or- Equivalent to above, but allows customization of Promise library +require('any-promise/register')('bluebird', {Promise: require('bluebird')}) +``` + +Now that the implementation is registered, you can use any package depending on `any-promise`: + + +```javascript +var fsp = require('mz/fs') // mz/fs will use registered bluebird promises +var Promise = require('any-promise') // the registered bluebird promise +``` + +It is safe to call `register` multiple times, but it must always be with the same implementation. + +Again, registration is *optional*. It should only be called by the application user if overriding the global `Promise` implementation is desired. + +### Optional Application Registration + +As an application author, you can *optionally* register a preferred `Promise` implementation on application startup (before any call to `require('any-promise')`: + +You must register your preference before any call to `require('any-promise')` (by you or required packages), and only one implementation can be registered. Typically, this registration would occur at the top of the application entry point. + + +#### Registration shortcuts + +If you are using a known `Promise` implementation, you can register your preference with a shortcut: + + +```js +require('any-promise/register/bluebird') +// -or- +import 'any-promise/register/q'; +``` + +Shortcut registration is the preferred registration method as it works in the browser and Node.js. It is also convenient for using with `import` and many test runners, that offer a `--require` flag: + +``` +$ ava --require=any-promise/register/bluebird test.js +``` + +Current known implementations include `bluebird`, `q`, `when`, `rsvp`, `es6-promise`, `promise`, `native-promise-only`, `pinkie`, `vow` and `lie`. If you are not using a known implementation, you can use another registration method described below. + + +#### Basic Registration + +As an alternative to registration shortcuts, you can call the `register` function with the preferred `Promise` implementation. The benefit of this approach is that a `Promise` library can be required by name without being a known implementation. This approach does NOT work in the browser. To use `any-promise` in the browser use either registration shortcuts or specify the `Promise` constructor using advanced registration (see below). + +```javascript +require('any-promise/register')('when') +// -or- require('any-promise/register')('any other ES6 compatible library (known or otherwise)') +``` + +This registration method will try to detect the `Promise` constructor from requiring the specified implementation. If you would like to specify your own constructor, see advanced registration. + + +#### Advanced Registration + +To use the browser version, you should either install a polyfill or explicitly register the `Promise` constructor: + +```javascript +require('any-promise/register')('bluebird', {Promise: require('bluebird')}) +``` + +This could also be used for registering a custom `Promise` implementation or subclass. + +Your preference will be registered globally, allowing a single registration even if multiple versions of `any-promise` are installed in the NPM dependency tree or are using multiple bundled JavaScript files in the browser. You can bypass this global registration in options: + + +```javascript +require('../register')('es6-promise', {Promise: require('es6-promise').Promise, global: false}) +``` + +### Library Usage + +To use any `Promise` constructor, simply require it: + +```javascript +var Promise = require('any-promise'); + +return Promise + .all([xf, f, init, coll]) + .then(fn); + + +return new Promise(function(resolve, reject){ + try { + resolve(item); + } catch(e){ + reject(e); + } +}); + +``` + +Except noted below, libraries using `any-promise` should only use [documented](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) functions as there is no guarantee which implementation will be chosen by the application author. Libraries should never call `register`, only the application user should call if desired. + + +#### Advanced Library Usage + +If your library needs to branch code based on the registered implementation, you can retrieve it using `var impl = require('any-promise/implementation')`, where `impl` will be the package name (`"bluebird"`, `"when"`, etc.) if registered, `"global.Promise"` if using the global version on Node.js, or `"window.Promise"` if using the browser version. You should always include a default case, as there is no guarantee what package may be registered. + + +### Support for old Node.js versions + +Node.js versions prior to `v0.12` may have contained buggy versions of the global `Promise`. For this reason, the global `Promise` is not loaded automatically for these old versions. If using `any-promise` in Node.js versions versions `<= v0.12`, the user should register a desired implementation. + +If an implementation is not registered, `any-promise` will attempt to discover an installed `Promise` implementation. If no implementation can be found, an error will be thrown on `require('any-promise')`. While the auto-discovery usually avoids errors, it is non-deterministic. It is recommended that the user always register a preferred implementation for older Node.js versions. + +This auto-discovery is only available for Node.jS versions prior to `v0.12`. Any newer versions will always default to the global `Promise` implementation. + +### Related + +- [any-observable](https://github.com/sindresorhus/any-observable) - `any-promise` for Observables. + diff --git a/node_modules/any-promise/implementation.d.ts b/node_modules/any-promise/implementation.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c331a56a82482a6d294bc64af3a248748277227d --- /dev/null +++ b/node_modules/any-promise/implementation.d.ts @@ -0,0 +1,3 @@ +declare var implementation: string; + +export = implementation; diff --git a/node_modules/any-promise/implementation.js b/node_modules/any-promise/implementation.js new file mode 100644 index 0000000000000000000000000000000000000000..a45ae94dd5fb8bf2a501ffe11aee554527f9ec66 --- /dev/null +++ b/node_modules/any-promise/implementation.js @@ -0,0 +1 @@ +module.exports = require('./register')().implementation diff --git a/node_modules/any-promise/index.d.ts b/node_modules/any-promise/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f646c5dc4ed09c42210f0f1ce9a970e7dea2788 --- /dev/null +++ b/node_modules/any-promise/index.d.ts @@ -0,0 +1,73 @@ +declare class Promise implements Promise.Thenable { + /** + * If you call resolve in the body of the callback passed to the constructor, + * your promise is fulfilled with result object passed to resolve. + * If you call reject your promise is rejected with the object passed to resolve. + * For consistency and debugging (eg stack traces), obj should be an instanceof Error. + * Any errors thrown in the constructor callback will be implicitly passed to reject(). + */ + constructor (callback: (resolve : (value?: R | Promise.Thenable) => void, reject: (error?: any) => void) => void); + + /** + * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. + * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. + * Both callbacks have a single parameter , the fulfillment value or rejection reason. + * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. + * If an error is thrown in the callback, the returned promise rejects with that error. + * + * @param onFulfilled called when/if "promise" resolves + * @param onRejected called when/if "promise" rejects + */ + then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => U | Promise.Thenable): Promise; + then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => void): Promise; + + /** + * Sugar for promise.then(undefined, onRejected) + * + * @param onRejected called when/if "promise" rejects + */ + catch (onRejected?: (error: any) => U | Promise.Thenable): Promise; + + /** + * Make a new promise from the thenable. + * A thenable is promise-like in as far as it has a "then" method. + */ + static resolve (): Promise; + static resolve (value: R | Promise.Thenable): Promise; + + /** + * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error + */ + static reject (error: any): Promise; + + /** + * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. + * the array passed to all can be a mixture of promise-like objects and other objects. + * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. + */ + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable, T10 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable ]): Promise<[T1, T2, T3, T4]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable]): Promise<[T1, T2, T3]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable]): Promise<[T1, T2]>; + static all (values: [T1 | Promise.Thenable]): Promise<[T1]>; + static all (values: Array>): Promise; + + /** + * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. + */ + static race (promises: (R | Promise.Thenable)[]): Promise; +} + +declare namespace Promise { + export interface Thenable { + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; + } +} + +export = Promise; diff --git a/node_modules/any-promise/index.js b/node_modules/any-promise/index.js new file mode 100644 index 0000000000000000000000000000000000000000..74b85483df4daea96f991abd720d03b61fffc1ed --- /dev/null +++ b/node_modules/any-promise/index.js @@ -0,0 +1 @@ +module.exports = require('./register')().Promise diff --git a/node_modules/any-promise/loader.js b/node_modules/any-promise/loader.js new file mode 100644 index 0000000000000000000000000000000000000000..e1649142b444df029f2aa89ddf4955a8289dfa6d --- /dev/null +++ b/node_modules/any-promise/loader.js @@ -0,0 +1,78 @@ +"use strict" + // global key for user preferred registration +var REGISTRATION_KEY = '@@any-promise/REGISTRATION', + // Prior registration (preferred or detected) + registered = null + +/** + * Registers the given implementation. An implementation must + * be registered prior to any call to `require("any-promise")`, + * typically on application load. + * + * If called with no arguments, will return registration in + * following priority: + * + * For Node.js: + * + * 1. Previous registration + * 2. global.Promise if node.js version >= 0.12 + * 3. Auto detected promise based on first sucessful require of + * known promise libraries. Note this is a last resort, as the + * loaded library is non-deterministic. node.js >= 0.12 will + * always use global.Promise over this priority list. + * 4. Throws error. + * + * For Browser: + * + * 1. Previous registration + * 2. window.Promise + * 3. Throws error. + * + * Options: + * + * Promise: Desired Promise constructor + * global: Boolean - Should the registration be cached in a global variable to + * allow cross dependency/bundle registration? (default true) + */ +module.exports = function(root, loadImplementation){ + return function register(implementation, opts){ + implementation = implementation || null + opts = opts || {} + // global registration unless explicitly {global: false} in options (default true) + var registerGlobal = opts.global !== false; + + // load any previous global registration + if(registered === null && registerGlobal){ + registered = root[REGISTRATION_KEY] || null + } + + if(registered !== null + && implementation !== null + && registered.implementation !== implementation){ + // Throw error if attempting to redefine implementation + throw new Error('any-promise already defined as "'+registered.implementation+ + '". You can only register an implementation before the first '+ + ' call to require("any-promise") and an implementation cannot be changed') + } + + if(registered === null){ + // use provided implementation + if(implementation !== null && typeof opts.Promise !== 'undefined'){ + registered = { + Promise: opts.Promise, + implementation: implementation + } + } else { + // require implementation if implementation is specified but not provided + registered = loadImplementation(implementation) + } + + if(registerGlobal){ + // register preference globally in case multiple installations + root[REGISTRATION_KEY] = registered + } + } + + return registered + } +} diff --git a/node_modules/any-promise/optional.js b/node_modules/any-promise/optional.js new file mode 100644 index 0000000000000000000000000000000000000000..f3889420b898e770e33e5710379c5e13c7a330fd --- /dev/null +++ b/node_modules/any-promise/optional.js @@ -0,0 +1,6 @@ +"use strict"; +try { + module.exports = require('./register')().Promise || null +} catch(e) { + module.exports = null +} diff --git a/node_modules/any-promise/package.json b/node_modules/any-promise/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5baf14cf8c87abb445e62f9dcae03d7c588f1d28 --- /dev/null +++ b/node_modules/any-promise/package.json @@ -0,0 +1,45 @@ +{ + "name": "any-promise", + "version": "1.3.0", + "description": "Resolve any installed ES6 compatible promise", + "main": "index.js", + "typings": "index.d.ts", + "browser": { + "./register.js": "./register-shim.js" + }, + "scripts": { + "test": "ava" + }, + "repository": { + "type": "git", + "url": "https://github.com/kevinbeaty/any-promise" + }, + "keywords": [ + "promise", + "es6" + ], + "author": "Kevin Beaty", + "license": "MIT", + "bugs": { + "url": "https://github.com/kevinbeaty/any-promise/issues" + }, + "homepage": "http://github.com/kevinbeaty/any-promise", + "dependencies": {}, + "devDependencies": { + "ava": "^0.14.0", + "bluebird": "^3.0.0", + "es6-promise": "^3.0.0", + "is-promise": "^2.0.0", + "lie": "^3.0.0", + "mocha": "^2.0.0", + "native-promise-only": "^0.8.0", + "phantomjs-prebuilt": "^2.0.0", + "pinkie": "^2.0.0", + "promise": "^7.0.0", + "q": "^1.0.0", + "rsvp": "^3.0.0", + "vow": "^0.4.0", + "when": "^3.0.0", + "zuul": "^3.0.0" + } +} diff --git a/node_modules/any-promise/register-shim.js b/node_modules/any-promise/register-shim.js new file mode 100644 index 0000000000000000000000000000000000000000..9049405c0bfef05aa1a22a79078aa2fcb05ad4a8 --- /dev/null +++ b/node_modules/any-promise/register-shim.js @@ -0,0 +1,18 @@ +"use strict"; +module.exports = require('./loader')(window, loadImplementation) + +/** + * Browser specific loadImplementation. Always uses `window.Promise` + * + * To register a custom implementation, must register with `Promise` option. + */ +function loadImplementation(){ + if(typeof window.Promise === 'undefined'){ + throw new Error("any-promise browser requires a polyfill or explicit registration"+ + " e.g: require('any-promise/register/bluebird')") + } + return { + Promise: window.Promise, + implementation: 'window.Promise' + } +} diff --git a/node_modules/any-promise/register.d.ts b/node_modules/any-promise/register.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97f2fc051080c9d1717337ede3f74e713f3ee1ad --- /dev/null +++ b/node_modules/any-promise/register.d.ts @@ -0,0 +1,17 @@ +import Promise = require('./index'); + +declare function register (module?: string, options?: register.Options): register.Register; + +declare namespace register { + export interface Register { + Promise: typeof Promise; + implementation: string; + } + + export interface Options { + Promise?: typeof Promise; + global?: boolean + } +} + +export = register; diff --git a/node_modules/any-promise/register.js b/node_modules/any-promise/register.js new file mode 100644 index 0000000000000000000000000000000000000000..255c6e2f516f62d788de60d29c2ecff07dd840f5 --- /dev/null +++ b/node_modules/any-promise/register.js @@ -0,0 +1,94 @@ +"use strict" +module.exports = require('./loader')(global, loadImplementation); + +/** + * Node.js version of loadImplementation. + * + * Requires the given implementation and returns the registration + * containing {Promise, implementation} + * + * If implementation is undefined or global.Promise, loads it + * Otherwise uses require + */ +function loadImplementation(implementation){ + var impl = null + + if(shouldPreferGlobalPromise(implementation)){ + // if no implementation or env specified use global.Promise + impl = { + Promise: global.Promise, + implementation: 'global.Promise' + } + } else if(implementation){ + // if implementation specified, require it + var lib = require(implementation) + impl = { + Promise: lib.Promise || lib, + implementation: implementation + } + } else { + // try to auto detect implementation. This is non-deterministic + // and should prefer other branches, but this is our last chance + // to load something without throwing error + impl = tryAutoDetect() + } + + if(impl === null){ + throw new Error('Cannot find any-promise implementation nor'+ + ' global.Promise. You must install polyfill or call'+ + ' require("any-promise/register") with your preferred'+ + ' implementation, e.g. require("any-promise/register/bluebird")'+ + ' on application load prior to any require("any-promise").') + } + + return impl +} + +/** + * Determines if the global.Promise should be preferred if an implementation + * has not been registered. + */ +function shouldPreferGlobalPromise(implementation){ + if(implementation){ + return implementation === 'global.Promise' + } else if(typeof global.Promise !== 'undefined'){ + // Load global promise if implementation not specified + // Versions < 0.11 did not have global Promise + // Do not use for version < 0.12 as version 0.11 contained buggy versions + var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) + return !(version && +version[1] == 0 && +version[2] < 12) + } + + // do not have global.Promise or another implementation was specified + return false +} + +/** + * Look for common libs as last resort there is no guarantee that + * this will return a desired implementation or even be deterministic. + * The priority is also nearly arbitrary. We are only doing this + * for older versions of Node.js <0.12 that do not have a reasonable + * global.Promise implementation and we the user has not registered + * the preference. This preserves the behavior of any-promise <= 0.1 + * and may be deprecated or removed in the future + */ +function tryAutoDetect(){ + var libs = [ + "es6-promise", + "promise", + "native-promise-only", + "bluebird", + "rsvp", + "when", + "q", + "pinkie", + "lie", + "vow"] + var i = 0, len = libs.length + for(; i < len; i++){ + try { + return loadImplementation(libs[i]) + } catch(e){} + } + return null +} diff --git a/node_modules/any-promise/register/bluebird.d.ts b/node_modules/any-promise/register/bluebird.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/bluebird.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/bluebird.js b/node_modules/any-promise/register/bluebird.js new file mode 100644 index 0000000000000000000000000000000000000000..de0f87eb8e5099e3462608364a599c62e83eb550 --- /dev/null +++ b/node_modules/any-promise/register/bluebird.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('bluebird', {Promise: require('bluebird')}) diff --git a/node_modules/any-promise/register/es6-promise.d.ts b/node_modules/any-promise/register/es6-promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/es6-promise.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/es6-promise.js b/node_modules/any-promise/register/es6-promise.js new file mode 100644 index 0000000000000000000000000000000000000000..59bd55b761e004dea87e4afc212c8f584ac87dc6 --- /dev/null +++ b/node_modules/any-promise/register/es6-promise.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('es6-promise', {Promise: require('es6-promise').Promise}) diff --git a/node_modules/any-promise/register/lie.d.ts b/node_modules/any-promise/register/lie.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/lie.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/lie.js b/node_modules/any-promise/register/lie.js new file mode 100644 index 0000000000000000000000000000000000000000..7d305ca4006a0b53b8d8f8dc048fe5e2270d412f --- /dev/null +++ b/node_modules/any-promise/register/lie.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('lie', {Promise: require('lie')}) diff --git a/node_modules/any-promise/register/native-promise-only.d.ts b/node_modules/any-promise/register/native-promise-only.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/native-promise-only.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/native-promise-only.js b/node_modules/any-promise/register/native-promise-only.js new file mode 100644 index 0000000000000000000000000000000000000000..70a5a5e1dec6d467b8c656d734b53dac91005081 --- /dev/null +++ b/node_modules/any-promise/register/native-promise-only.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('native-promise-only', {Promise: require('native-promise-only')}) diff --git a/node_modules/any-promise/register/pinkie.d.ts b/node_modules/any-promise/register/pinkie.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/pinkie.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/pinkie.js b/node_modules/any-promise/register/pinkie.js new file mode 100644 index 0000000000000000000000000000000000000000..caaf98a5d04c78d8ba98b4084b87e1fb55776de2 --- /dev/null +++ b/node_modules/any-promise/register/pinkie.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('pinkie', {Promise: require('pinkie')}) diff --git a/node_modules/any-promise/register/promise.d.ts b/node_modules/any-promise/register/promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/promise.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/promise.js b/node_modules/any-promise/register/promise.js new file mode 100644 index 0000000000000000000000000000000000000000..746620d4e4748cadcf5fa1b9219bd764a1424b14 --- /dev/null +++ b/node_modules/any-promise/register/promise.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('promise', {Promise: require('promise')}) diff --git a/node_modules/any-promise/register/q.d.ts b/node_modules/any-promise/register/q.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/q.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/q.js b/node_modules/any-promise/register/q.js new file mode 100644 index 0000000000000000000000000000000000000000..0fc633a93f4ad2b07378afc998962288498aa481 --- /dev/null +++ b/node_modules/any-promise/register/q.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('q', {Promise: require('q').Promise}) diff --git a/node_modules/any-promise/register/rsvp.d.ts b/node_modules/any-promise/register/rsvp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/rsvp.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/rsvp.js b/node_modules/any-promise/register/rsvp.js new file mode 100644 index 0000000000000000000000000000000000000000..02b13180d16be95d8a48d8b0f3765ed591d6977d --- /dev/null +++ b/node_modules/any-promise/register/rsvp.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('rsvp', {Promise: require('rsvp').Promise}) diff --git a/node_modules/any-promise/register/vow.d.ts b/node_modules/any-promise/register/vow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/vow.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/vow.js b/node_modules/any-promise/register/vow.js new file mode 100644 index 0000000000000000000000000000000000000000..5b6868c4c988c069e670512f7964968a69799e87 --- /dev/null +++ b/node_modules/any-promise/register/vow.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('vow', {Promise: require('vow').Promise}) diff --git a/node_modules/any-promise/register/when.d.ts b/node_modules/any-promise/register/when.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..336ce12bb9106afdf843063ee67c0c1970f70d37 --- /dev/null +++ b/node_modules/any-promise/register/when.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/when.js b/node_modules/any-promise/register/when.js new file mode 100644 index 0000000000000000000000000000000000000000..d91c13d35e9b8ed5412012ab981442854db0b6ad --- /dev/null +++ b/node_modules/any-promise/register/when.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('when', {Promise: require('when').Promise}) diff --git a/node_modules/anymatch/LICENSE b/node_modules/anymatch/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..491766ca79a0382e5fc4e370c853201bb641e0d8 --- /dev/null +++ b/node_modules/anymatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/anymatch/README.md b/node_modules/anymatch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1dd67f53446ccbad8d17662fee69dd3c46531ba4 --- /dev/null +++ b/node_modules/anymatch/README.md @@ -0,0 +1,87 @@ +anymatch [![Build Status](https://travis-ci.org/micromatch/anymatch.svg?branch=master)](https://travis-ci.org/micromatch/anymatch) [![Coverage Status](https://img.shields.io/coveralls/micromatch/anymatch.svg?branch=master)](https://coveralls.io/r/micromatch/anymatch?branch=master) +====== +Javascript module to match a string against a regular expression, glob, string, +or function that takes the string as an argument and returns a truthy or falsy +value. The matcher can also be an array of any or all of these. Useful for +allowing a very flexible user-defined config to define things like file paths. + +__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__ + + +Usage +----- +```sh +npm install anymatch +``` + +#### anymatch(matchers, testString, [returnIndex], [options]) +* __matchers__: (_Array|String|RegExp|Function_) +String to be directly matched, string with glob patterns, regular expression +test, function that takes the testString as an argument and returns a truthy +value if it should be matched, or an array of any number and mix of these types. +* __testString__: (_String|Array_) The string to test against the matchers. If +passed as an array, the first element of the array will be used as the +`testString` for non-function matchers, while the entire array will be applied +as the arguments for function matchers. +* __options__: (_Object_ [optional]_) Any of the [picomatch](https://github.com/micromatch/picomatch#options) options. + * __returnIndex__: (_Boolean [optional]_) If true, return the array index of +the first matcher that that testString matched, or -1 if no match, instead of a +boolean result. + +```js +const anymatch = require('anymatch'); + +const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ; + +anymatch(matchers, 'path/to/file.js'); // true +anymatch(matchers, 'path/anyjs/baz.js'); // true +anymatch(matchers, 'path/to/foo.js'); // true +anymatch(matchers, 'path/to/bar.js'); // true +anymatch(matchers, 'bar.js'); // false + +// returnIndex = true +anymatch(matchers, 'foo.js', {returnIndex: true}); // 2 +anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1 + +// any picomatc + +// using globs to match directories and their children +anymatch('node_modules', 'node_modules'); // true +anymatch('node_modules', 'node_modules/somelib/index.js'); // false +anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true +anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false +anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true + +const matcher = anymatch(matchers); +['foo.js', 'bar.js'].filter(matcher); // [ 'foo.js' ] +anymatch master* ❯ + +``` + +#### anymatch(matchers) +You can also pass in only your matcher(s) to get a curried function that has +already been bound to the provided matching criteria. This can be used as an +`Array#filter` callback. + +```js +var matcher = anymatch(matchers); + +matcher('path/to/file.js'); // true +matcher('path/anyjs/baz.js', true); // 1 + +['foo.js', 'bar.js'].filter(matcher); // ['foo.js'] +``` + +Changelog +---------- +[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases) + +- **v3.0:** Removed `startIndex` and `endIndex` arguments. Node 8.x-only. +- **v2.0:** [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information). +- **v1.2:** anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch) +for glob pattern matching. Issues with glob pattern matching should be +reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues). + +License +------- +[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE) diff --git a/node_modules/anymatch/index.d.ts b/node_modules/anymatch/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ef7eaaddd8b5f479aeae707206d8163f82ada94 --- /dev/null +++ b/node_modules/anymatch/index.d.ts @@ -0,0 +1,20 @@ +type AnymatchFn = (testString: string) => boolean; +type AnymatchPattern = string|RegExp|AnymatchFn; +type AnymatchMatcher = AnymatchPattern|AnymatchPattern[] +type AnymatchTester = { + (testString: string|any[], returnIndex: true): number; + (testString: string|any[]): boolean; +} + +type PicomatchOptions = {dot: boolean}; + +declare const anymatch: { + (matchers: AnymatchMatcher): AnymatchTester; + (matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester; + (matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number; + (matchers: AnymatchMatcher, testString: string|any[]): boolean; +} + +export {AnymatchMatcher as Matcher} +export {AnymatchTester as Tester} +export default anymatch diff --git a/node_modules/anymatch/index.js b/node_modules/anymatch/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8eb73e9c9a61d2c642d3c5f44a2fe4cd6cd04615 --- /dev/null +++ b/node_modules/anymatch/index.js @@ -0,0 +1,104 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { value: true }); + +const picomatch = require('picomatch'); +const normalizePath = require('normalize-path'); + +/** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ +const BANG = '!'; +const DEFAULT_OPTIONS = {returnIndex: false}; +const arrify = (item) => Array.isArray(item) ? item : [item]; + +/** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ +const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; +}; + +/** + * @param {Array} patterns + * @param {Array} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ +const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath(_path, false); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; + } + } + + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; + } + } + + return returnIndex ? -1 : false; +}; + +/** + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} + */ +const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; + + // Early cache for matchers. + const mtchers = arrify(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) + .map(matcher => createPattern(matcher, opts)); + + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } + + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); +}; + +anymatch.default = anymatch; +module.exports = anymatch; diff --git a/node_modules/anymatch/node_modules/picomatch/LICENSE b/node_modules/anymatch/node_modules/picomatch/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3608dca25e30b572b6ad6935c8c7918bf70e3d2f --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/anymatch/node_modules/picomatch/README.md b/node_modules/anymatch/node_modules/picomatch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..80bae44cd4b3db24b5dcecdc98473fe34e0353d0 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/README.md @@ -0,0 +1,716 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +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. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```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' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```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 +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```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 } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: 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. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `number` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `maxExtglobRecursion` | `number\|boolean` | `0` | Limit nested quantified extglobs and other risky repeated extglob forms. When the limit is exceeded, the extglob is treated as a literal string instead of being compiled to regex. Set to `false` to disable this safeguard. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +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, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true + +// risky quantified extglobs are treated literally by default +console.log(pm.makeRe('+(a|aa)')); +//=> /^(?:\+\(a\|aa\))$/ + +// increase the limit to allow a small amount of nested quantified extglobs +console.log(pm.isMatch('aaa', '+(+(a))', { maxExtglobRecursion: 1 })); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/node_modules/anymatch/node_modules/picomatch/index.js b/node_modules/anymatch/node_modules/picomatch/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d2f2bc59d0ac7c40b35c574c45bcedbf26263d75 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/node_modules/anymatch/node_modules/picomatch/lib/constants.js b/node_modules/anymatch/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..4c87872e7041e4878243586cdc45559e29be9d93 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/lib/constants.js @@ -0,0 +1,184 @@ +'use strict'; + +const path = require('path'); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +const DEFAULT_MAX_EXTGLOB_RECURSION = 0; + +/** + * 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 = { + __proto__: null, + 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 = { + DEFAULT_MAX_EXTGLOB_RECURSION, + 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: { + __proto__: null, + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // 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; + } +}; diff --git a/node_modules/anymatch/node_modules/picomatch/lib/parse.js b/node_modules/anymatch/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..caa2b86aa5a567df33cef4bda3c7a97794f439f8 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1392 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * 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`; +}; + +const splitTopLevel = input => { + const parts = []; + let bracket = 0; + let paren = 0; + let quote = 0; + let value = ''; + let escaped = false; + + for (const ch of input) { + if (escaped === true) { + value += ch; + escaped = false; + continue; + } + + if (ch === '\\') { + value += ch; + escaped = true; + continue; + } + + if (ch === '"') { + quote = quote === 1 ? 0 : 1; + value += ch; + continue; + } + + if (quote === 0) { + if (ch === '[') { + bracket++; + } else if (ch === ']' && bracket > 0) { + bracket--; + } else if (bracket === 0) { + if (ch === '(') { + paren++; + } else if (ch === ')' && paren > 0) { + paren--; + } else if (ch === '|' && paren === 0) { + parts.push(value); + value = ''; + continue; + } + } + } + + value += ch; + } + + parts.push(value); + return parts; +}; + +const isPlainBranch = branch => { + let escaped = false; + + for (const ch of branch) { + if (escaped === true) { + escaped = false; + continue; + } + + if (ch === '\\') { + escaped = true; + continue; + } + + if (/[?*+@!()[\]{}]/.test(ch)) { + return false; + } + } + + return true; +}; + +const normalizeSimpleBranch = branch => { + let value = branch.trim(); + let changed = true; + + while (changed === true) { + changed = false; + + if (/^@\([^\\()[\]{}|]+\)$/.test(value)) { + value = value.slice(2, -1); + changed = true; + } + } + + if (!isPlainBranch(value)) { + return; + } + + return value.replace(/\\(.)/g, '$1'); +}; + +const hasRepeatedCharPrefixOverlap = branches => { + const values = branches.map(normalizeSimpleBranch).filter(Boolean); + + for (let i = 0; i < values.length; i++) { + for (let j = i + 1; j < values.length; j++) { + const a = values[i]; + const b = values[j]; + const char = a[0]; + + if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) { + continue; + } + + if (a === b || a.startsWith(b) || b.startsWith(a)) { + return true; + } + } + } + + return false; +}; + +const parseRepeatedExtglob = (pattern, requireEnd = true) => { + if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') { + return; + } + + let bracket = 0; + let paren = 0; + let quote = 0; + let escaped = false; + + for (let i = 1; i < pattern.length; i++) { + const ch = pattern[i]; + + if (escaped === true) { + escaped = false; + continue; + } + + if (ch === '\\') { + escaped = true; + continue; + } + + if (ch === '"') { + quote = quote === 1 ? 0 : 1; + continue; + } + + if (quote === 1) { + continue; + } + + if (ch === '[') { + bracket++; + continue; + } + + if (ch === ']' && bracket > 0) { + bracket--; + continue; + } + + if (bracket > 0) { + continue; + } + + if (ch === '(') { + paren++; + continue; + } + + if (ch === ')') { + paren--; + + if (paren === 0) { + if (requireEnd === true && i !== pattern.length - 1) { + return; + } + + return { + type: pattern[0], + body: pattern.slice(2, i), + end: i + }; + } + } + } +}; + +const getStarExtglobSequenceOutput = pattern => { + let index = 0; + const chars = []; + + while (index < pattern.length) { + const match = parseRepeatedExtglob(pattern.slice(index), false); + + if (!match || match.type !== '*') { + return; + } + + const branches = splitTopLevel(match.body).map(branch => branch.trim()); + if (branches.length !== 1) { + return; + } + + const branch = normalizeSimpleBranch(branches[0]); + if (!branch || branch.length !== 1) { + return; + } + + chars.push(branch); + index += match.end + 1; + } + + if (chars.length < 1) { + return; + } + + const source = chars.length === 1 + ? utils.escapeRegex(chars[0]) + : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`; + + return `${source}*`; +}; + +const repeatedExtglobRecursion = pattern => { + let depth = 0; + let value = pattern.trim(); + let match = parseRepeatedExtglob(value); + + while (match) { + depth++; + value = match.body.trim(); + match = parseRepeatedExtglob(value); + } + + return depth; +}; + +const analyzeRepeatedExtglob = (body, options) => { + if (options.maxExtglobRecursion === false) { + return { risky: false }; + } + + const max = + typeof options.maxExtglobRecursion === 'number' + ? options.maxExtglobRecursion + : constants.DEFAULT_MAX_EXTGLOB_RECURSION; + + const branches = splitTopLevel(body).map(branch => branch.trim()); + + if (branches.length > 1) { + if ( + branches.some(branch => branch === '') || + branches.some(branch => /^[*?]+$/.test(branch)) || + hasRepeatedCharPrefixOverlap(branches) + ) { + return { risky: true }; + } + } + + for (const branch of branches) { + const safeOutput = getStarExtglobSequenceOutput(branch); + if (safeOutput) { + return { risky: true, safeOutput }; + } + + if (repeatedExtglobRecursion(branch) > max) { + return { risky: true }; + } + } + + return { risky: false }; +}; + +/** + * 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 = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 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; + token.startIndex = state.index; + token.tokensIndex = tokens.length; + 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 => { + const literal = input.slice(token.startIndex, state.index + 1); + const body = input.slice(token.startIndex + 2, state.index); + const analysis = analyzeRepeatedExtglob(body, opts); + + if ((token.type === 'plus' || token.type === 'star') && analysis.risky) { + const safeOutput = analysis.safeOutput + ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) + : undefined; + const open = tokens[token.tokensIndex]; + + open.type = 'text'; + open.value = literal; + open.output = safeOutput || utils.escapeRegex(literal); + + for (let i = token.tokensIndex + 1; i < tokens.length; i++) { + tokens[i].value = ''; + tokens[i].output = ''; + delete tokens[i].suffix; + } + + state.output = token.output + open.output; + state.backtrack = true; + + push({ type: 'paren', extglob: true, value, output: '' }); + decrement('parens'); + return; + } + + 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; diff --git a/node_modules/anymatch/node_modules/picomatch/lib/picomatch.js b/node_modules/anymatch/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000000000000000000000000000000000000..782d809435a75989f2f3d7801f45b4fab398cb36 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,342 @@ +'use strict'; + +const path = require('path'); +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +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 = (glob, options, returnState = 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 = (input, returnObject = 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 = (input, regex, options, { glob, posix } = {}) => { + 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 = (input, glob, options, posix = 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 = (state, options, returnOutput = false, returnState = 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 = (input, options = {}, returnOutput = false, returnState = 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; diff --git a/node_modules/anymatch/node_modules/picomatch/lib/scan.js b/node_modules/anymatch/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000000000000000000000000000000000000..e59cd7a1357b184b0c70409b161fcf0ce5433af1 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +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 /* ] */ +} = require('./constants'); + +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; diff --git a/node_modules/anymatch/node_modules/picomatch/lib/utils.js b/node_modules/anymatch/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c3ca766a7bef961c6cc9c5b5e04c930aa05d7608 --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/lib/utils.js @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +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 = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/node_modules/anymatch/node_modules/picomatch/package.json b/node_modules/anymatch/node_modules/picomatch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e329d9ce93ad5f047a7bacdb651b1cd21c6274ac --- /dev/null +++ b/node_modules/anymatch/node_modules/picomatch/package.json @@ -0,0 +1,81 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "2.3.2", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^6.8.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/node_modules/anymatch/package.json b/node_modules/anymatch/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2cb2307e49efc4770c0e8364e4387105162956dd --- /dev/null +++ b/node_modules/anymatch/package.json @@ -0,0 +1,48 @@ +{ + "name": "anymatch", + "version": "3.1.3", + "description": "Matches strings against configurable strings, globs, regular expressions, and/or functions", + "files": [ + "index.js", + "index.d.ts" + ], + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "author": { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + "license": "ISC", + "homepage": "https://github.com/micromatch/anymatch", + "repository": { + "type": "git", + "url": "https://github.com/micromatch/anymatch" + }, + "keywords": [ + "match", + "any", + "string", + "file", + "fs", + "list", + "glob", + "regex", + "regexp", + "regular", + "expression", + "function" + ], + "scripts": { + "test": "nyc mocha", + "mocha": "mocha" + }, + "devDependencies": { + "mocha": "^6.1.3", + "nyc": "^14.0.0" + }, + "engines": { + "node": ">= 8" + } +} diff --git a/node_modules/arg/LICENSE.md b/node_modules/arg/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b708f872cb51eb69058c6f83864300a5ce4b0658 --- /dev/null +++ b/node_modules/arg/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/arg/README.md b/node_modules/arg/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6501df5980d25fb1dc4f3f569ae36192cdb8f5cb --- /dev/null +++ b/node_modules/arg/README.md @@ -0,0 +1,317 @@ +# Arg + +`arg` is an unopinionated, no-frills CLI argument parser. + +## Installation + +```bash +npm install arg +``` + +## Usage + +`arg()` takes either 1 or 2 arguments: + +1. Command line specification object (see below) +2. Parse options (_Optional_, defaults to `{permissive: false, argv: process.argv.slice(2), stopAtPositional: false}`) + +It returns an object with any values present on the command-line (missing options are thus +missing from the resulting object). Arg performs no validation/requirement checking - we +leave that up to the application. + +All parameters that aren't consumed by options (commonly referred to as "extra" parameters) +are added to `result._`, which is _always_ an array (even if no extra parameters are passed, +in which case an empty array is returned). + +```javascript +const arg = require('arg'); + +// `options` is an optional parameter +const args = arg( + spec, + (options = { permissive: false, argv: process.argv.slice(2) }) +); +``` + +For example: + +```console +$ node ./hello.js --verbose -vvv --port=1234 -n 'My name' foo bar --tag qux --tag=qix -- --foobar +``` + +```javascript +// hello.js +const arg = require('arg'); + +const args = arg({ + // Types + '--help': Boolean, + '--version': Boolean, + '--verbose': arg.COUNT, // Counts the number of times --verbose is passed + '--port': Number, // --port or --port= + '--name': String, // --name or --name= + '--tag': [String], // --tag or --tag= + + // Aliases + '-v': '--verbose', + '-n': '--name', // -n ; result is stored in --name + '--label': '--name' // --label or --label=; + // result is stored in --name +}); + +console.log(args); +/* +{ + _: ["foo", "bar", "--foobar"], + '--port': 1234, + '--verbose': 4, + '--name': "My name", + '--tag': ["qux", "qix"] +} +*/ +``` + +The values for each key=>value pair is either a type (function or [function]) or a string (indicating an alias). + +- In the case of a function, the string value of the argument's value is passed to it, + and the return value is used as the ultimate value. + +- In the case of an array, the only element _must_ be a type function. Array types indicate + that the argument may be passed multiple times, and as such the resulting value in the returned + object is an array with all of the values that were passed using the specified flag. + +- In the case of a string, an alias is established. If a flag is passed that matches the _key_, + then the _value_ is substituted in its place. + +Type functions are passed three arguments: + +1. The parameter value (always a string) +2. The parameter name (e.g. `--label`) +3. The previous value for the destination (useful for reduce-like operations or for supporting `-v` multiple times, etc.) + +This means the built-in `String`, `Number`, and `Boolean` type constructors "just work" as type functions. + +Note that `Boolean` and `[Boolean]` have special treatment - an option argument is _not_ consumed or passed, but instead `true` is +returned. These options are called "flags". + +For custom handlers that wish to behave as flags, you may pass the function through `arg.flag()`: + +```javascript +const arg = require('arg'); + +const argv = [ + '--foo', + 'bar', + '-ff', + 'baz', + '--foo', + '--foo', + 'qux', + '-fff', + 'qix' +]; + +function myHandler(value, argName, previousValue) { + /* `value` is always `true` */ + return 'na ' + (previousValue || 'batman!'); +} + +const args = arg( + { + '--foo': arg.flag(myHandler), + '-f': '--foo' + }, + { + argv + } +); + +console.log(args); +/* +{ + _: ['bar', 'baz', 'qux', 'qix'], + '--foo': 'na na na na na na na na batman!' +} +*/ +``` + +As well, `arg` supplies a helper argument handler called `arg.COUNT`, which equivalent to a `[Boolean]` argument's `.length` +property - effectively counting the number of times the boolean flag, denoted by the key, is passed on the command line.. +For example, this is how you could implement `ssh`'s multiple levels of verbosity (`-vvvv` being the most verbose). + +```javascript +const arg = require('arg'); + +const argv = ['-AAAA', '-BBBB']; + +const args = arg( + { + '-A': arg.COUNT, + '-B': [Boolean] + }, + { + argv + } +); + +console.log(args); +/* +{ + _: [], + '-A': 4, + '-B': [true, true, true, true] +} +*/ +``` + +### Options + +If a second parameter is specified and is an object, it specifies parsing options to modify the behavior of `arg()`. + +#### `argv` + +If you have already sliced or generated a number of raw arguments to be parsed (as opposed to letting `arg` +slice them from `process.argv`) you may specify them in the `argv` option. + +For example: + +```javascript +const args = arg( + { + '--foo': String + }, + { + argv: ['hello', '--foo', 'world'] + } +); +``` + +results in: + +```javascript +const args = { + _: ['hello'], + '--foo': 'world' +}; +``` + +#### `permissive` + +When `permissive` set to `true`, `arg` will push any unknown arguments +onto the "extra" argument array (`result._`) instead of throwing an error about +an unknown flag. + +For example: + +```javascript +const arg = require('arg'); + +const argv = [ + '--foo', + 'hello', + '--qux', + 'qix', + '--bar', + '12345', + 'hello again' +]; + +const args = arg( + { + '--foo': String, + '--bar': Number + }, + { + argv, + permissive: true + } +); +``` + +results in: + +```javascript +const args = { + _: ['--qux', 'qix', 'hello again'], + '--foo': 'hello', + '--bar': 12345 +}; +``` + +#### `stopAtPositional` + +When `stopAtPositional` is set to `true`, `arg` will halt parsing at the first +positional argument. + +For example: + +```javascript +const arg = require('arg'); + +const argv = ['--foo', 'hello', '--bar']; + +const args = arg( + { + '--foo': Boolean, + '--bar': Boolean + }, + { + argv, + stopAtPositional: true + } +); +``` + +results in: + +```javascript +const args = { + _: ['hello', '--bar'], + '--foo': true +}; +``` + +### Errors + +Some errors that `arg` throws provide a `.code` property in order to aid in recovering from user error, or to +differentiate between user error and developer error (bug). + +##### ARG_UNKNOWN_OPTION + +If an unknown option (not defined in the spec object) is passed, an error with code `ARG_UNKNOWN_OPTION` will be thrown: + +```js +// cli.js +try { + require('arg')({ '--hi': String }); +} catch (err) { + if (err.code === 'ARG_UNKNOWN_OPTION') { + console.log(err.message); + } else { + throw err; + } +} +``` + +```shell +node cli.js --extraneous true +Unknown or unexpected option: --extraneous +``` + +# FAQ + +A few questions and answers that have been asked before: + +### How do I require an argument with `arg`? + +Do the assertion yourself, such as: + +```javascript +const args = arg({ '--name': String }); + +if (!args['--name']) throw new Error('missing required argument: --name'); +``` + +# License + +Released under the [MIT License](LICENSE.md). diff --git a/node_modules/arg/index.d.ts b/node_modules/arg/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44f9f354ba3354257f701bbcf669dc5fae45792a --- /dev/null +++ b/node_modules/arg/index.d.ts @@ -0,0 +1,44 @@ +declare function arg( + spec: T, + options?: arg.Options +): arg.Result; + +declare namespace arg { + export const flagSymbol: unique symbol; + + export function flag(fn: T): T & { [arg.flagSymbol]: true }; + + export const COUNT: Handler & { [arg.flagSymbol]: true }; + + export type Handler = ( + value: string, + name: string, + previousValue?: T + ) => T; + + export class ArgError extends Error { + constructor(message: string, code: string); + + code: string; + } + + export interface Spec { + [key: string]: string | Handler | [Handler]; + } + + export type Result = { _: string[] } & { + [K in keyof T]?: T[K] extends Handler + ? ReturnType + : T[K] extends [Handler] + ? Array> + : never; + }; + + export interface Options { + argv?: string[]; + permissive?: boolean; + stopAtPositional?: boolean; + } +} + +export = arg; diff --git a/node_modules/arg/index.js b/node_modules/arg/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f60f4cadc95780cfbb37bf27e972a864c69cbff --- /dev/null +++ b/node_modules/arg/index.js @@ -0,0 +1,195 @@ +const flagSymbol = Symbol('arg flag'); + +class ArgError extends Error { + constructor(msg, code) { + super(msg); + this.name = 'ArgError'; + this.code = code; + + Object.setPrototypeOf(this, ArgError.prototype); + } +} + +function arg( + opts, + { + argv = process.argv.slice(2), + permissive = false, + stopAtPositional = false + } = {} +) { + if (!opts) { + throw new ArgError( + 'argument specification object is required', + 'ARG_CONFIG_NO_SPEC' + ); + } + + const result = { _: [] }; + + const aliases = {}; + const handlers = {}; + + for (const key of Object.keys(opts)) { + if (!key) { + throw new ArgError( + 'argument key cannot be an empty string', + 'ARG_CONFIG_EMPTY_KEY' + ); + } + + if (key[0] !== '-') { + throw new ArgError( + `argument key must start with '-' but found: '${key}'`, + 'ARG_CONFIG_NONOPT_KEY' + ); + } + + if (key.length === 1) { + throw new ArgError( + `argument key must have a name; singular '-' keys are not allowed: ${key}`, + 'ARG_CONFIG_NONAME_KEY' + ); + } + + if (typeof opts[key] === 'string') { + aliases[key] = opts[key]; + continue; + } + + let type = opts[key]; + let isFlag = false; + + if ( + Array.isArray(type) && + type.length === 1 && + typeof type[0] === 'function' + ) { + const [fn] = type; + type = (value, name, prev = []) => { + prev.push(fn(value, name, prev[prev.length - 1])); + return prev; + }; + isFlag = fn === Boolean || fn[flagSymbol] === true; + } else if (typeof type === 'function') { + isFlag = type === Boolean || type[flagSymbol] === true; + } else { + throw new ArgError( + `type missing or not a function or valid array type: ${key}`, + 'ARG_CONFIG_VAD_TYPE' + ); + } + + if (key[1] !== '-' && key.length > 2) { + throw new ArgError( + `short argument keys (with a single hyphen) must have only one character: ${key}`, + 'ARG_CONFIG_SHORTOPT_TOOLONG' + ); + } + + handlers[key] = [type, isFlag]; + } + + for (let i = 0, len = argv.length; i < len; i++) { + const wholeArg = argv[i]; + + if (stopAtPositional && result._.length > 0) { + result._ = result._.concat(argv.slice(i)); + break; + } + + if (wholeArg === '--') { + result._ = result._.concat(argv.slice(i + 1)); + break; + } + + if (wholeArg.length > 1 && wholeArg[0] === '-') { + /* eslint-disable operator-linebreak */ + const separatedArguments = + wholeArg[1] === '-' || wholeArg.length === 2 + ? [wholeArg] + : wholeArg + .slice(1) + .split('') + .map((a) => `-${a}`); + /* eslint-enable operator-linebreak */ + + for (let j = 0; j < separatedArguments.length; j++) { + const arg = separatedArguments[j]; + const [originalArgName, argStr] = + arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; + + let argName = originalArgName; + while (argName in aliases) { + argName = aliases[argName]; + } + + if (!(argName in handlers)) { + if (permissive) { + result._.push(arg); + continue; + } else { + throw new ArgError( + `unknown or unexpected option: ${originalArgName}`, + 'ARG_UNKNOWN_OPTION' + ); + } + } + + const [type, isFlag] = handlers[argName]; + + if (!isFlag && j + 1 < separatedArguments.length) { + throw new ArgError( + `option requires argument (but was followed by another short argument): ${originalArgName}`, + 'ARG_MISSING_REQUIRED_SHORTARG' + ); + } + + if (isFlag) { + result[argName] = type(true, argName, result[argName]); + } else if (argStr === undefined) { + if ( + argv.length < i + 2 || + (argv[i + 1].length > 1 && + argv[i + 1][0] === '-' && + !( + argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && + (type === Number || + // eslint-disable-next-line no-undef + (typeof BigInt !== 'undefined' && type === BigInt)) + )) + ) { + const extended = + originalArgName === argName ? '' : ` (alias for ${argName})`; + throw new ArgError( + `option requires argument: ${originalArgName}${extended}`, + 'ARG_MISSING_REQUIRED_LONGARG' + ); + } + + result[argName] = type(argv[i + 1], argName, result[argName]); + ++i; + } else { + result[argName] = type(argStr, argName, result[argName]); + } + } + } else { + result._.push(wholeArg); + } + } + + return result; +} + +arg.flag = (fn) => { + fn[flagSymbol] = true; + return fn; +}; + +// Utility types +arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); + +// Expose error class +arg.ArgError = ArgError; + +module.exports = arg; diff --git a/node_modules/arg/package.json b/node_modules/arg/package.json new file mode 100644 index 0000000000000000000000000000000000000000..47368d76d2b916bb003ec35e0ff6162d3f23768f --- /dev/null +++ b/node_modules/arg/package.json @@ -0,0 +1,28 @@ +{ + "name": "arg", + "version": "5.0.2", + "description": "Unopinionated, no-frills CLI argument parser", + "main": "index.js", + "types": "index.d.ts", + "repository": "vercel/arg", + "author": "Josh Junon ", + "license": "MIT", + "files": [ + "index.js", + "index.d.ts" + ], + "scripts": { + "test": "WARN_EXIT=1 jest --coverage -w 2" + }, + "devDependencies": { + "chai": "^4.1.1", + "jest": "^27.0.6", + "prettier": "^2.3.2" + }, + "prettier": { + "arrowParens": "always", + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none" + } +} diff --git a/node_modules/argparse/CHANGELOG.md b/node_modules/argparse/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..dc39ed6952f87adcd961d07749e1ffe7a2b7335b --- /dev/null +++ b/node_modules/argparse/CHANGELOG.md @@ -0,0 +1,216 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [2.0.1] - 2020-08-29 +### Fixed +- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150. + + +## [2.0.0] - 2020-08-14 +### Changed +- Full rewrite. Now port from python 3.9.0 & more precise following. + See [doc](./doc) for difference and migration info. +- node.js 10+ required +- Removed most of local docs in favour of original ones. + + +## [1.0.10] - 2018-02-15 +### Fixed +- Use .concat instead of + for arrays, #122. + + +## [1.0.9] - 2016-09-29 +### Changed +- Rerelease after 1.0.8 - deps cleanup. + + +## [1.0.8] - 2016-09-29 +### Changed +- Maintenance (deps bump, fix node 6.5+ tests, coverage report). + + +## [1.0.7] - 2016-03-17 +### Changed +- Teach `addArgument` to accept string arg names. #97, @tomxtobin. + + +## [1.0.6] - 2016-02-06 +### Changed +- Maintenance: moved to eslint & updated CS. + + +## [1.0.5] - 2016-02-05 +### Changed +- Removed lodash dependency to significantly reduce install size. + Thanks to @mourner. + + +## [1.0.4] - 2016-01-17 +### Changed +- Maintenance: lodash update to 4.0.0. + + +## [1.0.3] - 2015-10-27 +### Fixed +- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. + + +## [1.0.2] - 2015-03-22 +### Changed +- Relaxed lodash version dependency. + + +## [1.0.1] - 2015-02-20 +### Changed +- Changed dependencies to be compatible with ancient nodejs. + + +## [1.0.0] - 2015-02-19 +### Changed +- Maintenance release. +- Replaced `underscore` with `lodash`. +- Bumped version to 1.0.0 to better reflect semver meaning. +- HISTORY.md -> CHANGELOG.md + + +## [0.1.16] - 2013-12-01 +### Changed +- Maintenance release. Updated dependencies and docs. + + +## [0.1.15] - 2013-05-13 +### Fixed +- Fixed #55, @trebor89 + + +## [0.1.14] - 2013-05-12 +### Fixed +- Fixed #62, @maxtaco + + +## [0.1.13] - 2013-04-08 +### Changed +- Added `.npmignore` to reduce package size + + +## [0.1.12] - 2013-02-10 +### Fixed +- Fixed conflictHandler (#46), @hpaulj + + +## [0.1.11] - 2013-02-07 +### Added +- Added 70+ tests (ported from python), @hpaulj +- Added conflictHandler, @applepicke +- Added fromfilePrefixChar, @hpaulj + +### Fixed +- Multiple bugfixes, @hpaulj + + +## [0.1.10] - 2012-12-30 +### Added +- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj + +### Fixed +- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +## [0.1.9] - 2012-12-27 +### Fixed +- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +- Fixed default value behavior with `*` positionals, thanks to @hpaulj +- Improve `getDefault()` behavior, thanks to @hpaulj +- Improve negative argument parsing, thanks to @hpaulj + + +## [0.1.8] - 2012-12-01 +### Fixed +- Fixed parser parents (issue #19), thanks to @hpaulj +- Fixed negative argument parse (issue #20), thanks to @hpaulj + + +## [0.1.7] - 2012-10-14 +### Fixed +- Fixed 'choices' argument parse (issue #16) +- Fixed stderr output (issue #15) + + +## [0.1.6] - 2012-09-09 +### Fixed +- Fixed check for conflict of options (thanks to @tomxtobin) + + +## [0.1.5] - 2012-09-03 +### Fixed +- Fix parser #setDefaults method (thanks to @tomxtobin) + + +## [0.1.4] - 2012-07-30 +### Fixed +- Fixed pseudo-argument support (thanks to @CGamesPlay) +- Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +## [0.1.3] - 2012-06-27 +### Fixed +- Fixed formatter api name: Formatter -> HelpFormatter + + +## [0.1.2] - 2012-05-29 +### Fixed +- Removed excess whitespace in help +- Fixed error reporting, when parcer with subcommands + called with empty arguments + +### Added +- Added basic tests + + +## [0.1.1] - 2012-05-23 +### Fixed +- Fixed line wrapping in help formatter +- Added better error reporting on invalid arguments + + +## [0.1.0] - 2012-05-16 +### Added +- First release. + + +[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0 +[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10 +[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9 +[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8 +[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7 +[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6 +[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5 +[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0 +[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16 +[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15 +[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14 +[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13 +[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12 +[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11 +[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10 +[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9 +[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8 +[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7 +[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6 +[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5 +[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4 +[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1 +[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0 diff --git a/node_modules/argparse/LICENSE b/node_modules/argparse/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..66a3ac80d729a3a5bdfd22002d34be59a6daf222 --- /dev/null +++ b/node_modules/argparse/LICENSE @@ -0,0 +1,254 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/argparse/README.md b/node_modules/argparse/README.md new file mode 100644 index 0000000000000000000000000000000000000000..550b5c9b7b00aaa18ba240b485e5b31598ef04b2 --- /dev/null +++ b/node_modules/argparse/README.md @@ -0,0 +1,84 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) +[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) + +CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). + +**Difference with original.** + +- JS has no keyword arguments support. + - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. +- JS has no python's types `int`, `float`, ... + - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. +- `%r` format specifier uses `require('util').inspect()`. + +More details in [doc](./doc). + + +Example +------- + +`test.js` file: + +```javascript +#!/usr/bin/env node +'use strict'; + +const { ArgumentParser } = require('argparse'); +const { version } = require('./package.json'); + +const parser = new ArgumentParser({ + description: 'Argparse example' +}); + +parser.add_argument('-v', '--version', { action: 'version', version }); +parser.add_argument('-f', '--foo', { help: 'foo bar' }); +parser.add_argument('-b', '--bar', { help: 'bar foo' }); +parser.add_argument('--baz', { help: 'baz bar' }); + +console.dir(parser.parse_args()); +``` + +Display help: + +``` +$ ./test.js -h +usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] + +Argparse example + +optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo + --baz BAZ baz bar +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } +``` + + +API docs +-------- + +Since this is a port with minimal divergence, there's no separate documentation. +Use original one instead, with notes about difference. + +1. [Original doc](https://docs.python.org/3.9/library/argparse.html). +2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). +3. [Difference with python](./doc). + + +argparse for enterprise +----------------------- + +Available as part of the Tidelift Subscription + +The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/argparse/argparse.js b/node_modules/argparse/argparse.js new file mode 100644 index 0000000000000000000000000000000000000000..2b8c8c63177af9757a44926cfc3ab7d9878c9387 --- /dev/null +++ b/node_modules/argparse/argparse.js @@ -0,0 +1,3707 @@ +// Port of python's argparse module, version 3.9.0: +// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py + +'use strict' + +// Copyright (C) 2010-2020 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors + +/* + * Command-line parsing library + * + * This module is an optparse-inspired command-line parsing library that: + * + * - handles both optional and positional arguments + * - produces highly informative usage messages + * - supports parsers that dispatch to sub-parsers + * + * The following is a simple usage example that sums integers from the + * command-line and writes the result to a file:: + * + * parser = argparse.ArgumentParser( + * description='sum the integers at the command line') + * parser.add_argument( + * 'integers', metavar='int', nargs='+', type=int, + * help='an integer to be summed') + * parser.add_argument( + * '--log', default=sys.stdout, type=argparse.FileType('w'), + * help='the file where the sum should be written') + * args = parser.parse_args() + * args.log.write('%s' % sum(args.integers)) + * args.log.close() + * + * The module contains the following public classes: + * + * - ArgumentParser -- The main entry point for command-line parsing. As the + * example above shows, the add_argument() method is used to populate + * the parser with actions for optional and positional arguments. Then + * the parse_args() method is invoked to convert the args at the + * command-line into an object with attributes. + * + * - ArgumentError -- The exception raised by ArgumentParser objects when + * there are errors with the parser's actions. Errors raised while + * parsing the command-line are caught by ArgumentParser and emitted + * as command-line messages. + * + * - FileType -- A factory for defining types of files to be created. As the + * example above shows, instances of FileType are typically passed as + * the type= argument of add_argument() calls. + * + * - Action -- The base class for parser actions. Typically actions are + * selected by passing strings like 'store_true' or 'append_const' to + * the action= argument of add_argument(). However, for greater + * customization of ArgumentParser actions, subclasses of Action may + * be defined and passed as the action= argument. + * + * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, + * ArgumentDefaultsHelpFormatter -- Formatter classes which + * may be passed as the formatter_class= argument to the + * ArgumentParser constructor. HelpFormatter is the default, + * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser + * not to change the formatting for help text, and + * ArgumentDefaultsHelpFormatter adds information about argument defaults + * to the help. + * + * All other classes in this module are considered implementation details. + * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only + * considered public as object names -- the API of the formatter objects is + * still considered an implementation detail.) + */ + +const SUPPRESS = '==SUPPRESS==' + +const OPTIONAL = '?' +const ZERO_OR_MORE = '*' +const ONE_OR_MORE = '+' +const PARSER = 'A...' +const REMAINDER = '...' +const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args' + + +// ================================== +// Utility functions used for porting +// ================================== +const assert = require('assert') +const util = require('util') +const fs = require('fs') +const sub = require('./lib/sub') +const path = require('path') +const repr = util.inspect + +function get_argv() { + // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.) + return process.argv.slice(1) +} + +function get_terminal_size() { + return { + columns: +process.env.COLUMNS || process.stdout.columns || 80 + } +} + +function hasattr(object, name) { + return Object.prototype.hasOwnProperty.call(object, name) +} + +function getattr(object, name, value) { + return hasattr(object, name) ? object[name] : value +} + +function setattr(object, name, value) { + object[name] = value +} + +function setdefault(object, name, value) { + if (!hasattr(object, name)) object[name] = value + return object[name] +} + +function delattr(object, name) { + delete object[name] +} + +function range(from, to, step=1) { + // range(10) is equivalent to range(0, 10) + if (arguments.length === 1) [ to, from ] = [ from, 0 ] + if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') { + throw new TypeError('argument cannot be interpreted as an integer') + } + if (step === 0) throw new TypeError('range() arg 3 must not be zero') + + let result = [] + if (step > 0) { + for (let i = from; i < to; i += step) result.push(i) + } else { + for (let i = from; i > to; i += step) result.push(i) + } + return result +} + +function splitlines(str, keepends = false) { + let result + if (!keepends) { + result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/) + } else { + result = [] + let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/) + for (let i = 0; i < parts.length; i += 2) { + result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : '')) + } + } + if (!result[result.length - 1]) result.pop() + return result +} + +function _string_lstrip(string, prefix_chars) { + let idx = 0 + while (idx < string.length && prefix_chars.includes(string[idx])) idx++ + return idx ? string.slice(idx) : string +} + +function _string_split(string, sep, maxsplit) { + let result = string.split(sep) + if (result.length > maxsplit) { + result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ]) + } + return result +} + +function _array_equal(array1, array2) { + if (array1.length !== array2.length) return false + for (let i = 0; i < array1.length; i++) { + if (array1[i] !== array2[i]) return false + } + return true +} + +function _array_remove(array, item) { + let idx = array.indexOf(item) + if (idx === -1) throw new TypeError(sub('%r not in list', item)) + array.splice(idx, 1) +} + +// normalize choices to array; +// this isn't required in python because `in` and `map` operators work with anything, +// but in js dealing with multiple types here is too clunky +function _choices_to_array(choices) { + if (choices === undefined) { + return [] + } else if (Array.isArray(choices)) { + return choices + } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') { + return Array.from(choices) + } else if (typeof choices === 'object' && choices !== null) { + return Object.keys(choices) + } else { + throw new Error(sub('invalid choices value: %r', choices)) + } +} + +// decorator that allows a class to be called without new +function _callable(cls) { + let result = { // object is needed for inferred class name + [cls.name]: function (...args) { + let this_class = new.target === result || !new.target + return Reflect.construct(cls, args, this_class ? cls : new.target) + } + } + result[cls.name].prototype = cls.prototype + // fix default tag for toString, e.g. [object Action] instead of [object Object] + cls.prototype[Symbol.toStringTag] = cls.name + return result[cls.name] +} + +function _alias(object, from, to) { + try { + let name = object.constructor.name + Object.defineProperty(object, from, { + value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()', + name, from, name, to)), + enumerable: false + }) + } catch {} +} + +// decorator that allows snake_case class methods to be called with camelCase and vice versa +function _camelcase_alias(_class) { + for (let name of Object.getOwnPropertyNames(_class.prototype)) { + let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (camelcase !== name) _alias(_class.prototype, camelcase, name) + } + return _class +} + +function _to_legacy_name(key) { + key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (key === 'default') key = 'defaultValue' + if (key === 'const') key = 'constant' + return key +} + +function _to_new_name(key) { + if (key === 'defaultValue') key = 'default' + if (key === 'constant') key = 'const' + key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase()) + return key +} + +// parse options +let no_default = Symbol('no_default_value') +function _parse_opts(args, descriptor) { + function get_name() { + let stack = new Error().stack.split('\n') + .map(x => x.match(/^ at (.*) \(.*\)$/)) + .filter(Boolean) + .map(m => m[1]) + .map(fn => fn.match(/[^ .]*$/)[0]) + + if (stack.length && stack[0] === get_name.name) stack.shift() + if (stack.length && stack[0] === _parse_opts.name) stack.shift() + return stack.length ? stack[0] : '' + } + + args = Array.from(args) + let kwargs = {} + let result = [] + let last_opt = args.length && args[args.length - 1] + + if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) && + (!last_opt.constructor || last_opt.constructor.name === 'Object')) { + kwargs = Object.assign({}, args.pop()) + } + + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(descriptor)) { + let old_name = _to_legacy_name(key) + if (old_name !== key && (old_name in kwargs)) { + if (key in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else { + kwargs[key] = kwargs[old_name] + } + renames.push([ old_name, key ]) + delete kwargs[old_name] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + + let missing_positionals = [] + let positional_count = args.length + + for (let [ key, def ] of Object.entries(descriptor)) { + if (key[0] === '*') { + if (key.length > 0 && key[1] === '*') { + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(kwargs)) { + let new_name = _to_new_name(key) + if (new_name !== key && (key in kwargs)) { + if (new_name in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name)) + } else { + kwargs[new_name] = kwargs[key] + } + renames.push([ key, new_name ]) + delete kwargs[key] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + result.push(kwargs) + kwargs = {} + } else { + result.push(args) + args = [] + } + } else if (key in kwargs && args.length > 0) { + throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else if (key in kwargs) { + result.push(kwargs[key]) + delete kwargs[key] + } else if (args.length > 0) { + result.push(args.shift()) + } else if (def !== no_default) { + result.push(def) + } else { + missing_positionals.push(key) + } + } + + if (Object.keys(kwargs).length) { + throw new TypeError(sub('%s() got an unexpected keyword argument %r', + get_name(), Object.keys(kwargs)[0])) + } + + if (args.length) { + let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length + let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length + throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given', + get_name(), + from === to ? sub('from %s to %s', from, to) : to, + from === to && to === 1 ? '' : 's', + positional_count, + positional_count === 1 ? 'was' : 'were')) + } + + if (missing_positionals.length) { + let strs = missing_positionals.map(repr) + if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1] + let str_joined = strs.join(strs.length === 2 ? '' : ', ') + throw new TypeError(sub('%s() missing %i required positional argument%s: %s', + get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined)) + } + + return result +} + +let _deprecations = {} +function deprecate(id, string) { + _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string) + _deprecations[id]() +} + + +// ============================= +// Utility functions and classes +// ============================= +function _AttributeHolder(cls = Object) { + /* + * Abstract base class that provides __repr__. + * + * The __repr__ method returns a string in the format:: + * ClassName(attr=name, attr=name, ...) + * The attributes are determined either by a class-level attribute, + * '_kwarg_names', or by inspecting the instance __dict__. + */ + + return class _AttributeHolder extends cls { + [util.inspect.custom]() { + let type_name = this.constructor.name + let arg_strings = [] + let star_args = {} + for (let arg of this._get_args()) { + arg_strings.push(repr(arg)) + } + for (let [ name, value ] of this._get_kwargs()) { + if (/^[a-z_][a-z0-9_$]*$/i.test(name)) { + arg_strings.push(sub('%s=%r', name, value)) + } else { + star_args[name] = value + } + } + if (Object.keys(star_args).length) { + arg_strings.push(sub('**%s', repr(star_args))) + } + return sub('%s(%s)', type_name, arg_strings.join(', ')) + } + + toString() { + return this[util.inspect.custom]() + } + + _get_kwargs() { + return Object.entries(this) + } + + _get_args() { + return [] + } + } +} + + +function _copy_items(items) { + if (items === undefined) { + return [] + } + return items.slice(0) +} + + +// =============== +// Formatting Help +// =============== +const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter { + /* + * Formatter for generating usage messages and argument help strings. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + constructor() { + let [ + prog, + indent_increment, + max_help_position, + width + ] = _parse_opts(arguments, { + prog: no_default, + indent_increment: 2, + max_help_position: 24, + width: undefined + }) + + // default setting for width + if (width === undefined) { + width = get_terminal_size().columns + width -= 2 + } + + this._prog = prog + this._indent_increment = indent_increment + this._max_help_position = Math.min(max_help_position, + Math.max(width - 20, indent_increment * 2)) + this._width = width + + this._current_indent = 0 + this._level = 0 + this._action_max_length = 0 + + this._root_section = this._Section(this, undefined) + this._current_section = this._root_section + + this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag + this._long_break_matcher = /\n\n\n+/g + } + + // =============================== + // Section and indentation methods + // =============================== + _indent() { + this._current_indent += this._indent_increment + this._level += 1 + } + + _dedent() { + this._current_indent -= this._indent_increment + assert(this._current_indent >= 0, 'Indent decreased below 0.') + this._level -= 1 + } + + _add_item(func, args) { + this._current_section.items.push([ func, args ]) + } + + // ======================== + // Message building methods + // ======================== + start_section(heading) { + this._indent() + let section = this._Section(this, this._current_section, heading) + this._add_item(section.format_help.bind(section), []) + this._current_section = section + } + + end_section() { + this._current_section = this._current_section.parent + this._dedent() + } + + add_text(text) { + if (text !== SUPPRESS && text !== undefined) { + this._add_item(this._format_text.bind(this), [text]) + } + } + + add_usage(usage, actions, groups, prefix = undefined) { + if (usage !== SUPPRESS) { + let args = [ usage, actions, groups, prefix ] + this._add_item(this._format_usage.bind(this), args) + } + } + + add_argument(action) { + if (action.help !== SUPPRESS) { + + // find all invocations + let invocations = [this._format_action_invocation(action)] + for (let subaction of this._iter_indented_subactions(action)) { + invocations.push(this._format_action_invocation(subaction)) + } + + // update the maximum item length + let invocation_length = Math.max(...invocations.map(invocation => invocation.length)) + let action_length = invocation_length + this._current_indent + this._action_max_length = Math.max(this._action_max_length, + action_length) + + // add the item to the list + this._add_item(this._format_action.bind(this), [action]) + } + } + + add_arguments(actions) { + for (let action of actions) { + this.add_argument(action) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_help() { + let help = this._root_section.format_help() + if (help) { + help = help.replace(this._long_break_matcher, '\n\n') + help = help.replace(/^\n+|\n+$/g, '') + '\n' + } + return help + } + + _join_parts(part_strings) { + return part_strings.filter(part => part && part !== SUPPRESS).join('') + } + + _format_usage(usage, actions, groups, prefix) { + if (prefix === undefined) { + prefix = 'usage: ' + } + + // if usage is specified, use that + if (usage !== undefined) { + usage = sub(usage, { prog: this._prog }) + + // if no optionals or positionals are available, usage is just prog + } else if (usage === undefined && !actions.length) { + usage = sub('%(prog)s', { prog: this._prog }) + + // if optionals and positionals are available, calculate usage + } else if (usage === undefined) { + let prog = sub('%(prog)s', { prog: this._prog }) + + // split optionals from positionals + let optionals = [] + let positionals = [] + for (let action of actions) { + if (action.option_strings.length) { + optionals.push(action) + } else { + positionals.push(action) + } + } + + // build full usage string + let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups) + usage = [ prog, action_usage ].map(String).join(' ') + + // wrap the usage parts if it's too long + let text_width = this._width - this._current_indent + if (prefix.length + usage.length > text_width) { + + // break usage into wrappable parts + let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g + let opt_usage = this._format_actions_usage(optionals, groups) + let pos_usage = this._format_actions_usage(positionals, groups) + let opt_parts = opt_usage.match(part_regexp) || [] + let pos_parts = pos_usage.match(part_regexp) || [] + assert(opt_parts.join(' ') === opt_usage) + assert(pos_parts.join(' ') === pos_usage) + + // helper for wrapping lines + let get_lines = (parts, indent, prefix = undefined) => { + let lines = [] + let line = [] + let line_len + if (prefix !== undefined) { + line_len = prefix.length - 1 + } else { + line_len = indent.length - 1 + } + for (let part of parts) { + if (line_len + 1 + part.length > text_width && line) { + lines.push(indent + line.join(' ')) + line = [] + line_len = indent.length - 1 + } + line.push(part) + line_len += part.length + 1 + } + if (line.length) { + lines.push(indent + line.join(' ')) + } + if (prefix !== undefined) { + lines[0] = lines[0].slice(indent.length) + } + return lines + } + + let lines + + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * text_width) { + let indent = ' '.repeat(prefix.length + prog.length + 1) + if (opt_parts.length) { + lines = get_lines([prog].concat(opt_parts), indent, prefix) + lines = lines.concat(get_lines(pos_parts, indent)) + } else if (pos_parts.length) { + lines = get_lines([prog].concat(pos_parts), indent, prefix) + } else { + lines = [prog] + } + + // if prog is long, put it on its own line + } else { + let indent = ' '.repeat(prefix.length) + let parts = [].concat(opt_parts).concat(pos_parts) + lines = get_lines(parts, indent) + if (lines.length > 1) { + lines = [] + lines = lines.concat(get_lines(opt_parts, indent)) + lines = lines.concat(get_lines(pos_parts, indent)) + } + lines = [prog].concat(lines) + } + + // join lines into usage + usage = lines.join('\n') + } + } + + // prefix with 'usage:' + return sub('%s%s\n\n', prefix, usage) + } + + _format_actions_usage(actions, groups) { + // find group indices and identify actions in groups + let group_actions = new Set() + let inserts = {} + for (let group of groups) { + let start = actions.indexOf(group._group_actions[0]) + if (start === -1) { + continue + } else { + let end = start + group._group_actions.length + if (_array_equal(actions.slice(start, end), group._group_actions)) { + for (let action of group._group_actions) { + group_actions.add(action) + } + if (!group.required) { + if (start in inserts) { + inserts[start] += ' [' + } else { + inserts[start] = '[' + } + if (end in inserts) { + inserts[end] += ']' + } else { + inserts[end] = ']' + } + } else { + if (start in inserts) { + inserts[start] += ' (' + } else { + inserts[start] = '(' + } + if (end in inserts) { + inserts[end] += ')' + } else { + inserts[end] = ')' + } + } + for (let i of range(start + 1, end)) { + inserts[i] = '|' + } + } + } + } + + // collect all actions format strings + let parts = [] + for (let [ i, action ] of Object.entries(actions)) { + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === SUPPRESS) { + parts.push(undefined) + if (inserts[+i] === '|') { + delete inserts[+i] + } else if (inserts[+i + 1] === '|') { + delete inserts[+i + 1] + } + + // produce all arg strings + } else if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let part = this._format_args(action, default_value) + + // if it's in a group, strip the outer [] + if (group_actions.has(action)) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1) + } + } + + // add the action string to the list + parts.push(part) + + // produce the first way to invoke the option in brackets + } else { + let option_string = action.option_strings[0] + let part + + // if the Optional doesn't take a value, format is: + // -s or --long + if (action.nargs === 0) { + part = action.format_usage() + + // if the Optional takes a value, format is: + // -s ARGS or --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + part = sub('%s %s', option_string, args_string) + } + + // make it look optional if it's not required or in a group + if (!action.required && !group_actions.has(action)) { + part = sub('[%s]', part) + } + + // add the action string to the list + parts.push(part) + } + } + + // insert things at the necessary indices + for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) { + parts.splice(+i, 0, inserts[+i]) + } + + // join all the action items with spaces + let text = parts.filter(Boolean).join(' ') + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1') + text = text.replace(/ ([\])])/g, '$1') + text = text.replace(/[\[(] *[\])]/g, '') + text = text.replace(/\(([^|]*)\)/g, '$1', text) + text = text.trim() + + // return the text + return text + } + + _format_text(text) { + if (text.includes('%(prog)')) { + text = sub(text, { prog: this._prog }) + } + let text_width = Math.max(this._width - this._current_indent, 11) + let indent = ' '.repeat(this._current_indent) + return this._fill_text(text, text_width, indent) + '\n\n' + } + + _format_action(action) { + // determine the required width and the entry label + let help_position = Math.min(this._action_max_length + 2, + this._max_help_position) + let help_width = Math.max(this._width - help_position, 11) + let action_width = help_position - this._current_indent - 2 + let action_header = this._format_action_invocation(action) + let indent_first + + // no help; start on same line and add a final newline + if (!action.help) { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + + // short action name; start on the same line and pad two spaces + } else if (action_header.length <= action_width) { + let tup = [ this._current_indent, '', action_width, action_header ] + action_header = sub('%*s%-*s ', ...tup) + indent_first = 0 + + // long action name; start on the next line + } else { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + indent_first = help_position + } + + // collect the pieces of the action help + let parts = [action_header] + + // if there was help for the action, add lines of help text + if (action.help) { + let help_text = this._expand_help(action) + let help_lines = this._split_lines(help_text, help_width) + parts.push(sub('%*s%s\n', indent_first, '', help_lines[0])) + for (let line of help_lines.slice(1)) { + parts.push(sub('%*s%s\n', help_position, '', line)) + } + + // or add a newline if the description doesn't end with one + } else if (!action_header.endsWith('\n')) { + parts.push('\n') + } + + // if there are any sub-actions, add their help as well + for (let subaction of this._iter_indented_subactions(action)) { + parts.push(this._format_action(subaction)) + } + + // return a single string + return this._join_parts(parts) + } + + _format_action_invocation(action) { + if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let metavar = this._metavar_formatter(action, default_value)(1)[0] + return metavar + + } else { + let parts = [] + + // if the Optional doesn't take a value, format is: + // -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.option_strings) + + // if the Optional takes a value, format is: + // -s ARGS, --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + for (let option_string of action.option_strings) { + parts.push(sub('%s %s', option_string, args_string)) + } + } + + return parts.join(', ') + } + } + + _metavar_formatter(action, default_metavar) { + let result + if (action.metavar !== undefined) { + result = action.metavar + } else if (action.choices !== undefined) { + let choice_strs = _choices_to_array(action.choices).map(String) + result = sub('{%s}', choice_strs.join(',')) + } else { + result = default_metavar + } + + function format(tuple_size) { + if (Array.isArray(result)) { + return result + } else { + return Array(tuple_size).fill(result) + } + } + return format + } + + _format_args(action, default_metavar) { + let get_metavar = this._metavar_formatter(action, default_metavar) + let result + if (action.nargs === undefined) { + result = sub('%s', ...get_metavar(1)) + } else if (action.nargs === OPTIONAL) { + result = sub('[%s]', ...get_metavar(1)) + } else if (action.nargs === ZERO_OR_MORE) { + let metavar = get_metavar(1) + if (metavar.length === 2) { + result = sub('[%s [%s ...]]', ...metavar) + } else { + result = sub('[%s ...]', ...metavar) + } + } else if (action.nargs === ONE_OR_MORE) { + result = sub('%s [%s ...]', ...get_metavar(2)) + } else if (action.nargs === REMAINDER) { + result = '...' + } else if (action.nargs === PARSER) { + result = sub('%s ...', ...get_metavar(1)) + } else if (action.nargs === SUPPRESS) { + result = '' + } else { + let formats + try { + formats = range(action.nargs).map(() => '%s') + } catch (err) { + throw new TypeError('invalid nargs value') + } + result = sub(formats.join(' '), ...get_metavar(action.nargs)) + } + return result + } + + _expand_help(action) { + let params = Object.assign({ prog: this._prog }, action) + for (let name of Object.keys(params)) { + if (params[name] === SUPPRESS) { + delete params[name] + } + } + for (let name of Object.keys(params)) { + if (params[name] && params[name].name) { + params[name] = params[name].name + } + } + if (params.choices !== undefined) { + let choices_str = _choices_to_array(params.choices).map(String).join(', ') + params.choices = choices_str + } + // LEGACY (v1 compatibility): camelcase + for (let key of Object.keys(params)) { + let old_name = _to_legacy_name(key) + if (old_name !== key) { + params[old_name] = params[key] + } + } + // end + return sub(this._get_help_string(action), params) + } + + * _iter_indented_subactions(action) { + if (typeof action._get_subactions === 'function') { + this._indent() + yield* action._get_subactions() + this._dedent() + } + } + + _split_lines(text, width) { + text = text.replace(this._whitespace_matcher, ' ').trim() + // The textwrap module is used only for formatting help. + // Delay its import for speeding up the common usage of argparse. + let textwrap = require('./lib/textwrap') + return textwrap.wrap(text, { width }) + } + + _fill_text(text, width, indent) { + text = text.replace(this._whitespace_matcher, ' ').trim() + let textwrap = require('./lib/textwrap') + return textwrap.fill(text, { width, + initial_indent: indent, + subsequent_indent: indent }) + } + + _get_help_string(action) { + return action.help + } + + _get_default_metavar_for_optional(action) { + return action.dest.toUpperCase() + } + + _get_default_metavar_for_positional(action) { + return action.dest + } +})) + +HelpFormatter.prototype._Section = _callable(class _Section { + + constructor(formatter, parent, heading = undefined) { + this.formatter = formatter + this.parent = parent + this.heading = heading + this.items = [] + } + + format_help() { + // format the indented section + if (this.parent !== undefined) { + this.formatter._indent() + } + let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args))) + if (this.parent !== undefined) { + this.formatter._dedent() + } + + // return nothing if the section was empty + if (!item_help) { + return '' + } + + // add the heading if the section was non-empty + let heading + if (this.heading !== SUPPRESS && this.heading !== undefined) { + let current_indent = this.formatter._current_indent + heading = sub('%*s%s:\n', current_indent, '', this.heading) + } else { + heading = '' + } + + // join the section-initial newline, the heading and the help + return this.formatter._join_parts(['\n', heading, item_help, '\n']) + } +}) + + +const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter { + /* + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _fill_text(text, width, indent) { + return splitlines(text, true).map(line => indent + line).join('') + } +})) + + +const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter { + /* + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _split_lines(text/*, width*/) { + return splitlines(text) + } +})) + + +const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter { + /* + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_help_string(action) { + let help = action.help + // LEGACY (v1 compatibility): additional check for defaultValue needed + if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) { + if (action.default !== SUPPRESS) { + let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] + if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) { + help += ' (default: %(default)s)' + } + } + } + return help + } +})) + + +const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter { + /* + * Help message formatter which uses the argument 'type' as the default + * metavar value (instead of the argument 'dest') + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_default_metavar_for_optional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } + + _get_default_metavar_for_positional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } +})) + + +// ===================== +// Options and Arguments +// ===================== +function _get_action_name(argument) { + if (argument === undefined) { + return undefined + } else if (argument.option_strings.length) { + return argument.option_strings.join('/') + } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) { + return argument.metavar + } else if (![ undefined, SUPPRESS ].includes(argument.dest)) { + return argument.dest + } else { + return undefined + } +} + + +const ArgumentError = _callable(class ArgumentError extends Error { + /* + * An error from creating or using an argument (optional or positional). + * + * The string value of this exception is the message, augmented with + * information about the argument that caused it. + */ + + constructor(argument, message) { + super() + this.name = 'ArgumentError' + this._argument_name = _get_action_name(argument) + this._message = message + this.message = this.str() + } + + str() { + let format + if (this._argument_name === undefined) { + format = '%(message)s' + } else { + format = 'argument %(argument_name)s: %(message)s' + } + return sub(format, { message: this._message, + argument_name: this._argument_name }) + } +}) + + +const ArgumentTypeError = _callable(class ArgumentTypeError extends Error { + /* + * An error from trying to convert a command line string to a type. + */ + + constructor(message) { + super(message) + this.name = 'ArgumentTypeError' + } +}) + + +// ============== +// Action classes +// ============== +const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) { + /* + * Information about how to convert command line strings to Python objects. + * + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the + * command line. The keyword arguments to the Action constructor are also + * all attributes of Action instances. + * + * Keyword Arguments: + * + * - option_strings -- A list of command-line option strings which + * should be associated with this action. + * + * - dest -- The name of the attribute to hold the created object(s) + * + * - nargs -- The number of command-line arguments that should be + * consumed. By default, one argument will be consumed and a single + * value will be produced. Other values include: + * - N (an integer) consumes N arguments (and produces a list) + * - '?' consumes zero or one arguments + * - '*' consumes zero or more arguments (and produces a list) + * - '+' consumes one or more arguments (and produces a list) + * Note that the difference between the default and nargs=1 is that + * with the default, a single value will be produced, while with + * nargs=1, a list containing a single value will be produced. + * + * - const -- The value to be produced if the option is specified and the + * option uses an action that takes no values. + * + * - default -- The value to be produced if the option is not specified. + * + * - type -- A callable that accepts a single string argument, and + * returns the converted value. The standard Python types str, int, + * float, and complex are useful examples of such callables. If None, + * str is used. + * + * - choices -- A container of values that should be allowed. If not None, + * after a command-line argument has been converted to the appropriate + * type, an exception will be raised if it is not a member of this + * collection. + * + * - required -- True if the action must always be specified at the + * command line. This is only meaningful for optional command-line + * arguments. + * + * - help -- The help string describing the argument. + * + * - metavar -- The name to be used for the option's argument with the + * help string. If None, the 'dest' value will be used as the name. + */ + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + this.option_strings = option_strings + this.dest = dest + this.nargs = nargs + this.const = const_value + this.default = default_value + this.type = type + this.choices = choices + this.required = required + this.help = help + this.metavar = metavar + } + + _get_kwargs() { + let names = [ + 'option_strings', + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + format_usage() { + return this.option_strings[0] + } + + call(/*parser, namespace, values, option_string = undefined*/) { + throw new Error('.call() not defined') + } +})) + + +const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + let _option_strings = [] + for (let option_string of option_strings) { + _option_strings.push(option_string) + + if (option_string.startsWith('--')) { + option_string = '--no-' + option_string.slice(2) + _option_strings.push(option_string) + } + } + + if (help !== undefined && default_value !== undefined) { + help += ` (default: ${default_value})` + } + + super({ + option_strings: _option_strings, + dest, + nargs: 0, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values, option_string = undefined) { + if (this.option_strings.includes(option_string)) { + setattr(namespace, this.dest, !option_string.startsWith('--no-')) + } + } + + format_usage() { + return this.option_strings.join(' | ') + } +})) + + +const _StoreAction = _callable(class _StoreAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for store actions must be != 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + setattr(namespace, this.dest, values) + } +}) + + +const _StoreConstAction = _callable(class _StoreConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help + //, metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + setattr(namespace, this.dest, this.const) + } +}) + + +const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: false, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: true, + default: default_value, + required, + help + }) + } +}) + + +const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: true, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: false, + default: default_value, + required, + help + }) + } +}) + + +const _AppendAction = _callable(class _AppendAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for append actions must be != 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(values) + setattr(namespace, this.dest, items) + } +}) + + +const _AppendConstAction = _callable(class _AppendConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help, + metavar + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(this.const) + setattr(namespace, this.dest, items) + } +}) + + +const _CountAction = _callable(class _CountAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let count = getattr(namespace, this.dest, undefined) + if (count === undefined) { + count = 0 + } + setattr(namespace, this.dest, count + 1) + } +}) + + +const _HelpAction = _callable(class _HelpAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: SUPPRESS, + default: SUPPRESS, + help: undefined + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + } + + call(parser/*, namespace, values, option_string = undefined*/) { + parser.print_help() + parser.exit() + } +}) + + +const _VersionAction = _callable(class _VersionAction extends Action { + + constructor() { + let [ + option_strings, + version, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + version: undefined, + dest: SUPPRESS, + default: SUPPRESS, + help: "show program's version number and exit" + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + this.version = version + } + + call(parser/*, namespace, values, option_string = undefined*/) { + let version = this.version + if (version === undefined) { + version = parser.version + } + let formatter = parser._get_formatter() + formatter.add_text(version) + parser._print_message(formatter.format_help(), process.stdout) + parser.exit() + } +}) + + +const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action { + + constructor() { + let [ + option_strings, + prog, + parser_class, + dest, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + prog: no_default, + parser_class: no_default, + dest: SUPPRESS, + required: false, + help: undefined, + metavar: undefined + }) + + let name_parser_map = {} + + super({ + option_strings, + dest, + nargs: PARSER, + choices: name_parser_map, + required, + help, + metavar + }) + + this._prog_prefix = prog + this._parser_class = parser_class + this._name_parser_map = name_parser_map + this._choices_actions = [] + } + + add_parser() { + let [ + name, + kwargs + ] = _parse_opts(arguments, { + name: no_default, + '**kwargs': no_default + }) + + // set prog from the existing prefix + if (kwargs.prog === undefined) { + kwargs.prog = sub('%s %s', this._prog_prefix, name) + } + + let aliases = getattr(kwargs, 'aliases', []) + delete kwargs.aliases + + // create a pseudo-action to hold the choice help + if ('help' in kwargs) { + let help = kwargs.help + delete kwargs.help + let choice_action = this._ChoicesPseudoAction(name, aliases, help) + this._choices_actions.push(choice_action) + } + + // create the parser and add it to the map + let parser = new this._parser_class(kwargs) + this._name_parser_map[name] = parser + + // make parser available under aliases also + for (let alias of aliases) { + this._name_parser_map[alias] = parser + } + + return parser + } + + _get_subactions() { + return this._choices_actions + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let parser_name = values[0] + let arg_strings = values.slice(1) + + // set the parser name if requested + if (this.dest !== SUPPRESS) { + setattr(namespace, this.dest, parser_name) + } + + // select the parser + if (hasattr(this._name_parser_map, parser_name)) { + parser = this._name_parser_map[parser_name] + } else { + let args = {parser_name, + choices: this._name_parser_map.join(', ')} + let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args) + throw new ArgumentError(this, msg) + } + + // parse all the remaining options into the namespace + // store any unrecognized options on the object, so that the top + // level parser can decide what to do with them + + // In case this subparser defines new defaults, we parse them + // in a new namespace object and then update the original + // namespace for the relevant parts. + let subnamespace + [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined) + for (let [ key, value ] of Object.entries(subnamespace)) { + setattr(namespace, key, value) + } + + if (arg_strings.length) { + setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, []) + getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings) + } + } +})) + + +_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action { + constructor(name, aliases, help) { + let metavar = name, dest = name + if (aliases.length) { + metavar += sub(' (%s)', aliases.join(', ')) + } + super({ option_strings: [], dest, help, metavar }) + } +}) + + +const _ExtendAction = _callable(class _ExtendAction extends _AppendAction { + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items = items.concat(values) + setattr(namespace, this.dest, items) + } +}) + + +// ============== +// Type classes +// ============== +const FileType = _callable(class FileType extends Function { + /* + * Factory for creating file object types + * + * Instances of FileType are typically passed as type= arguments to the + * ArgumentParser add_argument() method. + * + * Keyword Arguments: + * - mode -- A string indicating how the file is to be opened. Accepts the + * same values as the builtin open() function. + * - bufsize -- The file's desired buffer size. Accepts the same values as + * the builtin open() function. + * - encoding -- The file's encoding. Accepts the same values as the + * builtin open() function. + * - errors -- A string indicating how encoding and decoding errors are to + * be handled. Accepts the same value as the builtin open() function. + */ + + constructor() { + let [ + flags, + encoding, + mode, + autoClose, + emitClose, + start, + end, + highWaterMark, + fs + ] = _parse_opts(arguments, { + flags: 'r', + encoding: undefined, + mode: undefined, // 0o666 + autoClose: undefined, // true + emitClose: undefined, // false + start: undefined, // 0 + end: undefined, // Infinity + highWaterMark: undefined, // 64 * 1024 + fs: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + Object.defineProperty(this, 'name', { + get() { + return sub('FileType(%r)', flags) + } + }) + this._flags = flags + this._options = {} + if (encoding !== undefined) this._options.encoding = encoding + if (mode !== undefined) this._options.mode = mode + if (autoClose !== undefined) this._options.autoClose = autoClose + if (emitClose !== undefined) this._options.emitClose = emitClose + if (start !== undefined) this._options.start = start + if (end !== undefined) this._options.end = end + if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark + if (fs !== undefined) this._options.fs = fs + } + + call(string) { + // the special argument "-" means sys.std{in,out} + if (string === '-') { + if (this._flags.includes('r')) { + return process.stdin + } else if (this._flags.includes('w')) { + return process.stdout + } else { + let msg = sub('argument "-" with mode %r', this._flags) + throw new TypeError(msg) + } + } + + // all other arguments are used as file names + let fd + try { + fd = fs.openSync(string, this._flags, this._options.mode) + } catch (e) { + let args = { filename: string, error: e.message } + let message = "can't open '%(filename)s': %(error)s" + throw new ArgumentTypeError(sub(message, args)) + } + + let options = Object.assign({ fd, flags: this._flags }, this._options) + if (this._flags.includes('r')) { + return fs.createReadStream(undefined, options) + } else if (this._flags.includes('w')) { + return fs.createWriteStream(undefined, options) + } else { + let msg = sub('argument "%s" with mode %r', string, this._flags) + throw new TypeError(msg) + } + } + + [util.inspect.custom]() { + let args = [ this._flags ] + let kwargs = Object.entries(this._options).map(([ k, v ]) => { + if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } } + return [ k, v ] + }) + let args_str = [] + .concat(args.filter(arg => arg !== -1).map(repr)) + .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined) + .map(([kw, arg]) => sub('%s=%r', kw, arg))) + .join(', ') + return sub('%s(%s)', this.constructor.name, args_str) + } + + toString() { + return this[util.inspect.custom]() + } +}) + +// =========================== +// Optional and Positional Parsing +// =========================== +const Namespace = _callable(class Namespace extends _AttributeHolder() { + /* + * Simple object for storing attributes. + * + * Implements equality by attribute names and values, and provides a simple + * string representation. + */ + + constructor(options = {}) { + super() + Object.assign(this, options) + } +}) + +// unset string tag to mimic plain object +Namespace.prototype[Symbol.toStringTag] = undefined + + +const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer { + + constructor() { + let [ + description, + prefix_chars, + argument_default, + conflict_handler + ] = _parse_opts(arguments, { + description: no_default, + prefix_chars: no_default, + argument_default: no_default, + conflict_handler: no_default + }) + + this.description = description + this.argument_default = argument_default + this.prefix_chars = prefix_chars + this.conflict_handler = conflict_handler + + // set up registries + this._registries = {} + + // register actions + this.register('action', undefined, _StoreAction) + this.register('action', 'store', _StoreAction) + this.register('action', 'store_const', _StoreConstAction) + this.register('action', 'store_true', _StoreTrueAction) + this.register('action', 'store_false', _StoreFalseAction) + this.register('action', 'append', _AppendAction) + this.register('action', 'append_const', _AppendConstAction) + this.register('action', 'count', _CountAction) + this.register('action', 'help', _HelpAction) + this.register('action', 'version', _VersionAction) + this.register('action', 'parsers', _SubParsersAction) + this.register('action', 'extend', _ExtendAction) + // LEGACY (v1 compatibility): camelcase variants + ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => { + let new_name = _to_new_name(old_name) + this.register('action', old_name, util.deprecate(this._registry_get('action', new_name), + sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name))) + }) + // end + + // raise an exception if the conflict handler is invalid + this._get_handler() + + // action storage + this._actions = [] + this._option_string_actions = {} + + // groups + this._action_groups = [] + this._mutually_exclusive_groups = [] + + // defaults storage + this._defaults = {} + + // determines whether an "option" looks like a negative number + this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/ + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._has_negative_number_optionals = [] + } + + // ==================== + // Registration methods + // ==================== + register(registry_name, value, object) { + let registry = setdefault(this._registries, registry_name, {}) + registry[value] = object + } + + _registry_get(registry_name, value, default_value = undefined) { + return getattr(this._registries[registry_name], value, default_value) + } + + // ================================== + // Namespace default accessor methods + // ================================== + set_defaults(kwargs) { + Object.assign(this._defaults, kwargs) + + // if these defaults match any existing arguments, replace + // the previous default on the object with the new one + for (let action of this._actions) { + if (action.dest in kwargs) { + action.default = kwargs[action.dest] + } + } + } + + get_default(dest) { + for (let action of this._actions) { + if (action.dest === dest && action.default !== undefined) { + return action.default + } + } + return this._defaults[dest] + } + + + // ======================= + // Adding argument actions + // ======================= + add_argument() { + /* + * add_argument(dest, ..., name=value, ...) + * add_argument(option_string, option_string, ..., name=value, ...) + */ + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + // LEGACY (v1 compatibility), old-style add_argument([ args ], { options }) + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + deprecate('argument-array', + sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', { + args: args.map(repr).join(', ') + })) + } + // end + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional + // argument + let chars = this.prefix_chars + if (!args.length || args.length === 1 && !chars.includes(args[0][0])) { + if (args.length && 'dest' in kwargs) { + throw new TypeError('dest supplied twice for positional argument') + } + kwargs = this._get_positional_kwargs(...args, kwargs) + + // otherwise, we're adding an optional argument + } else { + kwargs = this._get_optional_kwargs(...args, kwargs) + } + + // if no default was supplied, use the parser-level default + if (!('default' in kwargs)) { + let dest = kwargs.dest + if (dest in this._defaults) { + kwargs.default = this._defaults[dest] + } else if (this.argument_default !== undefined) { + kwargs.default = this.argument_default + } + } + + // create the action object, and add it to the parser + let action_class = this._pop_action_class(kwargs) + if (typeof action_class !== 'function') { + throw new TypeError(sub('unknown action "%s"', action_class)) + } + // eslint-disable-next-line new-cap + let action = new action_class(kwargs) + + // raise an error if the action type is not callable + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + throw new TypeError(sub('%r is not callable', type_func)) + } + + if (type_func === FileType) { + throw new TypeError(sub('%r is a FileType class object, instance of it' + + ' must be passed', type_func)) + } + + // raise an error if the metavar does not match the type + if ('_get_formatter' in this) { + try { + this._get_formatter()._format_args(action, undefined) + } catch (err) { + // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same + if (err instanceof TypeError && err.message !== 'invalid nargs value') { + throw new TypeError('length of metavar tuple does not match nargs') + } else { + throw err + } + } + } + + return this._add_action(action) + } + + add_argument_group() { + let group = _ArgumentGroup(this, ...arguments) + this._action_groups.push(group) + return group + } + + add_mutually_exclusive_group() { + // eslint-disable-next-line no-use-before-define + let group = _MutuallyExclusiveGroup(this, ...arguments) + this._mutually_exclusive_groups.push(group) + return group + } + + _add_action(action) { + // resolve any conflicts + this._check_conflict(action) + + // add to actions list + this._actions.push(action) + action.container = this + + // index the action by any option strings it has + for (let option_string of action.option_strings) { + this._option_string_actions[option_string] = action + } + + // set the flag if any option strings look like negative numbers + for (let option_string of action.option_strings) { + if (this._negative_number_matcher.test(option_string)) { + if (!this._has_negative_number_optionals.length) { + this._has_negative_number_optionals.push(true) + } + } + } + + // return the created action + return action + } + + _remove_action(action) { + _array_remove(this._actions, action) + } + + _add_container_actions(container) { + // collect groups by titles + let title_group_map = {} + for (let group of this._action_groups) { + if (group.title in title_group_map) { + let msg = 'cannot merge actions - two groups are named %r' + throw new TypeError(sub(msg, group.title)) + } + title_group_map[group.title] = group + } + + // map each action to its group + let group_map = new Map() + for (let group of container._action_groups) { + + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!(group.title in title_group_map)) { + title_group_map[group.title] = this.add_argument_group({ + title: group.title, + description: group.description, + conflict_handler: group.conflict_handler + }) + } + + // map the actions to their new group + for (let action of group._group_actions) { + group_map.set(action, title_group_map[group.title]) + } + } + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + for (let group of container._mutually_exclusive_groups) { + let mutex_group = this.add_mutually_exclusive_group({ + required: group.required + }) + + // map the actions to their new mutex group + for (let action of group._group_actions) { + group_map.set(action, mutex_group) + } + } + + // add all actions to this container or their group + for (let action of container._actions) { + group_map.get(action)._add_action(action) + } + } + + _get_positional_kwargs() { + let [ + dest, + kwargs + ] = _parse_opts(arguments, { + dest: no_default, + '**kwargs': no_default + }) + + // make sure required is not specified + if ('required' in kwargs) { + let msg = "'required' is an invalid argument for positionals" + throw new TypeError(msg) + } + + // mark positional arguments as required if at least one is + // always required + if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) { + kwargs.required = true + } + if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) { + kwargs.required = true + } + + // return the keyword arguments with no option strings + return Object.assign(kwargs, { dest, option_strings: [] }) + } + + _get_optional_kwargs() { + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + + // determine short and long option strings + let option_strings = [] + let long_option_strings = [] + let option_string + for (option_string of args) { + // error on strings that don't start with an appropriate prefix + if (!this.prefix_chars.includes(option_string[0])) { + let args = {option: option_string, + prefix_chars: this.prefix_chars} + let msg = 'invalid option string %(option)r: ' + + 'must start with a character %(prefix_chars)r' + throw new TypeError(sub(msg, args)) + } + + // strings starting with two prefix characters are long options + option_strings.push(option_string) + if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) { + long_option_strings.push(option_string) + } + } + + // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + let dest = kwargs.dest + delete kwargs.dest + if (dest === undefined) { + let dest_option_string + if (long_option_strings.length) { + dest_option_string = long_option_strings[0] + } else { + dest_option_string = option_strings[0] + } + dest = _string_lstrip(dest_option_string, this.prefix_chars) + if (!dest) { + let msg = 'dest= is required for options like %r' + throw new TypeError(sub(msg, option_string)) + } + dest = dest.replace(/-/g, '_') + } + + // return the updated keyword arguments + return Object.assign(kwargs, { dest, option_strings }) + } + + _pop_action_class(kwargs, default_value = undefined) { + let action = getattr(kwargs, 'action', default_value) + delete kwargs.action + return this._registry_get('action', action, action) + } + + _get_handler() { + // determine function from conflict handler string + let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler) + if (typeof this[handler_func_name] === 'function') { + return this[handler_func_name] + } else { + let msg = 'invalid conflict_resolution value: %r' + throw new TypeError(sub(msg, this.conflict_handler)) + } + } + + _check_conflict(action) { + + // find all options that conflict with this option + let confl_optionals = [] + for (let option_string of action.option_strings) { + if (hasattr(this._option_string_actions, option_string)) { + let confl_optional = this._option_string_actions[option_string] + confl_optionals.push([ option_string, confl_optional ]) + } + } + + // resolve any conflicts + if (confl_optionals.length) { + let conflict_handler = this._get_handler() + conflict_handler.call(this, action, confl_optionals) + } + } + + _handle_conflict_error(action, conflicting_actions) { + let message = conflicting_actions.length === 1 ? + 'conflicting option string: %s' : + 'conflicting option strings: %s' + let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ') + throw new ArgumentError(action, sub(message, conflict_string)) + } + + _handle_conflict_resolve(action, conflicting_actions) { + + // remove all conflicting options + for (let [ option_string, action ] of conflicting_actions) { + + // remove the conflicting option + _array_remove(action.option_strings, option_string) + delete this._option_string_actions[option_string] + + // if the option now has no option string, remove it from the + // container holding it + if (!action.option_strings.length) { + action.container._remove_action(action) + } + } + } +})) + + +const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer { + + constructor() { + let [ + container, + title, + description, + kwargs + ] = _parse_opts(arguments, { + container: no_default, + title: undefined, + description: undefined, + '**kwargs': no_default + }) + + // add any missing keyword arguments by checking the container + setdefault(kwargs, 'conflict_handler', container.conflict_handler) + setdefault(kwargs, 'prefix_chars', container.prefix_chars) + setdefault(kwargs, 'argument_default', container.argument_default) + super(Object.assign({ description }, kwargs)) + + // group attributes + this.title = title + this._group_actions = [] + + // share most attributes with the container + this._registries = container._registries + this._actions = container._actions + this._option_string_actions = container._option_string_actions + this._defaults = container._defaults + this._has_negative_number_optionals = + container._has_negative_number_optionals + this._mutually_exclusive_groups = container._mutually_exclusive_groups + } + + _add_action(action) { + action = super._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + super._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup { + + constructor() { + let [ + container, + required + ] = _parse_opts(arguments, { + container: no_default, + required: false + }) + + super(container) + this.required = required + this._container = container + } + + _add_action(action) { + if (action.required) { + let msg = 'mutually exclusive arguments must be optional' + throw new TypeError(msg) + } + action = this._container._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + this._container._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) { + /* + * Object for parsing command line strings into Python objects. + * + * Keyword Arguments: + * - prog -- The name of the program (default: sys.argv[0]) + * - usage -- A usage message (default: auto-generated from arguments) + * - description -- A description of what the program does + * - epilog -- Text following the argument descriptions + * - parents -- Parsers whose arguments should be copied into this one + * - formatter_class -- HelpFormatter class for printing help messages + * - prefix_chars -- Characters that prefix optional arguments + * - fromfile_prefix_chars -- Characters that prefix files containing + * additional arguments + * - argument_default -- The default value for all arguments + * - conflict_handler -- String indicating how to handle conflicts + * - add_help -- Add a -h/-help option + * - allow_abbrev -- Allow long options to be abbreviated unambiguously + * - exit_on_error -- Determines whether or not ArgumentParser exits with + * error info when an error occurs + */ + + constructor() { + let [ + prog, + usage, + description, + epilog, + parents, + formatter_class, + prefix_chars, + fromfile_prefix_chars, + argument_default, + conflict_handler, + add_help, + allow_abbrev, + exit_on_error, + debug, // LEGACY (v1 compatibility), debug mode + version // LEGACY (v1 compatibility), version + ] = _parse_opts(arguments, { + prog: undefined, + usage: undefined, + description: undefined, + epilog: undefined, + parents: [], + formatter_class: HelpFormatter, + prefix_chars: '-', + fromfile_prefix_chars: undefined, + argument_default: undefined, + conflict_handler: 'error', + add_help: true, + allow_abbrev: true, + exit_on_error: true, + debug: undefined, // LEGACY (v1 compatibility), debug mode + version: undefined // LEGACY (v1 compatibility), version + }) + + // LEGACY (v1 compatibility) + if (debug !== undefined) { + deprecate('debug', + 'The "debug" argument to ArgumentParser is deprecated. Please ' + + 'override ArgumentParser.exit function instead.' + ) + } + + if (version !== undefined) { + deprecate('version', + 'The "version" argument to ArgumentParser is deprecated. Please use ' + + "add_argument(..., { action: 'version', version: 'N', ... }) instead." + ) + } + // end + + super({ + description, + prefix_chars, + argument_default, + conflict_handler + }) + + // default setting for prog + if (prog === undefined) { + prog = path.basename(get_argv()[0] || '') + } + + this.prog = prog + this.usage = usage + this.epilog = epilog + this.formatter_class = formatter_class + this.fromfile_prefix_chars = fromfile_prefix_chars + this.add_help = add_help + this.allow_abbrev = allow_abbrev + this.exit_on_error = exit_on_error + // LEGACY (v1 compatibility), debug mode + this.debug = debug + // end + + this._positionals = this.add_argument_group('positional arguments') + this._optionals = this.add_argument_group('optional arguments') + this._subparsers = undefined + + // register types + function identity(string) { + return string + } + this.register('type', undefined, identity) + this.register('type', null, identity) + this.register('type', 'auto', identity) + this.register('type', 'int', function (x) { + let result = Number(x) + if (!Number.isInteger(result)) { + throw new TypeError(sub('could not convert string to int: %r', x)) + } + return result + }) + this.register('type', 'float', function (x) { + let result = Number(x) + if (isNaN(result)) { + throw new TypeError(sub('could not convert string to float: %r', x)) + } + return result + }) + this.register('type', 'str', String) + // LEGACY (v1 compatibility): custom types + this.register('type', 'string', + util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')) + // end + + // add help argument if necessary + // (using explicit default to override global argument_default) + let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0] + if (this.add_help) { + this.add_argument( + default_prefix + 'h', + default_prefix.repeat(2) + 'help', + { + action: 'help', + default: SUPPRESS, + help: 'show this help message and exit' + } + ) + } + // LEGACY (v1 compatibility), version + if (version) { + this.add_argument( + default_prefix + 'v', + default_prefix.repeat(2) + 'version', + { + action: 'version', + default: SUPPRESS, + version: this.version, + help: "show program's version number and exit" + } + ) + } + // end + + // add parent arguments and defaults + for (let parent of parents) { + this._add_container_actions(parent) + Object.assign(this._defaults, parent._defaults) + } + } + + // ======================= + // Pretty __repr__ methods + // ======================= + _get_kwargs() { + let names = [ + 'prog', + 'usage', + 'description', + 'formatter_class', + 'conflict_handler', + 'add_help' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + // ================================== + // Optional/Positional adding methods + // ================================== + add_subparsers() { + let [ + kwargs + ] = _parse_opts(arguments, { + '**kwargs': no_default + }) + + if (this._subparsers !== undefined) { + this.error('cannot have multiple subparser arguments') + } + + // add the parser class to the arguments if it's not present + setdefault(kwargs, 'parser_class', this.constructor) + + if ('title' in kwargs || 'description' in kwargs) { + let title = getattr(kwargs, 'title', 'subcommands') + let description = getattr(kwargs, 'description', undefined) + delete kwargs.title + delete kwargs.description + this._subparsers = this.add_argument_group(title, description) + } else { + this._subparsers = this._positionals + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (kwargs.prog === undefined) { + let formatter = this._get_formatter() + let positionals = this._get_positional_actions() + let groups = this._mutually_exclusive_groups + formatter.add_usage(this.usage, positionals, groups, '') + kwargs.prog = formatter.format_help().trim() + } + + // create the parsers action and add it to the positionals list + let parsers_class = this._pop_action_class(kwargs, 'parsers') + // eslint-disable-next-line new-cap + let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs)) + this._subparsers._add_action(action) + + // return the created parsers action + return action + } + + _add_action(action) { + if (action.option_strings.length) { + this._optionals._add_action(action) + } else { + this._positionals._add_action(action) + } + return action + } + + _get_optional_actions() { + return this._actions.filter(action => action.option_strings.length) + } + + _get_positional_actions() { + return this._actions.filter(action => !action.option_strings.length) + } + + // ===================================== + // Command line argument parsing methods + // ===================================== + parse_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_args(args, namespace) + if (argv && argv.length > 0) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_args(args = undefined, namespace = undefined) { + if (args === undefined) { + args = get_argv().slice(1) + } + + // default Namespace built from parser defaults + if (namespace === undefined) { + namespace = new Namespace() + } + + // add any action defaults that aren't present + for (let action of this._actions) { + if (action.dest !== SUPPRESS) { + if (!hasattr(namespace, action.dest)) { + if (action.default !== SUPPRESS) { + setattr(namespace, action.dest, action.default) + } + } + } + } + + // add any parser defaults that aren't present + for (let dest of Object.keys(this._defaults)) { + if (!hasattr(namespace, dest)) { + setattr(namespace, dest, this._defaults[dest]) + } + } + + // parse the arguments and exit if there are any errors + if (this.exit_on_error) { + try { + [ namespace, args ] = this._parse_known_args(args, namespace) + } catch (err) { + if (err instanceof ArgumentError) { + this.error(err.message) + } else { + throw err + } + } + } else { + [ namespace, args ] = this._parse_known_args(args, namespace) + } + + if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) { + args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) + delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) + } + + return [ namespace, args ] + } + + _parse_known_args(arg_strings, namespace) { + // replace arg strings that are file references + if (this.fromfile_prefix_chars !== undefined) { + arg_strings = this._read_args_from_files(arg_strings) + } + + // map all mutually exclusive arguments to the other arguments + // they can't occur with + let action_conflicts = new Map() + for (let mutex_group of this._mutually_exclusive_groups) { + let group_actions = mutex_group._group_actions + for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) { + let conflicts = action_conflicts.get(mutex_action) || [] + conflicts = conflicts.concat(group_actions.slice(0, +i)) + conflicts = conflicts.concat(group_actions.slice(+i + 1)) + action_conflicts.set(mutex_action, conflicts) + } + } + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + let option_string_indices = {} + let arg_string_pattern_parts = [] + let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]() + for (let [ i, arg_string ] of arg_strings_iter) { + + // all args after -- are non-options + if (arg_string === '--') { + arg_string_pattern_parts.push('-') + for ([ i, arg_string ] of arg_strings_iter) { + arg_string_pattern_parts.push('A') + } + + // otherwise, add the arg to the arg strings + // and note the index if it was an option + } else { + let option_tuple = this._parse_optional(arg_string) + let pattern + if (option_tuple === undefined) { + pattern = 'A' + } else { + option_string_indices[i] = option_tuple + pattern = 'O' + } + arg_string_pattern_parts.push(pattern) + } + } + + // join the pieces together to form the pattern + let arg_strings_pattern = arg_string_pattern_parts.join('') + + // converts arg strings to the appropriate and then takes the action + let seen_actions = new Set() + let seen_non_default_actions = new Set() + let extras + + let take_action = (action, argument_strings, option_string = undefined) => { + seen_actions.add(action) + let argument_values = this._get_values(action, argument_strings) + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argument_values !== action.default) { + seen_non_default_actions.add(action) + for (let conflict_action of action_conflicts.get(action) || []) { + if (seen_non_default_actions.has(conflict_action)) { + let msg = 'not allowed with argument %s' + let action_name = _get_action_name(conflict_action) + throw new ArgumentError(action, sub(msg, action_name)) + } + } + } + + // take the action if we didn't receive a SUPPRESS value + // (e.g. from a default) + if (argument_values !== SUPPRESS) { + action(this, namespace, argument_values, option_string) + } + } + + // function to convert arg_strings into an optional action + let consume_optional = start_index => { + + // get the optional identified at this index + let option_tuple = option_string_indices[start_index] + let [ action, option_string, explicit_arg ] = option_tuple + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + let action_tuples = [] + let stop + for (;;) { + + // if we found no optional action, skip it + if (action === undefined) { + extras.push(arg_strings[start_index]) + return start_index + 1 + } + + // if there is an explicit argument, try to match the + // optional's string arguments to only this + if (explicit_arg !== undefined) { + let arg_count = this._match_argument(action, 'A') + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + let chars = this.prefix_chars + if (arg_count === 0 && !chars.includes(option_string[1])) { + action_tuples.push([ action, [], option_string ]) + let char = option_string[0] + option_string = char + explicit_arg[0] + let new_explicit_arg = explicit_arg.slice(1) || undefined + let optionals_map = this._option_string_actions + if (hasattr(optionals_map, option_string)) { + action = optionals_map[option_string] + explicit_arg = new_explicit_arg + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + } else if (arg_count === 1) { + stop = start_index + 1 + let args = [ explicit_arg ] + action_tuples.push([ action, args, option_string ]) + break + + // error if a double-dash option did not use the + // explicit argument + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + } else { + let start = start_index + 1 + let selected_patterns = arg_strings_pattern.slice(start) + let arg_count = this._match_argument(action, selected_patterns) + stop = start + arg_count + let args = arg_strings.slice(start, stop) + action_tuples.push([ action, args, option_string ]) + break + } + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + assert(action_tuples.length) + for (let [ action, args, option_string ] of action_tuples) { + take_action(action, args, option_string) + } + return stop + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + let positionals = this._get_positional_actions() + + // function to convert arg_strings into positional actions + let consume_positionals = start_index => { + // match as many Positionals as possible + let selected_pattern = arg_strings_pattern.slice(start_index) + let arg_counts = this._match_arguments_partial(positionals, selected_pattern) + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + for (let i = 0; i < positionals.length && i < arg_counts.length; i++) { + let action = positionals[i] + let arg_count = arg_counts[i] + let args = arg_strings.slice(start_index, start_index + arg_count) + start_index += arg_count + take_action(action, args) + } + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(arg_counts.length) + return start_index + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + extras = [] + let start_index = 0 + let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number)) + while (start_index <= max_option_string_index) { + + // consume any Positionals preceding the next option + let next_option_string_index = Math.min( + // eslint-disable-next-line no-loop-func + ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index) + ) + if (start_index !== next_option_string_index) { + let positionals_end_index = consume_positionals(start_index) + + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionals_end_index > start_index) { + start_index = positionals_end_index + continue + } else { + start_index = positionals_end_index + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!(start_index in option_string_indices)) { + let strings = arg_strings.slice(start_index, next_option_string_index) + extras = extras.concat(strings) + start_index = next_option_string_index + } + + // consume the next optional and any arguments for it + start_index = consume_optional(start_index) + } + + // consume any positionals following the last Optional + let stop_index = consume_positionals(start_index) + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(arg_strings.slice(stop_index)) + + // make sure all required actions were present and also convert + // action defaults which were not given as arguments + let required_actions = [] + for (let action of this._actions) { + if (!seen_actions.has(action)) { + if (action.required) { + required_actions.push(_get_action_name(action)) + } else { + // Convert action default now instead of doing it before + // parsing arguments to avoid calling convert functions + // twice (which may fail) if the argument was given, but + // only if it was defined already in the namespace + if (action.default !== undefined && + typeof action.default === 'string' && + hasattr(namespace, action.dest) && + action.default === getattr(namespace, action.dest)) { + setattr(namespace, action.dest, + this._get_value(action, action.default)) + } + } + } + } + + if (required_actions.length) { + this.error(sub('the following arguments are required: %s', + required_actions.join(', '))) + } + + // make sure all required groups had one option present + for (let group of this._mutually_exclusive_groups) { + if (group.required) { + let no_actions_used = true + for (let action of group._group_actions) { + if (seen_non_default_actions.has(action)) { + no_actions_used = false + break + } + } + + // if no actions were used, report the error + if (no_actions_used) { + let names = group._group_actions + .filter(action => action.help !== SUPPRESS) + .map(action => _get_action_name(action)) + let msg = 'one of the arguments %s is required' + this.error(sub(msg, names.join(' '))) + } + } + } + + // return the updated namespace and the extra arguments + return [ namespace, extras ] + } + + _read_args_from_files(arg_strings) { + // expand arguments referencing files + let new_arg_strings = [] + for (let arg_string of arg_strings) { + + // for regular arguments, just add them back into the list + if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) { + new_arg_strings.push(arg_string) + + // replace arguments referencing files with the file content + } else { + try { + let args_file = fs.readFileSync(arg_string.slice(1), 'utf8') + let arg_strings = [] + for (let arg_line of splitlines(args_file)) { + for (let arg of this.convert_arg_line_to_args(arg_line)) { + arg_strings.push(arg) + } + } + arg_strings = this._read_args_from_files(arg_strings) + new_arg_strings = new_arg_strings.concat(arg_strings) + } catch (err) { + this.error(err.message) + } + } + } + + // return the modified argument list + return new_arg_strings + } + + convert_arg_line_to_args(arg_line) { + return [arg_line] + } + + _match_argument(action, arg_strings_pattern) { + // match the pattern for this action to the arg strings + let nargs_pattern = this._get_nargs_pattern(action) + let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern)) + + // raise an exception if we weren't able to find a match + if (match === null) { + let nargs_errors = { + undefined: 'expected one argument', + [OPTIONAL]: 'expected at most one argument', + [ONE_OR_MORE]: 'expected at least one argument' + } + let msg = nargs_errors[action.nargs] + if (msg === undefined) { + msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs) + } + throw new ArgumentError(action, msg) + } + + // return the number of arguments matched + return match[1].length + } + + _match_arguments_partial(actions, arg_strings_pattern) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + let result = [] + for (let i of range(actions.length, 0, -1)) { + let actions_slice = actions.slice(0, i) + let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('') + let match = arg_strings_pattern.match(new RegExp('^' + pattern)) + if (match !== null) { + result = result.concat(match.slice(1).map(string => string.length)) + break + } + } + + // return the list of arg string counts + return result + } + + _parse_optional(arg_string) { + // if it's an empty string, it was meant to be a positional + if (!arg_string) { + return undefined + } + + // if it doesn't start with a prefix, it was meant to be positional + if (!this.prefix_chars.includes(arg_string[0])) { + return undefined + } + + // if the option string is present in the parser, return the action + if (arg_string in this._option_string_actions) { + let action = this._option_string_actions[arg_string] + return [ action, arg_string, undefined ] + } + + // if it's just a single character, it was meant to be positional + if (arg_string.length === 1) { + return undefined + } + + // if the option string before the "=" is present, return the action + if (arg_string.includes('=')) { + let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1) + if (option_string in this._option_string_actions) { + let action = this._option_string_actions[option_string] + return [ action, option_string, explicit_arg ] + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + let option_tuples = this._get_option_tuples(arg_string) + + // if multiple actions match, the option string was ambiguous + if (option_tuples.length > 1) { + let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ') + let args = {option: arg_string, matches: options} + let msg = 'ambiguous option: %(option)s could match %(matches)s' + this.error(sub(msg, args)) + + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (option_tuples.length === 1) { + let [ option_tuple ] = option_tuples + return option_tuple + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (this._negative_number_matcher.test(arg_string)) { + if (!this._has_negative_number_optionals.length) { + return undefined + } + } + + // if it contains a space, it was meant to be a positional + if (arg_string.includes(' ')) { + return undefined + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [ undefined, arg_string, undefined ] + } + + _get_option_tuples(option_string) { + let result = [] + + // option strings starting with two prefix characters are only + // split at the '=' + let chars = this.prefix_chars + if (chars.includes(option_string[0]) && chars.includes(option_string[1])) { + if (this.allow_abbrev) { + let option_prefix, explicit_arg + if (option_string.includes('=')) { + [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1) + } else { + option_prefix = option_string + explicit_arg = undefined + } + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) { + let option_prefix = option_string + let explicit_arg = undefined + let short_option_prefix = option_string.slice(0, 2) + let short_explicit_arg = option_string.slice(2) + + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string === short_option_prefix) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, short_explicit_arg ] + result.push(tup) + } else if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + + // shouldn't ever get here + } else { + this.error(sub('unexpected option string: %s', option_string)) + } + + // return the collected option tuples + return result + } + + _get_nargs_pattern(action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + let nargs = action.nargs + let nargs_pattern + + // the default (None) is assumed to be a single argument + if (nargs === undefined) { + nargs_pattern = '(-*A-*)' + + // allow zero or one arguments + } else if (nargs === OPTIONAL) { + nargs_pattern = '(-*A?-*)' + + // allow zero or more arguments + } else if (nargs === ZERO_OR_MORE) { + nargs_pattern = '(-*[A-]*)' + + // allow one or more arguments + } else if (nargs === ONE_OR_MORE) { + nargs_pattern = '(-*A[A-]*)' + + // allow any number of options or arguments + } else if (nargs === REMAINDER) { + nargs_pattern = '([-AO]*)' + + // allow one argument followed by any number of options or arguments + } else if (nargs === PARSER) { + nargs_pattern = '(-*A[-AO]*)' + + // suppress action, like nargs=0 + } else if (nargs === SUPPRESS) { + nargs_pattern = '(-*-*)' + + // all others should be integers + } else { + nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*')) + } + + // if this is an optional action, -- is not allowed + if (action.option_strings.length) { + nargs_pattern = nargs_pattern.replace(/-\*/g, '') + nargs_pattern = nargs_pattern.replace(/-/g, '') + } + + // return the pattern + return nargs_pattern + } + + // ======================== + // Alt command line argument parsing, allowing free intermix + // ======================== + + parse_intermixed_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_intermixed_args(args, namespace) + if (argv.length) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_intermixed_args(args = undefined, namespace = undefined) { + // returns a namespace and list of extras + // + // positional can be freely intermixed with optionals. optionals are + // first parsed with all positional arguments deactivated. The 'extras' + // are then parsed. If the parser definition is incompatible with the + // intermixed assumptions (e.g. use of REMAINDER, subparsers) a + // TypeError is raised. + // + // positionals are 'deactivated' by setting nargs and default to + // SUPPRESS. This blocks the addition of that positional to the + // namespace + + let extras + let positionals = this._get_positional_actions() + let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs)) + if (a.length) { + throw new TypeError(sub('parse_intermixed_args: positional arg' + + ' with nargs=%s', a[0].nargs)) + } + + for (let group of this._mutually_exclusive_groups) { + for (let action of group._group_actions) { + if (positionals.includes(action)) { + throw new TypeError('parse_intermixed_args: positional in' + + ' mutuallyExclusiveGroup') + } + } + } + + let save_usage + try { + save_usage = this.usage + let remaining_args + try { + if (this.usage === undefined) { + // capture the full usage for use in error messages + this.usage = this.format_usage().slice(7) + } + for (let action of positionals) { + // deactivate positionals + action.save_nargs = action.nargs + // action.nargs = 0 + action.nargs = SUPPRESS + action.save_default = action.default + action.default = SUPPRESS + } + [ namespace, remaining_args ] = this.parse_known_args(args, + namespace) + for (let action of positionals) { + // remove the empty positional values from namespace + let attr = getattr(namespace, action.dest) + if (Array.isArray(attr) && attr.length === 0) { + // eslint-disable-next-line no-console + console.warn(sub('Do not expect %s in %s', action.dest, namespace)) + delattr(namespace, action.dest) + } + } + } finally { + // restore nargs and usage before exiting + for (let action of positionals) { + action.nargs = action.save_nargs + action.default = action.save_default + } + } + let optionals = this._get_optional_actions() + try { + // parse positionals. optionals aren't normally required, but + // they could be, so make sure they aren't. + for (let action of optionals) { + action.save_required = action.required + action.required = false + } + for (let group of this._mutually_exclusive_groups) { + group.save_required = group.required + group.required = false + } + [ namespace, extras ] = this.parse_known_args(remaining_args, + namespace) + } finally { + // restore parser values before exiting + for (let action of optionals) { + action.required = action.save_required + } + for (let group of this._mutually_exclusive_groups) { + group.required = group.save_required + } + } + } finally { + this.usage = save_usage + } + return [ namespace, extras ] + } + + // ======================== + // Value conversion methods + // ======================== + _get_values(action, arg_strings) { + // for everything but PARSER, REMAINDER args, strip out first '--' + if (![PARSER, REMAINDER].includes(action.nargs)) { + try { + _array_remove(arg_strings, '--') + } catch (err) {} + } + + let value + // optional argument produces a default when not present + if (!arg_strings.length && action.nargs === OPTIONAL) { + if (action.option_strings.length) { + value = action.const + } else { + value = action.default + } + if (typeof value === 'string') { + value = this._get_value(action, value) + this._check_value(action, value) + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE && + !action.option_strings.length) { + if (action.default !== undefined) { + value = action.default + } else { + value = arg_strings + } + this._check_value(action, value) + + // single argument or optional argument produces a single value + } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) { + let arg_string = arg_strings[0] + value = this._get_value(action, arg_string) + this._check_value(action, value) + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === REMAINDER) { + value = arg_strings.map(v => this._get_value(action, v)) + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === PARSER) { + value = arg_strings.map(v => this._get_value(action, v)) + this._check_value(action, value[0]) + + // SUPPRESS argument does not put anything in the namespace + } else if (action.nargs === SUPPRESS) { + value = SUPPRESS + + // all other types of nargs produce a list + } else { + value = arg_strings.map(v => this._get_value(action, v)) + for (let v of value) { + this._check_value(action, v) + } + } + + // return the converted value + return value + } + + _get_value(action, arg_string) { + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + let msg = '%r is not callable' + throw new ArgumentError(action, sub(msg, type_func)) + } + + // convert the value to the appropriate type + let result + try { + try { + result = type_func(arg_string) + } catch (err) { + // Dear TC39, why would you ever consider making es6 classes not callable? + // We had one universal interface, [[Call]], which worked for anything + // (with familiar this-instanceof guard for classes). Now we have two. + if (err instanceof TypeError && + /Class constructor .* cannot be invoked without 'new'/.test(err.message)) { + // eslint-disable-next-line new-cap + result = new type_func(arg_string) + } else { + throw err + } + } + + } catch (err) { + // ArgumentTypeErrors indicate errors + if (err instanceof ArgumentTypeError) { + //let name = getattr(action.type, 'name', repr(action.type)) + let msg = err.message + throw new ArgumentError(action, msg) + + // TypeErrors or ValueErrors also indicate errors + } else if (err instanceof TypeError) { + let name = getattr(action.type, 'name', repr(action.type)) + let args = {type: name, value: arg_string} + let msg = 'invalid %(type)s value: %(value)r' + throw new ArgumentError(action, sub(msg, args)) + } else { + throw err + } + } + + // return the converted value + return result + } + + _check_value(action, value) { + // converted value must be one of the choices (if specified) + if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) { + let args = {value, + choices: _choices_to_array(action.choices).map(repr).join(', ')} + let msg = 'invalid choice: %(value)r (choose from %(choices)s)' + throw new ArgumentError(action, sub(msg, args)) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_usage() { + let formatter = this._get_formatter() + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + return formatter.format_help() + } + + format_help() { + let formatter = this._get_formatter() + + // usage + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + + // description + formatter.add_text(this.description) + + // positionals, optionals and user-defined groups + for (let action_group of this._action_groups) { + formatter.start_section(action_group.title) + formatter.add_text(action_group.description) + formatter.add_arguments(action_group._group_actions) + formatter.end_section() + } + + // epilog + formatter.add_text(this.epilog) + + // determine help from format above + return formatter.format_help() + } + + _get_formatter() { + // eslint-disable-next-line new-cap + return new this.formatter_class({ prog: this.prog }) + } + + // ===================== + // Help-printing methods + // ===================== + print_usage(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_usage(), file) + } + + print_help(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_help(), file) + } + + _print_message(message, file = undefined) { + if (message) { + if (file === undefined) file = process.stderr + file.write(message) + } + } + + // =============== + // Exiting methods + // =============== + exit(status = 0, message = undefined) { + if (message) { + this._print_message(message, process.stderr) + } + process.exit(status) + } + + error(message) { + /* + * error(message: string) + * + * Prints a usage message incorporating the message to stderr and + * exits. + * + * If you override this in a subclass, it should not return -- it + * should either exit or raise an exception. + */ + + // LEGACY (v1 compatibility), debug mode + if (this.debug === true) throw new Error(message) + // end + this.print_usage(process.stderr) + let args = {prog: this.prog, message: message} + this.exit(2, sub('%(prog)s: error: %(message)s\n', args)) + } +})) + + +module.exports = { + ArgumentParser, + ArgumentError, + ArgumentTypeError, + BooleanOptionalAction, + FileType, + HelpFormatter, + ArgumentDefaultsHelpFormatter, + RawDescriptionHelpFormatter, + RawTextHelpFormatter, + MetavarTypeHelpFormatter, + Namespace, + Action, + ONE_OR_MORE, + OPTIONAL, + PARSER, + REMAINDER, + SUPPRESS, + ZERO_OR_MORE +} + +// LEGACY (v1 compatibility), Const alias +Object.defineProperty(module.exports, 'Const', { + get() { + let result = {} + Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n)) + return v + } + }) + }) + Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n)) + return v + } + }) + }) + return result + }, + enumerable: false +}) +// end diff --git a/node_modules/argparse/lib/sub.js b/node_modules/argparse/lib/sub.js new file mode 100644 index 0000000000000000000000000000000000000000..e3eb3215fc171cec44a2a1e290cc7deb19bcca74 --- /dev/null +++ b/node_modules/argparse/lib/sub.js @@ -0,0 +1,67 @@ +// Limited implementation of python % string operator, supports only %s and %r for now +// (other formats are not used here, but may appear in custom templates) + +'use strict' + +const { inspect } = require('util') + + +module.exports = function sub(pattern, ...values) { + let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g + + let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) { + if (is_literal) return '%' + + let padded_count = 0 + if (is_padded) { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + padded_count = values.shift() + if (!Number.isInteger(padded_count)) throw new TypeError('* wants int') + } + + let str + if (name !== undefined) { + let dict = values[0] + if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping') + if (!(name in dict)) throw new TypeError(`no such key: '${name}'`) + str = dict[name] + } else { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + str = values.shift() + } + + switch (format) { + case 's': + str = String(str) + break + case 'r': + str = inspect(str) + break + case 'd': + case 'i': + if (typeof str !== 'number') { + throw new TypeError(`%${format} format: a number is required, not ${typeof str}`) + } + str = String(str.toFixed(0)) + break + default: + throw new TypeError(`unsupported format character '${format}'`) + } + + if (padded_count > 0) { + return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count) + } else { + return str + } + }) + + if (values.length) { + if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) { + // mapping + } else { + throw new TypeError('not all arguments converted during string formatting') + } + } + + return result +} diff --git a/node_modules/argparse/lib/textwrap.js b/node_modules/argparse/lib/textwrap.js new file mode 100644 index 0000000000000000000000000000000000000000..23d51cdb95ccc8591fb6ade3f7e07943071559fe --- /dev/null +++ b/node_modules/argparse/lib/textwrap.js @@ -0,0 +1,440 @@ +// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions): +// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py + +'use strict' + +/* + * Text wrapping and filling. + */ + +// Copyright (C) 1999-2001 Gregory P. Ward. +// Copyright (C) 2002, 2003 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors +// Originally written by Greg Ward + +// Hardcode the recognized whitespace characters to the US-ASCII +// whitespace characters. The main reason for doing this is that +// some Unicode spaces (like \u00a0) are non-breaking whitespaces. +// +// This less funky little regex just split on recognized spaces. E.g. +// "Hello there -- you goof-ball, use the -b option!" +// splits into +// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ +const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/ + +class TextWrapper { + /* + * Object for wrapping/filling text. The public interface consists of + * the wrap() and fill() methods; the other methods are just there for + * subclasses to override in order to tweak the default behaviour. + * If you want to completely replace the main wrapping algorithm, + * you'll probably have to override _wrap_chunks(). + * + * Several instance attributes control various aspects of wrapping: + * width (default: 70) + * the maximum width of wrapped lines (unless break_long_words + * is false) + * initial_indent (default: "") + * string that will be prepended to the first line of wrapped + * output. Counts towards the line's width. + * subsequent_indent (default: "") + * string that will be prepended to all lines save the first + * of wrapped output; also counts towards each line's width. + * expand_tabs (default: true) + * Expand tabs in input text to spaces before further processing. + * Each tab will become 0 .. 'tabsize' spaces, depending on its position + * in its line. If false, each tab is treated as a single character. + * tabsize (default: 8) + * Expand tabs in input text to 0 .. 'tabsize' spaces, unless + * 'expand_tabs' is false. + * replace_whitespace (default: true) + * Replace all whitespace characters in the input text by spaces + * after tab expansion. Note that if expand_tabs is false and + * replace_whitespace is true, every tab will be converted to a + * single space! + * fix_sentence_endings (default: false) + * Ensure that sentence-ending punctuation is always followed + * by two spaces. Off by default because the algorithm is + * (unavoidably) imperfect. + * break_long_words (default: true) + * Break words longer than 'width'. If false, those words will not + * be broken, and some lines might be longer than 'width'. + * break_on_hyphens (default: true) + * Allow breaking hyphenated words. If true, wrapping will occur + * preferably on whitespaces and right after hyphens part of + * compound words. + * drop_whitespace (default: true) + * Drop leading and trailing whitespace from lines. + * max_lines (default: None) + * Truncate wrapped lines. + * placeholder (default: ' [...]') + * Append to the last line of truncated text. + */ + + constructor(options = {}) { + let { + width = 70, + initial_indent = '', + subsequent_indent = '', + expand_tabs = true, + replace_whitespace = true, + fix_sentence_endings = false, + break_long_words = true, + drop_whitespace = true, + break_on_hyphens = true, + tabsize = 8, + max_lines = undefined, + placeholder=' [...]' + } = options + + this.width = width + this.initial_indent = initial_indent + this.subsequent_indent = subsequent_indent + this.expand_tabs = expand_tabs + this.replace_whitespace = replace_whitespace + this.fix_sentence_endings = fix_sentence_endings + this.break_long_words = break_long_words + this.drop_whitespace = drop_whitespace + this.break_on_hyphens = break_on_hyphens + this.tabsize = tabsize + this.max_lines = max_lines + this.placeholder = placeholder + } + + + // -- Private methods ----------------------------------------------- + // (possibly useful for subclasses to override) + + _munge_whitespace(text) { + /* + * _munge_whitespace(text : string) -> string + * + * Munge whitespace in text: expand tabs and convert all other + * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" + * becomes " foo bar baz". + */ + if (this.expand_tabs) { + text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js + } + if (this.replace_whitespace) { + text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ') + } + return text + } + + _split(text) { + /* + * _split(text : string) -> [string] + * + * Split the text to wrap into indivisible chunks. Chunks are + * not quite the same as words; see _wrap_chunks() for full + * details. As an example, the text + * Look, goof-ball -- use the -b option! + * breaks into the following chunks: + * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', 'option!' + * if break_on_hyphens is True, or in: + * 'Look,', ' ', 'goof-ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', option!' + * otherwise. + */ + let chunks = text.split(wordsep_simple_re) + chunks = chunks.filter(Boolean) + return chunks + } + + _handle_long_word(reversed_chunks, cur_line, cur_len, width) { + /* + * _handle_long_word(chunks : [string], + * cur_line : [string], + * cur_len : int, width : int) + * + * Handle a chunk of text (most likely a word, not whitespace) that + * is too long to fit in any line. + */ + // Figure out when indent is larger than the specified width, and make + // sure at least one character is stripped off on every pass + let space_left + if (width < 1) { + space_left = 1 + } else { + space_left = width - cur_len + } + + // If we're allowed to break long words, then do so: put as much + // of the next chunk onto the current line as will fit. + if (this.break_long_words) { + cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left)) + reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left) + + // Otherwise, we have to preserve the long word intact. Only add + // it to the current line if there's nothing already there -- + // that minimizes how much we violate the width constraint. + } else if (!cur_line) { + cur_line.push(...reversed_chunks.pop()) + } + + // If we're not allowed to break long words, and there's already + // text on the current line, do nothing. Next time through the + // main loop of _wrap_chunks(), we'll wind up here again, but + // cur_len will be zero, so the next line will be entirely + // devoted to the long word that we can't handle right now. + } + + _wrap_chunks(chunks) { + /* + * _wrap_chunks(chunks : [string]) -> [string] + * + * Wrap a sequence of text chunks and return a list of lines of + * length 'self.width' or less. (If 'break_long_words' is false, + * some lines may be longer than this.) Chunks correspond roughly + * to words and the whitespace between them: each chunk is + * indivisible (modulo 'break_long_words'), but a line break can + * come between any two chunks. Chunks should not have internal + * whitespace; ie. a chunk is either all whitespace or a "word". + * Whitespace chunks will be removed from the beginning and end of + * lines, but apart from that whitespace is preserved. + */ + let lines = [] + let indent + if (this.width <= 0) { + throw Error(`invalid width ${this.width} (must be > 0)`) + } + if (this.max_lines !== undefined) { + if (this.max_lines > 1) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + if (indent.length + this.placeholder.trimStart().length > this.width) { + throw Error('placeholder too large for max width') + } + } + + // Arrange in reverse order so items can be efficiently popped + // from a stack of chucks. + chunks = chunks.reverse() + + while (chunks.length > 0) { + + // Start the list of chunks that will make up the current line. + // cur_len is just the length of all the chunks in cur_line. + let cur_line = [] + let cur_len = 0 + + // Figure out which static string will prefix this line. + let indent + if (lines) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + + // Maximum width for this line. + let width = this.width - indent.length + + // First chunk on line is whitespace -- drop it, unless this + // is the very beginning of the text (ie. no lines started yet). + if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) { + chunks.pop() + } + + while (chunks.length > 0) { + let l = chunks[chunks.length - 1].length + + // Can at least squeeze this chunk onto the current line. + if (cur_len + l <= width) { + cur_line.push(chunks.pop()) + cur_len += l + + // Nope, this line is full. + } else { + break + } + } + + // The current line is full, and the next chunk is too big to + // fit on *any* line (not just this one). + if (chunks.length && chunks[chunks.length - 1].length > width) { + this._handle_long_word(chunks, cur_line, cur_len, width) + cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0) + } + + // If the last chunk on this line is all whitespace, drop it. + if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') { + cur_len -= cur_line[cur_line.length - 1].length + cur_line.pop() + } + + if (cur_line) { + if (this.max_lines === undefined || + lines.length + 1 < this.max_lines || + (chunks.length === 0 || + this.drop_whitespace && + chunks.length === 1 && + !chunks[0].trim()) && cur_len <= width) { + // Convert current line back to a string and store it in + // list of all lines (return value). + lines.push(indent + cur_line.join('')) + } else { + let had_break = false + while (cur_line) { + if (cur_line[cur_line.length - 1].trim() && + cur_len + this.placeholder.length <= width) { + cur_line.push(this.placeholder) + lines.push(indent + cur_line.join('')) + had_break = true + break + } + cur_len -= cur_line[-1].length + cur_line.pop() + } + if (!had_break) { + if (lines) { + let prev_line = lines[lines.length - 1].trimEnd() + if (prev_line.length + this.placeholder.length <= + this.width) { + lines[lines.length - 1] = prev_line + this.placeholder + break + } + } + lines.push(indent + this.placeholder.lstrip()) + } + break + } + } + } + + return lines + } + + _split_chunks(text) { + text = this._munge_whitespace(text) + return this._split(text) + } + + // -- Public interface ---------------------------------------------- + + wrap(text) { + /* + * wrap(text : string) -> [string] + * + * Reformat the single paragraph in 'text' so it fits in lines of + * no more than 'self.width' columns, and return a list of wrapped + * lines. Tabs in 'text' are expanded with string.expandtabs(), + * and all other whitespace characters (including newline) are + * converted to space. + */ + let chunks = this._split_chunks(text) + // not implemented in js + //if (this.fix_sentence_endings) { + // this._fix_sentence_endings(chunks) + //} + return this._wrap_chunks(chunks) + } + + fill(text) { + /* + * fill(text : string) -> string + * + * Reformat the single paragraph in 'text' to fit in lines of no + * more than 'self.width' columns, and return a new string + * containing the entire wrapped paragraph. + */ + return this.wrap(text).join('\n') + } +} + + +// -- Convenience interface --------------------------------------------- + +function wrap(text, options = {}) { + /* + * Wrap a single paragraph of text, returning a list of wrapped lines. + * + * Reformat the single paragraph in 'text' so it fits in lines of no + * more than 'width' columns, and return a list of wrapped lines. By + * default, tabs in 'text' are expanded with string.expandtabs(), and + * all other whitespace characters (including newline) are converted to + * space. See TextWrapper class for available keyword args to customize + * wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.wrap(text) +} + +function fill(text, options = {}) { + /* + * Fill a single paragraph of text, returning a new string. + * + * Reformat the single paragraph in 'text' to fit in lines of no more + * than 'width' columns, and return a new string containing the entire + * wrapped paragraph. As with wrap(), tabs are expanded and other + * whitespace characters converted to space. See TextWrapper class for + * available keyword args to customize wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.fill(text) +} + +// -- Loosely related functionality ------------------------------------- + +let _whitespace_only_re = /^[ \t]+$/mg +let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg + +function dedent(text) { + /* + * Remove any common leading whitespace from every line in `text`. + * + * This can be used to make triple-quoted strings line up with the left + * edge of the display, while still presenting them in the source code + * in indented form. + * + * Note that tabs and spaces are both treated as whitespace, but they + * are not equal: the lines " hello" and "\\thello" are + * considered to have no common leading whitespace. + * + * Entirely blank lines are normalized to a newline character. + */ + // Look for the longest leading string of spaces and tabs common to + // all lines. + let margin = undefined + text = text.replace(_whitespace_only_re, '') + let indents = text.match(_leading_whitespace_re) || [] + for (let indent of indents) { + indent = indent.slice(0, -1) + + if (margin === undefined) { + margin = indent + + // Current line more deeply indented than previous winner: + // no change (previous winner is still on top). + } else if (indent.startsWith(margin)) { + // pass + + // Current line consistent with and no deeper than previous winner: + // it's the new winner. + } else if (margin.startsWith(indent)) { + margin = indent + + // Find the largest common whitespace between current line and previous + // winner. + } else { + for (let i = 0; i < margin.length && i < indent.length; i++) { + if (margin[i] !== indent[i]) { + margin = margin.slice(0, i) + break + } + } + } + } + + if (margin) { + text = text.replace(new RegExp('^' + margin, 'mg'), '') + } + return text +} + +module.exports = { wrap, fill, dedent } diff --git a/node_modules/argparse/package.json b/node_modules/argparse/package.json new file mode 100644 index 0000000000000000000000000000000000000000..647d2aff18d2ac0bc73c4618e09a2a220bf7b36a --- /dev/null +++ b/node_modules/argparse/package.json @@ -0,0 +1,31 @@ +{ + "name": "argparse", + "description": "CLI arguments parser. Native port of python's argparse.", + "version": "2.0.1", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "main": "argparse.js", + "files": [ + "argparse.js", + "lib/" + ], + "license": "Python-2.0", + "repository": "nodeca/argparse", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && nyc mocha", + "coverage": "npm run test && nyc report --reporter html" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.11.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", + "eslint": "^7.5.0", + "mocha": "^8.0.1", + "nyc": "^15.1.0" + } +} diff --git a/node_modules/aria-hidden/LICENSE b/node_modules/aria-hidden/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a194c884de0a9fac7ef89094e4800282dda23f17 --- /dev/null +++ b/node_modules/aria-hidden/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Anton Korzunov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/aria-hidden/README.md b/node_modules/aria-hidden/README.md new file mode 100644 index 0000000000000000000000000000000000000000..74b34ff4414e6515ed9b3407c341ce3f9e48b343 --- /dev/null +++ b/node_modules/aria-hidden/README.md @@ -0,0 +1,99 @@ +# aria-hidden + +[![NPM](https://nodei.co/npm/aria-hidden.png?downloads=true&stars=true)](https://nodei.co/npm/aria-hidden/) + +Hides from ARIA everything, except provided node(s). + +Helps to isolate modal dialogs and focused task - the content will be not accessible using +accessible tools. + +Now with [HTML inert](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert) support + +# API + +Just call `hideOthers` with DOM-node you want to keep, and it will _hide_ everything else. +`targetNode` could be placed anywhere - its siblings would be hidden, but it and its parents - not. + +> "hidden" in terms or `aria-hidden` + +```js +import { hideOthers } from 'aria-hidden'; + +const undo = hideOthers(exceptThisDOMnode); +// everything else is "aria-hidden" + +// undo changes +undo(); +``` + +you also may limit the effect spread by providing top level node as a second parameter + +```js +// keep only `anotherNode` node visible in #app +// the rest of document will be untouched +hideOthers(anotherNode, document.getElementById('app')); +``` + +> `parentNode` defaults to document.body + +# Inert + +While `aria-hidden` played important role in the past and will play in the future - the main +use case always was around isolating content and making elements "transparent" not only for aria, but for +user interaction as well. + +This is why you might consider using `inertOthers` + +```tsx +import { hideOthers, inertOthers, supportsInert } from 'aria-hidden'; + +// focus on element mean "hide others". Ideally disable interactions +const focusOnElement = (node) => (supportsInert() ? inertOthers(node) : hideOthers(node)); +``` + +the same function as above is already contructed and exported as + +```tsx +import { suppressOthers } from 'aria-hidden'; + +suppressOthers([keepThisNode, andThis]); +``` + +⚠️ Note - inert **will disable any interactions** with _suppressed_ elements ⚠️ + +### Suppressing interactivity without inert + +One can `marker`, the third argument to a function, to mark hidden elements. +Later one can create a style matching given marker to apply `pointer-events:none` + +```css +[hidden-node] { + pointer-events: none; +} +``` + +```tsx +hideOthers(notThisOne, undefined /*parent = document*/, 'hidden-node'); +``` + +Generally speaking the same can be achieved by addressing `[aria-hidden]` nodes, but +not all `aria-hidden` nodes are expected to be non-interactive. +Hence, it's better to separate concerns. + +# Inspiration + +Based on [smooth-ui](https://github.com/smooth-code/smooth-ui) modal dialogs. + +# See also + +- [inert](https://github.com/WICG/inert) - The HTML attribute/property to mark parts of the DOM tree as "inert". +- [react-focus-lock](https://github.com/theKashey/react-focus-lock) to lock Focus inside modal. +- [react-scroll-lock](https://github.com/theKashey/react-scroll-lock) to disable page scroll while modal is opened. + +# Size + +Code is 30 lines long + +# Licence + +MIT diff --git a/node_modules/aria-hidden/dist/es2015/index.d.ts b/node_modules/aria-hidden/dist/es2015/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..709a138c4ebc5d41fdddb27191a9f205a7885c78 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2015/index.d.ts @@ -0,0 +1,29 @@ +export type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es2015/index.js b/node_modules/aria-hidden/dist/es2015/index.js new file mode 100644 index 0000000000000000000000000000000000000000..00aa2ea9da07e8e1d5978a4abe6ce1c2e9ac8041 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2015/index.js @@ -0,0 +1,167 @@ +var getDefaultParent = function (originalTarget) { + if (typeof document === 'undefined') { + return null; + } + var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +var counterMap = new WeakMap(); +var uncontrolledNodes = new WeakMap(); +var markerMap = {}; +var lockCount = 0; +var unwrapHost = function (node) { + return node && (node.host || unwrapHost(node.parentNode)); +}; +var correctTargets = function (parent, targets) { + return targets + .map(function (target) { + if (parent.contains(target)) { + return target; + } + var correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; + }) + .filter(function (x) { return Boolean(x); }); +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { + var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + var markerCounter = markerMap[markerName]; + var hiddenNodes = []; + var elementsToKeep = new Set(); + var elementsToStop = new Set(targets); + var keep = function (el) { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + var deep = function (parent) { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, function (node) { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + var attr = node.getAttribute(controlAttribute); + var alreadyHidden = attr !== null && attr !== 'false'; + var counterValue = (counterMap.get(node) || 0) + 1; + var markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return function () { + hiddenNodes.forEach(function (node) { + var counterValue = counterMap.get(node) - 1; + var markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var hideOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-aria-hidden'; } + var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10 + // and script elements, as they have no impact on accessibility. + targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var inertOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-inert-ed'; } + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +/** + * @returns if current browser supports inert + */ +export var supportsInert = function () { + return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +}; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var suppressOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-suppressed'; } + return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); +}; diff --git a/node_modules/aria-hidden/dist/es2019/index.d.ts b/node_modules/aria-hidden/dist/es2019/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..709a138c4ebc5d41fdddb27191a9f205a7885c78 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2019/index.d.ts @@ -0,0 +1,29 @@ +export type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es2019/index.js b/node_modules/aria-hidden/dist/es2019/index.js new file mode 100644 index 0000000000000000000000000000000000000000..17404dae4afb4660e14921347404b6c0ca40cca3 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2019/index.js @@ -0,0 +1,156 @@ +const getDefaultParent = (originalTarget) => { + if (typeof document === 'undefined') { + return null; + } + const sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +let counterMap = new WeakMap(); +let uncontrolledNodes = new WeakMap(); +let markerMap = {}; +let lockCount = 0; +const unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode)); +const correctTargets = (parent, targets) => targets + .map((target) => { + if (parent.contains(target)) { + return target; + } + const correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; +}) + .filter((x) => Boolean(x)); +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +const applyAttributeToOthers = (originalTarget, parentNode, markerName, controlAttribute) => { + const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + const markerCounter = markerMap[markerName]; + const hiddenNodes = []; + const elementsToKeep = new Set(); + const elementsToStop = new Set(targets); + const keep = (el) => { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + const deep = (parent) => { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, (node) => { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + const attr = node.getAttribute(controlAttribute); + const alreadyHidden = attr !== null && attr !== 'false'; + const counterValue = (counterMap.get(node) || 0) + 1; + const markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return () => { + hiddenNodes.forEach((node) => { + const counterValue = counterMap.get(node) - 1; + const markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const hideOthers = (originalTarget, parentNode, markerName = 'data-aria-hidden') => { + const targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + const activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return () => null; + } + // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10 + // and script elements, as they have no impact on accessibility. + targets.push(...Array.from(activeParentNode.querySelectorAll('[aria-live], script'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const inertOthers = (originalTarget, parentNode, markerName = 'data-inert-ed') => { + const activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return () => null; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +/** + * @returns if current browser supports inert + */ +export const supportsInert = () => typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const suppressOthers = (originalTarget, parentNode, markerName = 'data-suppressed') => (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); diff --git a/node_modules/aria-hidden/dist/es5/index.d.ts b/node_modules/aria-hidden/dist/es5/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..709a138c4ebc5d41fdddb27191a9f205a7885c78 --- /dev/null +++ b/node_modules/aria-hidden/dist/es5/index.d.ts @@ -0,0 +1,29 @@ +export type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es5/index.js b/node_modules/aria-hidden/dist/es5/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1b86f56de25fb82f0627a2c5c087c4211f591a2a --- /dev/null +++ b/node_modules/aria-hidden/dist/es5/index.js @@ -0,0 +1,174 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.suppressOthers = exports.supportsInert = exports.inertOthers = exports.hideOthers = void 0; +var getDefaultParent = function (originalTarget) { + if (typeof document === 'undefined') { + return null; + } + var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +var counterMap = new WeakMap(); +var uncontrolledNodes = new WeakMap(); +var markerMap = {}; +var lockCount = 0; +var unwrapHost = function (node) { + return node && (node.host || unwrapHost(node.parentNode)); +}; +var correctTargets = function (parent, targets) { + return targets + .map(function (target) { + if (parent.contains(target)) { + return target; + } + var correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; + }) + .filter(function (x) { return Boolean(x); }); +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { + var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + var markerCounter = markerMap[markerName]; + var hiddenNodes = []; + var elementsToKeep = new Set(); + var elementsToStop = new Set(targets); + var keep = function (el) { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + var deep = function (parent) { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, function (node) { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + var attr = node.getAttribute(controlAttribute); + var alreadyHidden = attr !== null && attr !== 'false'; + var counterValue = (counterMap.get(node) || 0) + 1; + var markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return function () { + hiddenNodes.forEach(function (node) { + var counterValue = counterMap.get(node) - 1; + var markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var hideOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-aria-hidden'; } + var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10 + // and script elements, as they have no impact on accessibility. + targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +exports.hideOthers = hideOthers; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var inertOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-inert-ed'; } + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +exports.inertOthers = inertOthers; +/** + * @returns if current browser supports inert + */ +var supportsInert = function () { + return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +}; +exports.supportsInert = supportsInert; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var suppressOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-suppressed'; } + return ((0, exports.supportsInert)() ? exports.inertOthers : exports.hideOthers)(originalTarget, parentNode, markerName); +}; +exports.suppressOthers = suppressOthers; diff --git a/node_modules/aria-hidden/package.json b/node_modules/aria-hidden/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dcb8d9c4dfe575e81d61e4902c568eff121929a2 --- /dev/null +++ b/node_modules/aria-hidden/package.json @@ -0,0 +1,71 @@ +{ + "name": "aria-hidden", + "version": "1.2.6", + "description": "Cast aria-hidden to everything, except...", + "main": "dist/es5/index.js", + "sideEffects": false, + "scripts": { + "test": "jest", + "dev": "lib-builder dev", + "test:ci": "jest --runInBand --coverage", + "build": "lib-builder build && yarn size:report", + "prepublish": "yarn build", + "release": "yarn build && yarn test", + "lint": "lib-builder lint", + "format": "lib-builder format", + "size": "size-limit", + "size:report": "size-limit --json > .size.json", + "update": "lib-builder update", + "prepublish-only": "yarn build && yarn changelog", + "prepare": "husky install", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" + }, + "author": "Anton Korzunov ", + "license": "MIT", + "devDependencies": { + "@theuiteam/lib-builder": "^1.0.0", + "@size-limit/preset-small-lib": "^11.1.6" + }, + "engines": { + "node": ">=10" + }, + "jsnext:main": "dist/es2015/index.js", + "module": "dist/es2015/index.js", + "types": "dist/es5/index.d.ts", + "files": [ + "dist" + ], + "keywords": [ + "DOM", + "aria", + "hidden", + "inert" + ], + "homepage": "https://github.com/theKashey/aria-hidden#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/theKashey/aria-hidden.git" + }, + "dependencies": { + "tslib": "^2.0.0" + }, + "module:es2019": "dist/es2019/index.js", + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write", + "eslint --fix" + ], + "*.{js,css,json,md}": [ + "prettier --write" + ] + }, + "prettier": { + "printWidth": 120, + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" +} diff --git a/node_modules/aria-query/LICENSE b/node_modules/aria-query/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3a8ae7c335078c0327bdb23e0d09024e15f1d1f2 --- /dev/null +++ b/node_modules/aria-query/LICENSE @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright 2020 A11yance + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/aria-query/README.md b/node_modules/aria-query/README.md new file mode 100644 index 0000000000000000000000000000000000000000..53a1b7b89e2443fec01fd00ab1d519c65847d718 --- /dev/null +++ b/node_modules/aria-query/README.md @@ -0,0 +1,195 @@ +# ARIA Query + +![CI](https://github.com/A11yance/aria-query/workflows/CI/badge.svg) + +Programmatic access to the [WAI-ARIA 1.2 Roles Model](https://www.w3.org/TR/wai-aria-1.2/#roles). +This package tracks the W3C Recommendation (last update: 6 June 2023). + +CDN URL: + +## Building the `src/etc` files + +The files under `src/etc` are generated by the `breakUpAriaJSON` script. + +To change them, edit the file `scripts/roles.json` then run: + +```bash +node ./scripts/breakUpAriaJSON.js +git add scripts/roles.json src/etc +``` + +It should work with Node version 6.11.2 or later. + +## Utilities + +### Interface + +These methods are available on each export from the module. The typing here in the documentation is pseudo-typed. Each export will have its own specific types for each method signature. + +```javascript +{| + entries: () => Array<$Item>, + get: (key: $Key) => ?$Value, + has: (key: $Key) => boolean, + keys: () => Array<$Key>, + values: () => Array<$Value>, +|}; +``` + +### Roles + +```javascript +import { roles } from 'aria-query'; +``` + +A map of role names to the role definition. For example: + +```javascript +let alertRole = roles.get('alert'); +/** + * Value of alertRole + * { + * "requiredProps": {}, + * "props": { + * "aria-atomic": "true", + * "aria-busy": null, + * "aria-controls": null, + * "aria-current": null, + * "aria-describedby": null, + * "aria-details": null, + * "aria-disabled": null, + * "aria-dropeffect": null, + * "aria-errormessage": null, + * "aria-expanded": null, + * "aria-flowto": null, + * "aria-grabbed": null, + * "aria-haspopup": null, + * "aria-hidden": null, + * "aria-invalid": null, + * "aria-keyshortcuts": null, + * "aria-label": null, + * "aria-labelledby": null, + * "aria-live": "assertive", + * "aria-owns": null, + * "aria-relevant": null, + * "aria-roledescription": null + * }, + * "abstract": false, + * "childrenPresentational": false, + * "baseConcepts": [], + * "relatedConcepts": [ { + * "module": "XForms", + * "concept": { + * "name": "alert" + * } + * }], + * "superClass": [["roletype", "structure", "section"]] + * } +``` + +### Elements to Roles + +```javascript +import { elementRoles } from 'aria-query'; +``` + +HTML Elements with inherent roles are mapped to those roles. In the case of an element like ``, the element often requires a `type` attribute to map to an ARIA role. + +```javascript +[ + [ '{"name": "article"}', [ 'article' ] ], + [ '{"name": "button"}', [ 'button' ] ], + [ '{"name": "td"}', [ 'cell', 'gridcell' ] ], + [ '{"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] }', [ 'checkbox' ] ], + [ '{"name": "th"}', [ 'columnheader' ] ], + [ '{"name": "select"}', [ 'combobox', 'listbox' ] ], + [ '{"name": "menuitem"}', [ 'command', 'menuitem' ] ], + [ '{"name": "dd"}', [ 'definition' ] ], + [ '{"name": "figure"}', [ 'figure' ] ], + [ '{"name": "form"}', [ 'form' ] ], + [ '{"name": "table"}', [ 'grid', 'table' ] ], + [ '{"name": "fieldset"}', [ 'group' ] ], + [ '{"name": "h1"}', [ 'heading' ] ], + [ '{"name": "h2"}', [ 'heading' ] ], + [ '{"name": "h3"}', [ 'heading' ] ], + [ '{"name": "h4"}', [ 'heading' ] ], + [ '{"name": "h5"}', [ 'heading' ] ], + [ '{"name": "h6"}', [ 'heading' ] ], + [ '{"name": "img"}', [ 'img' ] ], + [ '{"name": "a"}', [ 'link' ] ], + [ '{"name": "link"}', [ 'link' ] ], + [ '{"name": "ol"}', [ 'list' ] ], + [ '{"name": "ul"}', [ 'list' ] ], + [ '{"name": "li"}', [ 'listitem' ] ], + [ '{"name": "nav"}', [ 'navigation' ] ], + [ '{"name": "option"}', [ 'option' ] ], + [ '{"name": "input", "attributes": [ {"name": "type", "value": "radio"}] }', [ 'radio' ] ], + [ '{"name": "frame"}', [ 'region' ] ], + [ '{"name": "rel"}', [ 'roletype' ] ], + [ '{"name": "tr"}', [ 'row' ] ], + [ '{"name": "tbody"}', [ 'rowgroup' ] ], + [ '{"name": "tfoot"}', [ 'rowgroup' ] ], + [ '{"name": "thead"}', [ 'rowgroup' ] ], + [ '{"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }', [ 'rowheader' ] ], + [ '{"name": "input", "attributes": [ {"name": "type", "value": "search"}] }', [ 'searchbox' ] ], + [ '{"name": "hr"}', [ 'separator' ] ], + [ '{"name": "dt"}', [ 'term' ] ], + [ '{"name": "dfn"}', [ 'term' ] ], + [ '{"name": "textarea"}', [ 'textbox' ] ], + [ '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] }', [ 'textbox' ] ], +] +``` + +The map of elements to roles is keyed by an HTML concept. An HTML concept corresponds to the `baseConcepts` and `relatedConcepts` of an ARIA role. Concepts exist in the context of a `module`: HTML, XForms, Dublin Core, for example. The concept representation is an object literal with a name property (the element name) and an optional attributes array. + +The roles are provided in a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). + +### Role to element + +```javascript +import { roleElements } from 'aria-query'; +``` + +ARIA roles are mapped to the HTML Elements with the same inherent role. Some roles, such as `columnheader` are only mapped to an HTML element that expresses specific attributes. In the case of ``, the element often requires a `type` attribute to map to an ARIA role. + +```javascript +[ + [ 'article', [ {"name": "article"} ] ], + [ 'button', [ {"name": "button"} ] ], + [ 'cell', [ {"name": "td"} ] ], + [ 'checkbox', [ {"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] } ] ], + [ 'columnheader', [ {"name": "th"} ] ], + [ 'combobox', [ {"name": "select"} ] ], + [ 'command', [ {"name": "menuitem"} ] ], + [ 'definition', [ {"name": "dd"}', '{"name": "dfn"} ] ], + [ 'figure', [ {"name": "figure"} ] ], + [ 'form', [ {"name": "form"} ] ], + [ 'grid', [ {"name": "table"} ] ], + [ 'gridcell', [ {"name": "td"} ] ], + [ 'group', [ {"name": "fieldset"} ] ], + [ 'heading', [ {"name": "h1"}', '{"name": "h2"}', '{"name": "h3"}', '{"name": "h4"}', '{"name": "h5"}', '{"name": "h6"} ] ], + [ 'img', [ {"name": "img"} ] ], + [ 'link', [ {"name": "a"}', '{"name": "link"} ] ], + [ 'list', [ {"name": "ol"}', '{"name": "ul"} ] ], + [ 'listbox', [ {"name": "select"} ] ], + [ 'listitem', [ {"name": "li"} ] ], + [ 'menuitem', [ {"name": "menuitem"} ] ], + [ 'navigation', [ {"name": "nav"} ] ], + [ 'option', [ {"name": "option"} ] ], + [ 'radio', [ {"name": "input", "attributes": [ {"name": "type", "value": "radio"}] } ] ], + [ 'region', [ {"name": "frame"} ] ], + [ 'roletype', [ {"name": "rel"} ] ], + [ 'row', [ {"name": "tr"} ] ], + [ 'rowgroup', [ {"name": "tbody"}', '{"name": "tfoot"}', '{"name": "thead"} ] ], + [ 'rowheader', [ {"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }, {"name": "th", "attributes": [ {"name": "scope", "value": "rowgroup"}] } ] ], + [ 'searchbox', [ {"name": "input", "attributes": [ {"name": "type", "value": "search"}] } ] ], + [ 'separator', [ {"name": "hr"} ] ], + [ 'table', [ {"name": "table"} ] ], + [ 'term', [ {"name": "dt"} ] ], + [ 'textbox', [ {"name": "textarea"}', '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] } ] ], +] +``` + +## License + +Copyright (c) 2021 A11yance diff --git a/node_modules/aria-query/lib/ariaPropsMap.js b/node_modules/aria-query/lib/ariaPropsMap.js new file mode 100644 index 0000000000000000000000000000000000000000..b0b1709e23084d0f9e741f721ef33c4892ffb5e9 --- /dev/null +++ b/node_modules/aria-query/lib/ariaPropsMap.js @@ -0,0 +1,168 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +var properties = [['aria-activedescendant', { + 'type': 'id' +}], ['aria-atomic', { + 'type': 'boolean' +}], ['aria-autocomplete', { + 'type': 'token', + 'values': ['inline', 'list', 'both', 'none'] +}], ['aria-braillelabel', { + 'type': 'string' +}], ['aria-brailleroledescription', { + 'type': 'string' +}], ['aria-busy', { + 'type': 'boolean' +}], ['aria-checked', { + 'type': 'tristate' +}], ['aria-colcount', { + type: 'integer' +}], ['aria-colindex', { + type: 'integer' +}], ['aria-colspan', { + type: 'integer' +}], ['aria-controls', { + 'type': 'idlist' +}], ['aria-current', { + type: 'token', + values: ['page', 'step', 'location', 'date', 'time', true, false] +}], ['aria-describedby', { + 'type': 'idlist' +}], ['aria-description', { + 'type': 'string' +}], ['aria-details', { + 'type': 'id' +}], ['aria-disabled', { + 'type': 'boolean' +}], ['aria-dropeffect', { + 'type': 'tokenlist', + 'values': ['copy', 'execute', 'link', 'move', 'none', 'popup'] +}], ['aria-errormessage', { + 'type': 'id' +}], ['aria-expanded', { + 'type': 'boolean', + 'allowundefined': true +}], ['aria-flowto', { + 'type': 'idlist' +}], ['aria-grabbed', { + 'type': 'boolean', + 'allowundefined': true +}], ['aria-haspopup', { + 'type': 'token', + 'values': [false, true, 'menu', 'listbox', 'tree', 'grid', 'dialog'] +}], ['aria-hidden', { + 'type': 'boolean', + 'allowundefined': true +}], ['aria-invalid', { + 'type': 'token', + 'values': ['grammar', false, 'spelling', true] +}], ['aria-keyshortcuts', { + type: 'string' +}], ['aria-label', { + 'type': 'string' +}], ['aria-labelledby', { + 'type': 'idlist' +}], ['aria-level', { + 'type': 'integer' +}], ['aria-live', { + 'type': 'token', + 'values': ['assertive', 'off', 'polite'] +}], ['aria-modal', { + type: 'boolean' +}], ['aria-multiline', { + 'type': 'boolean' +}], ['aria-multiselectable', { + 'type': 'boolean' +}], ['aria-orientation', { + 'type': 'token', + 'values': ['vertical', 'undefined', 'horizontal'] +}], ['aria-owns', { + 'type': 'idlist' +}], ['aria-placeholder', { + type: 'string' +}], ['aria-posinset', { + 'type': 'integer' +}], ['aria-pressed', { + 'type': 'tristate' +}], ['aria-readonly', { + 'type': 'boolean' +}], ['aria-relevant', { + 'type': 'tokenlist', + 'values': ['additions', 'all', 'removals', 'text'] +}], ['aria-required', { + 'type': 'boolean' +}], ['aria-roledescription', { + type: 'string' +}], ['aria-rowcount', { + type: 'integer' +}], ['aria-rowindex', { + type: 'integer' +}], ['aria-rowspan', { + type: 'integer' +}], ['aria-selected', { + 'type': 'boolean', + 'allowundefined': true +}], ['aria-setsize', { + 'type': 'integer' +}], ['aria-sort', { + 'type': 'token', + 'values': ['ascending', 'descending', 'none', 'other'] +}], ['aria-valuemax', { + 'type': 'number' +}], ['aria-valuemin', { + 'type': 'number' +}], ['aria-valuenow', { + 'type': 'number' +}], ['aria-valuetext', { + 'type': 'string' +}]]; +var ariaPropsMap = { + entries: function entries() { + return properties; + }, + forEach: function forEach(fn) { + var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + for (var _i = 0, _properties = properties; _i < _properties.length; _i++) { + var _properties$_i = _slicedToArray(_properties[_i], 2), + key = _properties$_i[0], + values = _properties$_i[1]; + fn.call(thisArg, values, key, properties); + } + }, + get: function get(key) { + var item = properties.filter(function (tuple) { + return tuple[0] === key ? true : false; + })[0]; + return item && item[1]; + }, + has: function has(key) { + return !!ariaPropsMap.get(key); + }, + keys: function keys() { + return properties.map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 1), + key = _ref2[0]; + return key; + }); + }, + values: function values() { + return properties.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + values = _ref4[1]; + return values; + }); + } +}; +var _default = exports.default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries()); \ No newline at end of file diff --git a/node_modules/aria-query/lib/domMap.js b/node_modules/aria-query/lib/domMap.js new file mode 100644 index 0000000000000000000000000000000000000000..40a2e26c51aaf7c88489d121c56cf0bf0a616755 --- /dev/null +++ b/node_modules/aria-query/lib/domMap.js @@ -0,0 +1,311 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +var dom = [['a', { + reserved: false +}], ['abbr', { + reserved: false +}], ['acronym', { + reserved: false +}], ['address', { + reserved: false +}], ['applet', { + reserved: false +}], ['area', { + reserved: false +}], ['article', { + reserved: false +}], ['aside', { + reserved: false +}], ['audio', { + reserved: false +}], ['b', { + reserved: false +}], ['base', { + reserved: true +}], ['bdi', { + reserved: false +}], ['bdo', { + reserved: false +}], ['big', { + reserved: false +}], ['blink', { + reserved: false +}], ['blockquote', { + reserved: false +}], ['body', { + reserved: false +}], ['br', { + reserved: false +}], ['button', { + reserved: false +}], ['canvas', { + reserved: false +}], ['caption', { + reserved: false +}], ['center', { + reserved: false +}], ['cite', { + reserved: false +}], ['code', { + reserved: false +}], ['col', { + reserved: true +}], ['colgroup', { + reserved: true +}], ['content', { + reserved: false +}], ['data', { + reserved: false +}], ['datalist', { + reserved: false +}], ['dd', { + reserved: false +}], ['del', { + reserved: false +}], ['details', { + reserved: false +}], ['dfn', { + reserved: false +}], ['dialog', { + reserved: false +}], ['dir', { + reserved: false +}], ['div', { + reserved: false +}], ['dl', { + reserved: false +}], ['dt', { + reserved: false +}], ['em', { + reserved: false +}], ['embed', { + reserved: false +}], ['fieldset', { + reserved: false +}], ['figcaption', { + reserved: false +}], ['figure', { + reserved: false +}], ['font', { + reserved: false +}], ['footer', { + reserved: false +}], ['form', { + reserved: false +}], ['frame', { + reserved: false +}], ['frameset', { + reserved: false +}], ['h1', { + reserved: false +}], ['h2', { + reserved: false +}], ['h3', { + reserved: false +}], ['h4', { + reserved: false +}], ['h5', { + reserved: false +}], ['h6', { + reserved: false +}], ['head', { + reserved: true +}], ['header', { + reserved: false +}], ['hgroup', { + reserved: false +}], ['hr', { + reserved: false +}], ['html', { + reserved: true +}], ['i', { + reserved: false +}], ['iframe', { + reserved: false +}], ['img', { + reserved: false +}], ['input', { + reserved: false +}], ['ins', { + reserved: false +}], ['kbd', { + reserved: false +}], ['keygen', { + reserved: false +}], ['label', { + reserved: false +}], ['legend', { + reserved: false +}], ['li', { + reserved: false +}], ['link', { + reserved: true +}], ['main', { + reserved: false +}], ['map', { + reserved: false +}], ['mark', { + reserved: false +}], ['marquee', { + reserved: false +}], ['menu', { + reserved: false +}], ['menuitem', { + reserved: false +}], ['meta', { + reserved: true +}], ['meter', { + reserved: false +}], ['nav', { + reserved: false +}], ['noembed', { + reserved: true +}], ['noscript', { + reserved: true +}], ['object', { + reserved: false +}], ['ol', { + reserved: false +}], ['optgroup', { + reserved: false +}], ['option', { + reserved: false +}], ['output', { + reserved: false +}], ['p', { + reserved: false +}], ['param', { + reserved: true +}], ['picture', { + reserved: true +}], ['pre', { + reserved: false +}], ['progress', { + reserved: false +}], ['q', { + reserved: false +}], ['rp', { + reserved: false +}], ['rt', { + reserved: false +}], ['rtc', { + reserved: false +}], ['ruby', { + reserved: false +}], ['s', { + reserved: false +}], ['samp', { + reserved: false +}], ['script', { + reserved: true +}], ['section', { + reserved: false +}], ['select', { + reserved: false +}], ['small', { + reserved: false +}], ['source', { + reserved: true +}], ['spacer', { + reserved: false +}], ['span', { + reserved: false +}], ['strike', { + reserved: false +}], ['strong', { + reserved: false +}], ['style', { + reserved: true +}], ['sub', { + reserved: false +}], ['summary', { + reserved: false +}], ['sup', { + reserved: false +}], ['table', { + reserved: false +}], ['tbody', { + reserved: false +}], ['td', { + reserved: false +}], ['textarea', { + reserved: false +}], ['tfoot', { + reserved: false +}], ['th', { + reserved: false +}], ['thead', { + reserved: false +}], ['time', { + reserved: false +}], ['title', { + reserved: true +}], ['tr', { + reserved: false +}], ['track', { + reserved: true +}], ['tt', { + reserved: false +}], ['u', { + reserved: false +}], ['ul', { + reserved: false +}], ['var', { + reserved: false +}], ['video', { + reserved: false +}], ['wbr', { + reserved: false +}], ['xmp', { + reserved: false +}]]; +var domMap = { + entries: function entries() { + return dom; + }, + forEach: function forEach(fn) { + var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + for (var _i = 0, _dom = dom; _i < _dom.length; _i++) { + var _dom$_i = _slicedToArray(_dom[_i], 2), + key = _dom$_i[0], + values = _dom$_i[1]; + fn.call(thisArg, values, key, dom); + } + }, + get: function get(key) { + var item = dom.filter(function (tuple) { + return tuple[0] === key ? true : false; + })[0]; + return item && item[1]; + }, + has: function has(key) { + return !!domMap.get(key); + }, + keys: function keys() { + return dom.map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 1), + key = _ref2[0]; + return key; + }); + }, + values: function values() { + return dom.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + values = _ref4[1]; + return values; + }); + } +}; +var _default = exports.default = (0, _iterationDecorator.default)(domMap, domMap.entries()); \ No newline at end of file diff --git a/node_modules/aria-query/lib/elementRoleMap.js b/node_modules/aria-query/lib/elementRoleMap.js new file mode 100644 index 0000000000000000000000000000000000000000..eec1a69f55fa986fa7d9d458bc72a1bc00716bc8 --- /dev/null +++ b/node_modules/aria-query/lib/elementRoleMap.js @@ -0,0 +1,152 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); +var _rolesMap = _interopRequireDefault(require("./rolesMap")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +var elementRoles = []; +var keys = _rolesMap.default.keys(); +for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var role = _rolesMap.default.get(key); + if (role) { + var concepts = [].concat(role.baseConcepts, role.relatedConcepts); + var _loop = function _loop() { + var relation = concepts[k]; + if (relation.module === 'HTML') { + var concept = relation.concept; + if (concept) { + var elementRoleRelation = elementRoles.filter(function (relation) { + return ariaRoleRelationConceptEquals(relation[0], concept); + })[0]; + var roles; + if (elementRoleRelation) { + roles = elementRoleRelation[1]; + } else { + roles = []; + } + var isUnique = true; + for (var _i = 0; _i < roles.length; _i++) { + if (roles[_i] === key) { + isUnique = false; + break; + } + } + if (isUnique) { + roles.push(key); + } + if (!elementRoleRelation) { + elementRoles.push([concept, roles]); + } + } + } + }; + for (var k = 0; k < concepts.length; k++) { + _loop(); + } + } +} +var elementRoleMap = { + entries: function entries() { + return elementRoles; + }, + forEach: function forEach(fn) { + var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + for (var _i2 = 0, _elementRoles = elementRoles; _i2 < _elementRoles.length; _i2++) { + var _elementRoles$_i = _slicedToArray(_elementRoles[_i2], 2), + _key = _elementRoles$_i[0], + values = _elementRoles$_i[1]; + fn.call(thisArg, values, _key, elementRoles); + } + }, + get: function get(key) { + var item = elementRoles.filter(function (tuple) { + return key.name === tuple[0].name && ariaRoleRelationConceptAttributeEquals(key.attributes, tuple[0].attributes); + })[0]; + return item && item[1]; + }, + has: function has(key) { + return !!elementRoleMap.get(key); + }, + keys: function keys() { + return elementRoles.map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 1), + key = _ref2[0]; + return key; + }); + }, + values: function values() { + return elementRoles.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + values = _ref4[1]; + return values; + }); + } +}; +function ariaRoleRelationConceptEquals(a, b) { + return a.name === b.name && ariaRoleRelationConstraintsEquals(a.constraints, b.constraints) && ariaRoleRelationConceptAttributeEquals(a.attributes, b.attributes); +} +function ariaRoleRelationConstraintsEquals(a, b) { + if (a === undefined && b !== undefined) { + return false; + } + if (a !== undefined && b === undefined) { + return false; + } + if (a !== undefined && b !== undefined) { + if (a.length !== b.length) { + return false; + } + for (var _i3 = 0; _i3 < a.length; _i3++) { + if (a[_i3] !== b[_i3]) { + return false; + } + } + } + return true; +} +function ariaRoleRelationConceptAttributeEquals(a, b) { + if (a === undefined && b !== undefined) { + return false; + } + if (a !== undefined && b === undefined) { + return false; + } + if (a !== undefined && b !== undefined) { + if (a.length !== b.length) { + return false; + } + for (var _i4 = 0; _i4 < a.length; _i4++) { + if (a[_i4].name !== b[_i4].name || a[_i4].value !== b[_i4].value) { + return false; + } + if (a[_i4].constraints === undefined && b[_i4].constraints !== undefined) { + return false; + } + if (a[_i4].constraints !== undefined && b[_i4].constraints === undefined) { + return false; + } + if (a[_i4].constraints !== undefined && b[_i4].constraints !== undefined) { + if (a[_i4].constraints.length !== b[_i4].constraints.length) { + return false; + } + for (var j = 0; j < a[_i4].constraints.length; j++) { + if (a[_i4].constraints[j] !== b[_i4].constraints[j]) { + return false; + } + } + } + } + } + return true; +} +var _default = exports.default = (0, _iterationDecorator.default)(elementRoleMap, elementRoleMap.entries()); \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/commandRole.js b/node_modules/aria-query/lib/etc/roles/abstract/commandRole.js new file mode 100644 index 0000000000000000000000000000000000000000..31e94f6ae1e716014a171ad473afd2cdb0b3c4f8 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/commandRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var commandRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget']] +}; +var _default = exports.default = commandRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/compositeRole.js b/node_modules/aria-query/lib/etc/roles/abstract/compositeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c09875ab96bf866af365aa9a996c584d6cae15b9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/compositeRole.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var compositeRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-activedescendant': null, + 'aria-disabled': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget']] +}; +var _default = exports.default = compositeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/inputRole.js b/node_modules/aria-query/lib/etc/roles/abstract/inputRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ad18e40c942f0ad60509b1842d22cc52ac7d8974 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/inputRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var inputRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null + }, + relatedConcepts: [{ + concept: { + name: 'input' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget']] +}; +var _default = exports.default = inputRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/landmarkRole.js b/node_modules/aria-query/lib/etc/roles/abstract/landmarkRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8d272520221f0d215089d34f01b8adecf3d22eb4 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/landmarkRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var landmarkRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = landmarkRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/rangeRole.js b/node_modules/aria-query/lib/etc/roles/abstract/rangeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..800417cf66c7fb17ae5fce44a1817b0575939c61 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/rangeRole.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var rangeRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-valuemax': null, + 'aria-valuemin': null, + 'aria-valuenow': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = rangeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/roletypeRole.js b/node_modules/aria-query/lib/etc/roles/abstract/roletypeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..080d8a24ea20e448064decf87e1bbd9be6e12431 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/roletypeRole.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var roletypeRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: [], + prohibitedProps: [], + props: { + 'aria-atomic': null, + 'aria-busy': null, + 'aria-controls': null, + 'aria-current': null, + 'aria-describedby': null, + 'aria-details': null, + 'aria-dropeffect': null, + 'aria-flowto': null, + 'aria-grabbed': null, + 'aria-hidden': null, + 'aria-keyshortcuts': null, + 'aria-label': null, + 'aria-labelledby': null, + 'aria-live': null, + 'aria-owns': null, + 'aria-relevant': null, + 'aria-roledescription': null + }, + relatedConcepts: [{ + concept: { + name: 'role' + }, + module: 'XHTML' + }, { + concept: { + name: 'type' + }, + module: 'Dublin Core' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [] +}; +var _default = exports.default = roletypeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/sectionRole.js b/node_modules/aria-query/lib/etc/roles/abstract/sectionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..af1ca0eb49e8d500bb44ff26458c1f54744e4ab6 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/sectionRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var sectionRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: [], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'frontmatter' + }, + module: 'DTB' + }, { + concept: { + name: 'level' + }, + module: 'DTB' + }, { + concept: { + name: 'level' + }, + module: 'SMIL' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = sectionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/sectionheadRole.js b/node_modules/aria-query/lib/etc/roles/abstract/sectionheadRole.js new file mode 100644 index 0000000000000000000000000000000000000000..dd2c988d046b9070e3507d175d41d5cd42b8439c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/sectionheadRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var sectionheadRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = sectionheadRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/selectRole.js b/node_modules/aria-query/lib/etc/roles/abstract/selectRole.js new file mode 100644 index 0000000000000000000000000000000000000000..b4c9b59f29fc4dce1a4e1b982f900136197a0df0 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/selectRole.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var selectRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-orientation': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite'], ['roletype', 'structure', 'section', 'group']] +}; +var _default = exports.default = selectRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/structureRole.js b/node_modules/aria-query/lib/etc/roles/abstract/structureRole.js new file mode 100644 index 0000000000000000000000000000000000000000..839196c48290efa23d6914ab61a3e400416ba366 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/structureRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var structureRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: [], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype']] +}; +var _default = exports.default = structureRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/widgetRole.js b/node_modules/aria-query/lib/etc/roles/abstract/widgetRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2d905a9de46aeca1258c0639906752216f7fd48e --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/widgetRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var widgetRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: [], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype']] +}; +var _default = exports.default = widgetRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/abstract/windowRole.js b/node_modules/aria-query/lib/etc/roles/abstract/windowRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9b8137cec9a70e4d595a4ec1d5081bf331afb6b7 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/abstract/windowRole.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var windowRole = { + abstract: true, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-modal': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype']] +}; +var _default = exports.default = windowRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/ariaAbstractRoles.js b/node_modules/aria-query/lib/etc/roles/ariaAbstractRoles.js new file mode 100644 index 0000000000000000000000000000000000000000..498aab07b06bc3c83ae258ec095c7c1f6799c4ee --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/ariaAbstractRoles.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _commandRole = _interopRequireDefault(require("./abstract/commandRole")); +var _compositeRole = _interopRequireDefault(require("./abstract/compositeRole")); +var _inputRole = _interopRequireDefault(require("./abstract/inputRole")); +var _landmarkRole = _interopRequireDefault(require("./abstract/landmarkRole")); +var _rangeRole = _interopRequireDefault(require("./abstract/rangeRole")); +var _roletypeRole = _interopRequireDefault(require("./abstract/roletypeRole")); +var _sectionRole = _interopRequireDefault(require("./abstract/sectionRole")); +var _sectionheadRole = _interopRequireDefault(require("./abstract/sectionheadRole")); +var _selectRole = _interopRequireDefault(require("./abstract/selectRole")); +var _structureRole = _interopRequireDefault(require("./abstract/structureRole")); +var _widgetRole = _interopRequireDefault(require("./abstract/widgetRole")); +var _windowRole = _interopRequireDefault(require("./abstract/windowRole")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var ariaAbstractRoles = [['command', _commandRole.default], ['composite', _compositeRole.default], ['input', _inputRole.default], ['landmark', _landmarkRole.default], ['range', _rangeRole.default], ['roletype', _roletypeRole.default], ['section', _sectionRole.default], ['sectionhead', _sectionheadRole.default], ['select', _selectRole.default], ['structure', _structureRole.default], ['widget', _widgetRole.default], ['window', _windowRole.default]]; +var _default = exports.default = ariaAbstractRoles; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/ariaDpubRoles.js b/node_modules/aria-query/lib/etc/roles/ariaDpubRoles.js new file mode 100644 index 0000000000000000000000000000000000000000..72ac5d30ac0f45e38070c52c5d18c8eb574803e9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/ariaDpubRoles.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _docAbstractRole = _interopRequireDefault(require("./dpub/docAbstractRole")); +var _docAcknowledgmentsRole = _interopRequireDefault(require("./dpub/docAcknowledgmentsRole")); +var _docAfterwordRole = _interopRequireDefault(require("./dpub/docAfterwordRole")); +var _docAppendixRole = _interopRequireDefault(require("./dpub/docAppendixRole")); +var _docBacklinkRole = _interopRequireDefault(require("./dpub/docBacklinkRole")); +var _docBiblioentryRole = _interopRequireDefault(require("./dpub/docBiblioentryRole")); +var _docBibliographyRole = _interopRequireDefault(require("./dpub/docBibliographyRole")); +var _docBibliorefRole = _interopRequireDefault(require("./dpub/docBibliorefRole")); +var _docChapterRole = _interopRequireDefault(require("./dpub/docChapterRole")); +var _docColophonRole = _interopRequireDefault(require("./dpub/docColophonRole")); +var _docConclusionRole = _interopRequireDefault(require("./dpub/docConclusionRole")); +var _docCoverRole = _interopRequireDefault(require("./dpub/docCoverRole")); +var _docCreditRole = _interopRequireDefault(require("./dpub/docCreditRole")); +var _docCreditsRole = _interopRequireDefault(require("./dpub/docCreditsRole")); +var _docDedicationRole = _interopRequireDefault(require("./dpub/docDedicationRole")); +var _docEndnoteRole = _interopRequireDefault(require("./dpub/docEndnoteRole")); +var _docEndnotesRole = _interopRequireDefault(require("./dpub/docEndnotesRole")); +var _docEpigraphRole = _interopRequireDefault(require("./dpub/docEpigraphRole")); +var _docEpilogueRole = _interopRequireDefault(require("./dpub/docEpilogueRole")); +var _docErrataRole = _interopRequireDefault(require("./dpub/docErrataRole")); +var _docExampleRole = _interopRequireDefault(require("./dpub/docExampleRole")); +var _docFootnoteRole = _interopRequireDefault(require("./dpub/docFootnoteRole")); +var _docForewordRole = _interopRequireDefault(require("./dpub/docForewordRole")); +var _docGlossaryRole = _interopRequireDefault(require("./dpub/docGlossaryRole")); +var _docGlossrefRole = _interopRequireDefault(require("./dpub/docGlossrefRole")); +var _docIndexRole = _interopRequireDefault(require("./dpub/docIndexRole")); +var _docIntroductionRole = _interopRequireDefault(require("./dpub/docIntroductionRole")); +var _docNoterefRole = _interopRequireDefault(require("./dpub/docNoterefRole")); +var _docNoticeRole = _interopRequireDefault(require("./dpub/docNoticeRole")); +var _docPagebreakRole = _interopRequireDefault(require("./dpub/docPagebreakRole")); +var _docPagefooterRole = _interopRequireDefault(require("./dpub/docPagefooterRole")); +var _docPageheaderRole = _interopRequireDefault(require("./dpub/docPageheaderRole")); +var _docPagelistRole = _interopRequireDefault(require("./dpub/docPagelistRole")); +var _docPartRole = _interopRequireDefault(require("./dpub/docPartRole")); +var _docPrefaceRole = _interopRequireDefault(require("./dpub/docPrefaceRole")); +var _docPrologueRole = _interopRequireDefault(require("./dpub/docPrologueRole")); +var _docPullquoteRole = _interopRequireDefault(require("./dpub/docPullquoteRole")); +var _docQnaRole = _interopRequireDefault(require("./dpub/docQnaRole")); +var _docSubtitleRole = _interopRequireDefault(require("./dpub/docSubtitleRole")); +var _docTipRole = _interopRequireDefault(require("./dpub/docTipRole")); +var _docTocRole = _interopRequireDefault(require("./dpub/docTocRole")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var ariaDpubRoles = [['doc-abstract', _docAbstractRole.default], ['doc-acknowledgments', _docAcknowledgmentsRole.default], ['doc-afterword', _docAfterwordRole.default], ['doc-appendix', _docAppendixRole.default], ['doc-backlink', _docBacklinkRole.default], ['doc-biblioentry', _docBiblioentryRole.default], ['doc-bibliography', _docBibliographyRole.default], ['doc-biblioref', _docBibliorefRole.default], ['doc-chapter', _docChapterRole.default], ['doc-colophon', _docColophonRole.default], ['doc-conclusion', _docConclusionRole.default], ['doc-cover', _docCoverRole.default], ['doc-credit', _docCreditRole.default], ['doc-credits', _docCreditsRole.default], ['doc-dedication', _docDedicationRole.default], ['doc-endnote', _docEndnoteRole.default], ['doc-endnotes', _docEndnotesRole.default], ['doc-epigraph', _docEpigraphRole.default], ['doc-epilogue', _docEpilogueRole.default], ['doc-errata', _docErrataRole.default], ['doc-example', _docExampleRole.default], ['doc-footnote', _docFootnoteRole.default], ['doc-foreword', _docForewordRole.default], ['doc-glossary', _docGlossaryRole.default], ['doc-glossref', _docGlossrefRole.default], ['doc-index', _docIndexRole.default], ['doc-introduction', _docIntroductionRole.default], ['doc-noteref', _docNoterefRole.default], ['doc-notice', _docNoticeRole.default], ['doc-pagebreak', _docPagebreakRole.default], ['doc-pagefooter', _docPagefooterRole.default], ['doc-pageheader', _docPageheaderRole.default], ['doc-pagelist', _docPagelistRole.default], ['doc-part', _docPartRole.default], ['doc-preface', _docPrefaceRole.default], ['doc-prologue', _docPrologueRole.default], ['doc-pullquote', _docPullquoteRole.default], ['doc-qna', _docQnaRole.default], ['doc-subtitle', _docSubtitleRole.default], ['doc-tip', _docTipRole.default], ['doc-toc', _docTocRole.default]]; +var _default = exports.default = ariaDpubRoles; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/ariaGraphicsRoles.js b/node_modules/aria-query/lib/etc/roles/ariaGraphicsRoles.js new file mode 100644 index 0000000000000000000000000000000000000000..bdc4b958a6714caac54c478ea376d01515cafa11 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/ariaGraphicsRoles.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _graphicsDocumentRole = _interopRequireDefault(require("./graphics/graphicsDocumentRole")); +var _graphicsObjectRole = _interopRequireDefault(require("./graphics/graphicsObjectRole")); +var _graphicsSymbolRole = _interopRequireDefault(require("./graphics/graphicsSymbolRole")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var ariaGraphicsRoles = [['graphics-document', _graphicsDocumentRole.default], ['graphics-object', _graphicsObjectRole.default], ['graphics-symbol', _graphicsSymbolRole.default]]; +var _default = exports.default = ariaGraphicsRoles; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/ariaLiteralRoles.js b/node_modules/aria-query/lib/etc/roles/ariaLiteralRoles.js new file mode 100644 index 0000000000000000000000000000000000000000..6011392dbd40ac8020b3c7930a0c9ce66e414b92 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/ariaLiteralRoles.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _alertRole = _interopRequireDefault(require("./literal/alertRole")); +var _alertdialogRole = _interopRequireDefault(require("./literal/alertdialogRole")); +var _applicationRole = _interopRequireDefault(require("./literal/applicationRole")); +var _articleRole = _interopRequireDefault(require("./literal/articleRole")); +var _bannerRole = _interopRequireDefault(require("./literal/bannerRole")); +var _blockquoteRole = _interopRequireDefault(require("./literal/blockquoteRole")); +var _buttonRole = _interopRequireDefault(require("./literal/buttonRole")); +var _captionRole = _interopRequireDefault(require("./literal/captionRole")); +var _cellRole = _interopRequireDefault(require("./literal/cellRole")); +var _checkboxRole = _interopRequireDefault(require("./literal/checkboxRole")); +var _codeRole = _interopRequireDefault(require("./literal/codeRole")); +var _columnheaderRole = _interopRequireDefault(require("./literal/columnheaderRole")); +var _comboboxRole = _interopRequireDefault(require("./literal/comboboxRole")); +var _complementaryRole = _interopRequireDefault(require("./literal/complementaryRole")); +var _contentinfoRole = _interopRequireDefault(require("./literal/contentinfoRole")); +var _definitionRole = _interopRequireDefault(require("./literal/definitionRole")); +var _deletionRole = _interopRequireDefault(require("./literal/deletionRole")); +var _dialogRole = _interopRequireDefault(require("./literal/dialogRole")); +var _directoryRole = _interopRequireDefault(require("./literal/directoryRole")); +var _documentRole = _interopRequireDefault(require("./literal/documentRole")); +var _emphasisRole = _interopRequireDefault(require("./literal/emphasisRole")); +var _feedRole = _interopRequireDefault(require("./literal/feedRole")); +var _figureRole = _interopRequireDefault(require("./literal/figureRole")); +var _formRole = _interopRequireDefault(require("./literal/formRole")); +var _genericRole = _interopRequireDefault(require("./literal/genericRole")); +var _gridRole = _interopRequireDefault(require("./literal/gridRole")); +var _gridcellRole = _interopRequireDefault(require("./literal/gridcellRole")); +var _groupRole = _interopRequireDefault(require("./literal/groupRole")); +var _headingRole = _interopRequireDefault(require("./literal/headingRole")); +var _imgRole = _interopRequireDefault(require("./literal/imgRole")); +var _insertionRole = _interopRequireDefault(require("./literal/insertionRole")); +var _linkRole = _interopRequireDefault(require("./literal/linkRole")); +var _listRole = _interopRequireDefault(require("./literal/listRole")); +var _listboxRole = _interopRequireDefault(require("./literal/listboxRole")); +var _listitemRole = _interopRequireDefault(require("./literal/listitemRole")); +var _logRole = _interopRequireDefault(require("./literal/logRole")); +var _mainRole = _interopRequireDefault(require("./literal/mainRole")); +var _markRole = _interopRequireDefault(require("./literal/markRole")); +var _marqueeRole = _interopRequireDefault(require("./literal/marqueeRole")); +var _mathRole = _interopRequireDefault(require("./literal/mathRole")); +var _menuRole = _interopRequireDefault(require("./literal/menuRole")); +var _menubarRole = _interopRequireDefault(require("./literal/menubarRole")); +var _menuitemRole = _interopRequireDefault(require("./literal/menuitemRole")); +var _menuitemcheckboxRole = _interopRequireDefault(require("./literal/menuitemcheckboxRole")); +var _menuitemradioRole = _interopRequireDefault(require("./literal/menuitemradioRole")); +var _meterRole = _interopRequireDefault(require("./literal/meterRole")); +var _navigationRole = _interopRequireDefault(require("./literal/navigationRole")); +var _noneRole = _interopRequireDefault(require("./literal/noneRole")); +var _noteRole = _interopRequireDefault(require("./literal/noteRole")); +var _optionRole = _interopRequireDefault(require("./literal/optionRole")); +var _paragraphRole = _interopRequireDefault(require("./literal/paragraphRole")); +var _presentationRole = _interopRequireDefault(require("./literal/presentationRole")); +var _progressbarRole = _interopRequireDefault(require("./literal/progressbarRole")); +var _radioRole = _interopRequireDefault(require("./literal/radioRole")); +var _radiogroupRole = _interopRequireDefault(require("./literal/radiogroupRole")); +var _regionRole = _interopRequireDefault(require("./literal/regionRole")); +var _rowRole = _interopRequireDefault(require("./literal/rowRole")); +var _rowgroupRole = _interopRequireDefault(require("./literal/rowgroupRole")); +var _rowheaderRole = _interopRequireDefault(require("./literal/rowheaderRole")); +var _scrollbarRole = _interopRequireDefault(require("./literal/scrollbarRole")); +var _searchRole = _interopRequireDefault(require("./literal/searchRole")); +var _searchboxRole = _interopRequireDefault(require("./literal/searchboxRole")); +var _separatorRole = _interopRequireDefault(require("./literal/separatorRole")); +var _sliderRole = _interopRequireDefault(require("./literal/sliderRole")); +var _spinbuttonRole = _interopRequireDefault(require("./literal/spinbuttonRole")); +var _statusRole = _interopRequireDefault(require("./literal/statusRole")); +var _strongRole = _interopRequireDefault(require("./literal/strongRole")); +var _subscriptRole = _interopRequireDefault(require("./literal/subscriptRole")); +var _superscriptRole = _interopRequireDefault(require("./literal/superscriptRole")); +var _switchRole = _interopRequireDefault(require("./literal/switchRole")); +var _tabRole = _interopRequireDefault(require("./literal/tabRole")); +var _tableRole = _interopRequireDefault(require("./literal/tableRole")); +var _tablistRole = _interopRequireDefault(require("./literal/tablistRole")); +var _tabpanelRole = _interopRequireDefault(require("./literal/tabpanelRole")); +var _termRole = _interopRequireDefault(require("./literal/termRole")); +var _textboxRole = _interopRequireDefault(require("./literal/textboxRole")); +var _timeRole = _interopRequireDefault(require("./literal/timeRole")); +var _timerRole = _interopRequireDefault(require("./literal/timerRole")); +var _toolbarRole = _interopRequireDefault(require("./literal/toolbarRole")); +var _tooltipRole = _interopRequireDefault(require("./literal/tooltipRole")); +var _treeRole = _interopRequireDefault(require("./literal/treeRole")); +var _treegridRole = _interopRequireDefault(require("./literal/treegridRole")); +var _treeitemRole = _interopRequireDefault(require("./literal/treeitemRole")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var ariaLiteralRoles = [['alert', _alertRole.default], ['alertdialog', _alertdialogRole.default], ['application', _applicationRole.default], ['article', _articleRole.default], ['banner', _bannerRole.default], ['blockquote', _blockquoteRole.default], ['button', _buttonRole.default], ['caption', _captionRole.default], ['cell', _cellRole.default], ['checkbox', _checkboxRole.default], ['code', _codeRole.default], ['columnheader', _columnheaderRole.default], ['combobox', _comboboxRole.default], ['complementary', _complementaryRole.default], ['contentinfo', _contentinfoRole.default], ['definition', _definitionRole.default], ['deletion', _deletionRole.default], ['dialog', _dialogRole.default], ['directory', _directoryRole.default], ['document', _documentRole.default], ['emphasis', _emphasisRole.default], ['feed', _feedRole.default], ['figure', _figureRole.default], ['form', _formRole.default], ['generic', _genericRole.default], ['grid', _gridRole.default], ['gridcell', _gridcellRole.default], ['group', _groupRole.default], ['heading', _headingRole.default], ['img', _imgRole.default], ['insertion', _insertionRole.default], ['link', _linkRole.default], ['list', _listRole.default], ['listbox', _listboxRole.default], ['listitem', _listitemRole.default], ['log', _logRole.default], ['main', _mainRole.default], ['mark', _markRole.default], ['marquee', _marqueeRole.default], ['math', _mathRole.default], ['menu', _menuRole.default], ['menubar', _menubarRole.default], ['menuitem', _menuitemRole.default], ['menuitemcheckbox', _menuitemcheckboxRole.default], ['menuitemradio', _menuitemradioRole.default], ['meter', _meterRole.default], ['navigation', _navigationRole.default], ['none', _noneRole.default], ['note', _noteRole.default], ['option', _optionRole.default], ['paragraph', _paragraphRole.default], ['presentation', _presentationRole.default], ['progressbar', _progressbarRole.default], ['radio', _radioRole.default], ['radiogroup', _radiogroupRole.default], ['region', _regionRole.default], ['row', _rowRole.default], ['rowgroup', _rowgroupRole.default], ['rowheader', _rowheaderRole.default], ['scrollbar', _scrollbarRole.default], ['search', _searchRole.default], ['searchbox', _searchboxRole.default], ['separator', _separatorRole.default], ['slider', _sliderRole.default], ['spinbutton', _spinbuttonRole.default], ['status', _statusRole.default], ['strong', _strongRole.default], ['subscript', _subscriptRole.default], ['superscript', _superscriptRole.default], ['switch', _switchRole.default], ['tab', _tabRole.default], ['table', _tableRole.default], ['tablist', _tablistRole.default], ['tabpanel', _tabpanelRole.default], ['term', _termRole.default], ['textbox', _textboxRole.default], ['time', _timeRole.default], ['timer', _timerRole.default], ['toolbar', _toolbarRole.default], ['tooltip', _tooltipRole.default], ['tree', _treeRole.default], ['treegrid', _treegridRole.default], ['treeitem', _treeitemRole.default]]; +var _default = exports.default = ariaLiteralRoles; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docAbstractRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docAbstractRole.js new file mode 100644 index 0000000000000000000000000000000000000000..3aefca500e7a88f539246f95caa654048bf65062 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docAbstractRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docAbstractRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'abstract [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docAbstractRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docAcknowledgmentsRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docAcknowledgmentsRole.js new file mode 100644 index 0000000000000000000000000000000000000000..5561ab5227d76207d511a01a9d097413f880a89b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docAcknowledgmentsRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docAcknowledgmentsRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'acknowledgments [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docAcknowledgmentsRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docAfterwordRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docAfterwordRole.js new file mode 100644 index 0000000000000000000000000000000000000000..6e8acbeca3e56cd6a8da1ab6df1677b199a4e74b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docAfterwordRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docAfterwordRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'afterword [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docAfterwordRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docAppendixRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docAppendixRole.js new file mode 100644 index 0000000000000000000000000000000000000000..5c3f02288071285e69c1975c33134ef86ed8301f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docAppendixRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docAppendixRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'appendix [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docAppendixRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docBacklinkRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docBacklinkRole.js new file mode 100644 index 0000000000000000000000000000000000000000..71f07c5784d1d400cf4d927a5d1271d60046ddde --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docBacklinkRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docBacklinkRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'referrer [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command', 'link']] +}; +var _default = exports.default = docBacklinkRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docBiblioentryRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docBiblioentryRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e96996189b74cfa1263e47a48d5a4522b04cb0eb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docBiblioentryRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docBiblioentryRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'EPUB biblioentry [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: ['doc-bibliography'], + requiredContextRole: ['doc-bibliography'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'listitem']] +}; +var _default = exports.default = docBiblioentryRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docBibliographyRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docBibliographyRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2b8f3835ff8a4fc51afba0db9daf2edec5677c2c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docBibliographyRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docBibliographyRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'bibliography [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['doc-biblioentry']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docBibliographyRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docBibliorefRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docBibliorefRole.js new file mode 100644 index 0000000000000000000000000000000000000000..4893956ed6130ec98a7d44f98779ec4737c275f9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docBibliorefRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docBibliorefRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'biblioref [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command', 'link']] +}; +var _default = exports.default = docBibliorefRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docChapterRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docChapterRole.js new file mode 100644 index 0000000000000000000000000000000000000000..f8f2b0ccadfe92ba317a6af30f9ddec6f0136ed8 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docChapterRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docChapterRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'chapter [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docChapterRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docColophonRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docColophonRole.js new file mode 100644 index 0000000000000000000000000000000000000000..dc4e0e2c91e8871be2911d6582bd67714440f92e --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docColophonRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docColophonRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'colophon [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docColophonRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docConclusionRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docConclusionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..01a942e0fcfc8045de2a8c59609d2a652b077d94 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docConclusionRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docConclusionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'conclusion [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docConclusionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docCoverRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docCoverRole.js new file mode 100644 index 0000000000000000000000000000000000000000..1d51301448fffeff03bbc80e65ddc5228f465de0 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docCoverRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docCoverRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'cover [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'img']] +}; +var _default = exports.default = docCoverRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c321d99e79441251eb0168285e56cb94f33942e7 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docCreditRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'credit [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docCreditRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docCreditsRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docCreditsRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9b7f98836b8df6d772fc7c3dbb857f75971997b5 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docCreditsRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docCreditsRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'credits [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docCreditsRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docDedicationRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docDedicationRole.js new file mode 100644 index 0000000000000000000000000000000000000000..19ffdb3deeb13b5edcdfafaf87f18de98b2112e2 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docDedicationRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docDedicationRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'dedication [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docDedicationRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docEndnoteRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docEndnoteRole.js new file mode 100644 index 0000000000000000000000000000000000000000..73652cabc13ead1fc0762ee49598d6202a7d6fba --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docEndnoteRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docEndnoteRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'rearnote [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: ['doc-endnotes'], + requiredContextRole: ['doc-endnotes'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'listitem']] +}; +var _default = exports.default = docEndnoteRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docEndnotesRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docEndnotesRole.js new file mode 100644 index 0000000000000000000000000000000000000000..32c7d2f9f761fb4f71401cf60fcb6a096c1e347b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docEndnotesRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docEndnotesRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'rearnotes [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['doc-endnote']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docEndnotesRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docEpigraphRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docEpigraphRole.js new file mode 100644 index 0000000000000000000000000000000000000000..1a5ce567fb4865dfa60174def44ba55bd09a2ba2 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docEpigraphRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docEpigraphRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'epigraph [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docEpigraphRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docEpilogueRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docEpilogueRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d4638c36729e519e82ee8d622a19b4951ab504aa --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docEpilogueRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docEpilogueRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'epilogue [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docEpilogueRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docErrataRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docErrataRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ded11c64cdd1aab72b879e27c8689bf846235949 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docErrataRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docErrataRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'errata [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docErrataRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docExampleRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docExampleRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d6d356c1db9916880b8a80d768ba896f11d41be4 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docExampleRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docExampleRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docExampleRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docFootnoteRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docFootnoteRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2e50d8f88aad0ba83dbfd176d9ed1286168093f9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docFootnoteRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docFootnoteRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'footnote [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docFootnoteRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docForewordRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docForewordRole.js new file mode 100644 index 0000000000000000000000000000000000000000..77c462454008a65610df7e1dc0dbdb07caecb786 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docForewordRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docForewordRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'foreword [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docForewordRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docGlossaryRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docGlossaryRole.js new file mode 100644 index 0000000000000000000000000000000000000000..46f7ccf0b3648949c84e65e70215f84559af5bdf --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docGlossaryRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docGlossaryRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'glossary [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['definition'], ['term']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docGlossaryRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docGlossrefRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docGlossrefRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9f931f98ebcd7d20c4f17c5b0fde1a2cc26a0a95 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docGlossrefRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docGlossrefRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'glossref [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command', 'link']] +}; +var _default = exports.default = docGlossrefRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docIndexRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docIndexRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e32ebe540060fc281c8036e5054049f2f5b93585 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docIndexRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docIndexRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'index [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']] +}; +var _default = exports.default = docIndexRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docIntroductionRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docIntroductionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8cb188ee559750c83288328ee942a726d80c4939 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docIntroductionRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docIntroductionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'introduction [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docIntroductionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docNoterefRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docNoterefRole.js new file mode 100644 index 0000000000000000000000000000000000000000..b33965d9d73452e9b5b8067ba32736a240d2aafa --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docNoterefRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docNoterefRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'noteref [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command', 'link']] +}; +var _default = exports.default = docNoterefRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docNoticeRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docNoticeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d92834b1ec4b7bfcb68a090aca2daeac219b14b1 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docNoticeRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docNoticeRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'notice [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'note']] +}; +var _default = exports.default = docNoticeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPagebreakRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPagebreakRole.js new file mode 100644 index 0000000000000000000000000000000000000000..46f35422b66cb0cb9238a03cbc2f740a922cbd98 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPagebreakRole.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPagebreakRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'pagebreak [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'separator']] +}; +var _default = exports.default = docPagebreakRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPagefooterRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPagefooterRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e31ba34f10d59eba3195f3ce9fdfbfb124ecd465 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPagefooterRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPagefooterRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: [], + props: { + 'aria-braillelabel': null, + 'aria-brailleroledescription': null, + 'aria-description': null, + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docPagefooterRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPageheaderRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPageheaderRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c7d5602feb93438bc4c2528554650ec38e1abcde --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPageheaderRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPageheaderRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: [], + props: { + 'aria-braillelabel': null, + 'aria-brailleroledescription': null, + 'aria-description': null, + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docPageheaderRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPagelistRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPagelistRole.js new file mode 100644 index 0000000000000000000000000000000000000000..eaf41b88408f0d5a971998c73057e02debdc971a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPagelistRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPagelistRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'page-list [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']] +}; +var _default = exports.default = docPagelistRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPartRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPartRole.js new file mode 100644 index 0000000000000000000000000000000000000000..5e444206b6d391c42f271c7e6b30d80b1be3580a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPartRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPartRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'part [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docPartRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPrefaceRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPrefaceRole.js new file mode 100644 index 0000000000000000000000000000000000000000..b71cf255bb7b5340312351a79e656d0c54fd7c0f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPrefaceRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPrefaceRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'preface [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docPrefaceRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPrologueRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPrologueRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e2d81877ffb9def98113f2e280c8f3371fe7ac5a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPrologueRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPrologueRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'prologue [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = docPrologueRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docPullquoteRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docPullquoteRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e5f31604be3c6db58b85e096c4fdca99a51ddb3b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docPullquoteRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docPullquoteRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'pullquote [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['none']] +}; +var _default = exports.default = docPullquoteRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2116f0b138849d1f198744148fa1babf27a273b2 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docQnaRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'qna [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = docQnaRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docSubtitleRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docSubtitleRole.js new file mode 100644 index 0000000000000000000000000000000000000000..688ab963a8884e4b28557109f62e86a1d464fcdd --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docSubtitleRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docSubtitleRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'subtitle [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'sectionhead']] +}; +var _default = exports.default = docSubtitleRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docTipRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docTipRole.js new file mode 100644 index 0000000000000000000000000000000000000000..51f79baedce1dad34475a072cf8de4054e37f63f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docTipRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docTipRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'help [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'note']] +}; +var _default = exports.default = docTipRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/dpub/docTocRole.js b/node_modules/aria-query/lib/etc/roles/dpub/docTocRole.js new file mode 100644 index 0000000000000000000000000000000000000000..dc100c728e0ec6a89f9ad7efabb4002d87ae7557 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/dpub/docTocRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var docTocRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'toc [EPUB-SSV]' + }, + module: 'EPUB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']] +}; +var _default = exports.default = docTocRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/graphics/graphicsDocumentRole.js b/node_modules/aria-query/lib/etc/roles/graphics/graphicsDocumentRole.js new file mode 100644 index 0000000000000000000000000000000000000000..fb146d0b199e65a8b17fd6ef40dffbf1b92fce84 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/graphics/graphicsDocumentRole.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsDocumentRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + module: 'GRAPHICS', + concept: { + name: 'graphics-object' + } + }, { + module: 'ARIA', + concept: { + name: 'img' + } + }, { + module: 'ARIA', + concept: { + name: 'article' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'document']] +}; +var _default = exports.default = graphicsDocumentRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/graphics/graphicsObjectRole.js b/node_modules/aria-query/lib/etc/roles/graphics/graphicsObjectRole.js new file mode 100644 index 0000000000000000000000000000000000000000..5418a7fa4f7b24ea76eed98784131285f02846bb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/graphics/graphicsObjectRole.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsObjectRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + module: 'GRAPHICS', + concept: { + name: 'graphics-document' + } + }, { + module: 'ARIA', + concept: { + name: 'group' + } + }, { + module: 'ARIA', + concept: { + name: 'img' + } + }, { + module: 'GRAPHICS', + concept: { + name: 'graphics-symbol' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'group']] +}; +var _default = exports.default = graphicsObjectRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/graphics/graphicsSymbolRole.js b/node_modules/aria-query/lib/etc/roles/graphics/graphicsSymbolRole.js new file mode 100644 index 0000000000000000000000000000000000000000..34a61e9b604d597525a246d6705536bea289eb61 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/graphics/graphicsSymbolRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsSymbolRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'img']] +}; +var _default = exports.default = graphicsSymbolRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/alertRole.js b/node_modules/aria-query/lib/etc/roles/literal/alertRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d3e3f5363831857d132b5e29482f8aca60f529fe --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/alertRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var alertRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-atomic': 'true', + 'aria-live': 'assertive' + }, + relatedConcepts: [{ + concept: { + name: 'alert' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = alertRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js b/node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js new file mode 100644 index 0000000000000000000000000000000000000000..6406201c8ea117a4c00308b2e2ef15b595c6e667 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var alertdialogRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'alert' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'alert'], ['roletype', 'window', 'dialog']] +}; +var _default = exports.default = alertdialogRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/applicationRole.js b/node_modules/aria-query/lib/etc/roles/literal/applicationRole.js new file mode 100644 index 0000000000000000000000000000000000000000..51a4ff1e96ed03a6c42f4b9638b986300fd8ae77 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/applicationRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var applicationRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-activedescendant': null, + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + concept: { + name: 'Device Independence Delivery Unit' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = applicationRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/articleRole.js b/node_modules/aria-query/lib/etc/roles/literal/articleRole.js new file mode 100644 index 0000000000000000000000000000000000000000..238c4fcbbe2b81ea8a386abcb758f04611883799 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/articleRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var articleRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-posinset': null, + 'aria-setsize': null + }, + relatedConcepts: [{ + concept: { + name: 'article' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'document']] +}; +var _default = exports.default = articleRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/bannerRole.js b/node_modules/aria-query/lib/etc/roles/literal/bannerRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8fd96d35cd0ced1c55bbb350dd0308eb327b6965 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/bannerRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var bannerRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + constraints: ['scoped to the body element'], + name: 'header' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = bannerRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/blockquoteRole.js b/node_modules/aria-query/lib/etc/roles/literal/blockquoteRole.js new file mode 100644 index 0000000000000000000000000000000000000000..838814fc1874af60631ad31b0f8c376f6ac39edd --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/blockquoteRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var blockquoteRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'blockquote' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = blockquoteRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/buttonRole.js b/node_modules/aria-query/lib/etc/roles/literal/buttonRole.js new file mode 100644 index 0000000000000000000000000000000000000000..0ad385af60acfaf421e65fdceec4478e17d575eb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/buttonRole.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var buttonRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-pressed': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'type', + value: 'button' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'type', + value: 'image' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'type', + value: 'reset' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'type', + value: 'submit' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + name: 'button' + }, + module: 'HTML' + }, { + concept: { + name: 'trigger' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command']] +}; +var _default = exports.default = buttonRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/captionRole.js b/node_modules/aria-query/lib/etc/roles/literal/captionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..073c64cd0f5cc8e08afbd65f74ce5027527cba7c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/captionRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var captionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'caption' + }, + module: 'HTML' + }], + requireContextRole: ['figure', 'grid', 'table'], + requiredContextRole: ['figure', 'grid', 'table'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = captionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/cellRole.js b/node_modules/aria-query/lib/etc/roles/literal/cellRole.js new file mode 100644 index 0000000000000000000000000000000000000000..178929382b8a5a13b4b198107d712a82cabb64c9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/cellRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var cellRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-colindex': null, + 'aria-colspan': null, + 'aria-rowindex': null, + 'aria-rowspan': null + }, + relatedConcepts: [{ + concept: { + constraints: ['ancestor table element has table role'], + name: 'td' + }, + module: 'HTML' + }], + requireContextRole: ['row'], + requiredContextRole: ['row'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = cellRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/checkboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/checkboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..035cb93a6939d4c6442c4b8dd875575d531c5971 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/checkboxRole.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var checkboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-checked': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-required': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'type', + value: 'checkbox' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + name: 'option' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-checked': null + }, + superClass: [['roletype', 'widget', 'input']] +}; +var _default = exports.default = checkboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/codeRole.js b/node_modules/aria-query/lib/etc/roles/literal/codeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ba9607f8af706649b9837c368fde7754e9c9e066 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/codeRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var codeRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'code' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = codeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js b/node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9a862750a745b6fce8f8e7ff61a913cfd4203093 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var columnheaderRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-sort': null + }, + relatedConcepts: [{ + concept: { + name: 'th' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'scope', + value: 'col' + }], + name: 'th' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'scope', + value: 'colgroup' + }], + name: 'th' + }, + module: 'HTML' + }], + requireContextRole: ['row'], + requiredContextRole: ['row'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'structure', 'section', 'cell', 'gridcell'], ['roletype', 'widget', 'gridcell'], ['roletype', 'structure', 'sectionhead']] +}; +var _default = exports.default = columnheaderRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/comboboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/comboboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..93b10d5749c668ae5defef622a0296caab4a661b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/comboboxRole.js @@ -0,0 +1,124 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var comboboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-activedescendant': null, + 'aria-autocomplete': null, + 'aria-errormessage': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-required': null, + 'aria-expanded': 'false', + 'aria-haspopup': 'listbox' + }, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'email' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'search' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'tel' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'text' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'url' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'list' + }, { + name: 'type', + value: 'url' + }], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'multiple' + }, { + constraints: ['undefined'], + name: 'size' + }], + constraints: ['the multiple attribute is not set and the size attribute does not have a value greater than 1'], + name: 'select' + }, + module: 'HTML' + }, { + concept: { + name: 'select' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-controls': null, + 'aria-expanded': 'false' + }, + superClass: [['roletype', 'widget', 'input']] +}; +var _default = exports.default = comboboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/complementaryRole.js b/node_modules/aria-query/lib/etc/roles/literal/complementaryRole.js new file mode 100644 index 0000000000000000000000000000000000000000..3c24bf0cacb196f796bee47a8c36fe54b023d86a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/complementaryRole.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var complementaryRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + constraints: ['scoped to the body element', 'scoped to the main element'], + name: 'aside' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-label' + }], + constraints: ['scoped to a sectioning content element', 'scoped to a sectioning root element other than body'], + name: 'aside' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-labelledby' + }], + constraints: ['scoped to a sectioning content element', 'scoped to a sectioning root element other than body'], + name: 'aside' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = complementaryRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/contentinfoRole.js b/node_modules/aria-query/lib/etc/roles/literal/contentinfoRole.js new file mode 100644 index 0000000000000000000000000000000000000000..93d533130a266912a150874dab4cfe65ff7abc61 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/contentinfoRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var contentinfoRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + constraints: ['scoped to the body element'], + name: 'footer' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = contentinfoRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/definitionRole.js b/node_modules/aria-query/lib/etc/roles/literal/definitionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..62a8e964e986eb6cc700a91b9a031407a8e648de --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/definitionRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var definitionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'dd' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = definitionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/deletionRole.js b/node_modules/aria-query/lib/etc/roles/literal/deletionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..bc6884ee86f27b8ab5eecc1df16ca1be4d5333dc --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/deletionRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var deletionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'del' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = deletionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/dialogRole.js b/node_modules/aria-query/lib/etc/roles/literal/dialogRole.js new file mode 100644 index 0000000000000000000000000000000000000000..aafd966ea00f543cf34ffd331d849b0c8083ed64 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/dialogRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var dialogRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'dialog' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'window']] +}; +var _default = exports.default = dialogRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/directoryRole.js b/node_modules/aria-query/lib/etc/roles/literal/directoryRole.js new file mode 100644 index 0000000000000000000000000000000000000000..0d3408bf2adf0855379e5c3b413075062a9550eb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/directoryRole.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var directoryRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + module: 'DAISY Guide' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'list']] +}; +var _default = exports.default = directoryRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/documentRole.js b/node_modules/aria-query/lib/etc/roles/literal/documentRole.js new file mode 100644 index 0000000000000000000000000000000000000000..98f29ec3777a0b474c8477d5d4e914b98985af1c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/documentRole.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var documentRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'Device Independence Delivery Unit' + } + }, { + concept: { + name: 'html' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = documentRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/emphasisRole.js b/node_modules/aria-query/lib/etc/roles/literal/emphasisRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ef3153233906d5ecbe4f6d78ec0fdd32fe05e6ba --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/emphasisRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var emphasisRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'em' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = emphasisRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/feedRole.js b/node_modules/aria-query/lib/etc/roles/literal/feedRole.js new file mode 100644 index 0000000000000000000000000000000000000000..3e7c72f85bf3892e5b701aeb80c5b4761faad03f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/feedRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var feedRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['article']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'list']] +}; +var _default = exports.default = feedRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/figureRole.js b/node_modules/aria-query/lib/etc/roles/literal/figureRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ed465e7309112b956de443146a69b686abd5f20a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/figureRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var figureRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'figure' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = figureRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/formRole.js b/node_modules/aria-query/lib/etc/roles/literal/formRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8c286224addb38331164d2e931ac46c278478653 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/formRole.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var formRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-label' + }], + name: 'form' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-labelledby' + }], + name: 'form' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'name' + }], + name: 'form' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = formRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/genericRole.js b/node_modules/aria-query/lib/etc/roles/literal/genericRole.js new file mode 100644 index 0000000000000000000000000000000000000000..328a3480bb29bec1e19ac4adda93a215dde788fc --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/genericRole.js @@ -0,0 +1,119 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var genericRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'a' + }, + module: 'HTML' + }, { + concept: { + name: 'area' + }, + module: 'HTML' + }, { + concept: { + name: 'aside' + }, + module: 'HTML' + }, { + concept: { + name: 'b' + }, + module: 'HTML' + }, { + concept: { + name: 'bdo' + }, + module: 'HTML' + }, { + concept: { + name: 'body' + }, + module: 'HTML' + }, { + concept: { + name: 'data' + }, + module: 'HTML' + }, { + concept: { + name: 'div' + }, + module: 'HTML' + }, { + concept: { + constraints: ['scoped to the main element', 'scoped to a sectioning content element', 'scoped to a sectioning root element other than body'], + name: 'footer' + }, + module: 'HTML' + }, { + concept: { + constraints: ['scoped to the main element', 'scoped to a sectioning content element', 'scoped to a sectioning root element other than body'], + name: 'header' + }, + module: 'HTML' + }, { + concept: { + name: 'hgroup' + }, + module: 'HTML' + }, { + concept: { + name: 'i' + }, + module: 'HTML' + }, { + concept: { + name: 'pre' + }, + module: 'HTML' + }, { + concept: { + name: 'q' + }, + module: 'HTML' + }, { + concept: { + name: 'samp' + }, + module: 'HTML' + }, { + concept: { + name: 'section' + }, + module: 'HTML' + }, { + concept: { + name: 'small' + }, + module: 'HTML' + }, { + concept: { + name: 'span' + }, + module: 'HTML' + }, { + concept: { + name: 'u' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = genericRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/graphicsDocumentRole.js b/node_modules/aria-query/lib/etc/roles/literal/graphicsDocumentRole.js new file mode 100644 index 0000000000000000000000000000000000000000..fb146d0b199e65a8b17fd6ef40dffbf1b92fce84 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/graphicsDocumentRole.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsDocumentRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + module: 'GRAPHICS', + concept: { + name: 'graphics-object' + } + }, { + module: 'ARIA', + concept: { + name: 'img' + } + }, { + module: 'ARIA', + concept: { + name: 'article' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'document']] +}; +var _default = exports.default = graphicsDocumentRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/graphicsObjectRole.js b/node_modules/aria-query/lib/etc/roles/literal/graphicsObjectRole.js new file mode 100644 index 0000000000000000000000000000000000000000..5418a7fa4f7b24ea76eed98784131285f02846bb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/graphicsObjectRole.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsObjectRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [{ + module: 'GRAPHICS', + concept: { + name: 'graphics-document' + } + }, { + module: 'ARIA', + concept: { + name: 'group' + } + }, { + module: 'ARIA', + concept: { + name: 'img' + } + }, { + module: 'GRAPHICS', + concept: { + name: 'graphics-symbol' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'group']] +}; +var _default = exports.default = graphicsObjectRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/graphicsSymbolRole.js b/node_modules/aria-query/lib/etc/roles/literal/graphicsSymbolRole.js new file mode 100644 index 0000000000000000000000000000000000000000..34a61e9b604d597525a246d6705536bea289eb61 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/graphicsSymbolRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var graphicsSymbolRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'img']] +}; +var _default = exports.default = graphicsSymbolRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/gridRole.js b/node_modules/aria-query/lib/etc/roles/literal/gridRole.js new file mode 100644 index 0000000000000000000000000000000000000000..dd4873788b0c1f2203f1596b805e324884e22a00 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/gridRole.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var gridRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-multiselectable': null, + 'aria-readonly': null + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['row'], ['row', 'rowgroup']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite'], ['roletype', 'structure', 'section', 'table']] +}; +var _default = exports.default = gridRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/gridcellRole.js b/node_modules/aria-query/lib/etc/roles/literal/gridcellRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c00cf57253f887b1e6336cc43ec43e738c46ff1d --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/gridcellRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var gridcellRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-required': null, + 'aria-selected': null + }, + relatedConcepts: [{ + concept: { + constraints: ['ancestor table element has grid role', 'ancestor table element has treegrid role'], + name: 'td' + }, + module: 'HTML' + }], + requireContextRole: ['row'], + requiredContextRole: ['row'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'widget']] +}; +var _default = exports.default = gridcellRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/groupRole.js b/node_modules/aria-query/lib/etc/roles/literal/groupRole.js new file mode 100644 index 0000000000000000000000000000000000000000..84b18b4d787a9a00a558a0f352027bfbfdfae23b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/groupRole.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var groupRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-activedescendant': null, + 'aria-disabled': null + }, + relatedConcepts: [{ + concept: { + name: 'details' + }, + module: 'HTML' + }, { + concept: { + name: 'fieldset' + }, + module: 'HTML' + }, { + concept: { + name: 'optgroup' + }, + module: 'HTML' + }, { + concept: { + name: 'address' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = groupRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/headingRole.js b/node_modules/aria-query/lib/etc/roles/literal/headingRole.js new file mode 100644 index 0000000000000000000000000000000000000000..aca5b7f098dad9e308a6ff7333f4d4481973be52 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/headingRole.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var headingRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-level': '2' + }, + relatedConcepts: [{ + concept: { + name: 'h1' + }, + module: 'HTML' + }, { + concept: { + name: 'h2' + }, + module: 'HTML' + }, { + concept: { + name: 'h3' + }, + module: 'HTML' + }, { + concept: { + name: 'h4' + }, + module: 'HTML' + }, { + concept: { + name: 'h5' + }, + module: 'HTML' + }, { + concept: { + name: 'h6' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-level': '2' + }, + superClass: [['roletype', 'structure', 'sectionhead']] +}; +var _default = exports.default = headingRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/imgRole.js b/node_modules/aria-query/lib/etc/roles/literal/imgRole.js new file mode 100644 index 0000000000000000000000000000000000000000..4e788d3a85281f80b232b469cc55c16715117166 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/imgRole.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var imgRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['set'], + name: 'alt' + }], + name: 'img' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'alt' + }], + name: 'img' + }, + module: 'HTML' + }, { + concept: { + name: 'imggroup' + }, + module: 'DTB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = imgRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/insertionRole.js b/node_modules/aria-query/lib/etc/roles/literal/insertionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..0412c560ec2f5e6746f0712df0f08ebfc473f737 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/insertionRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var insertionRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'ins' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = insertionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/linkRole.js b/node_modules/aria-query/lib/etc/roles/literal/linkRole.js new file mode 100644 index 0000000000000000000000000000000000000000..110f5a1f892849b6d5394c862aa7ebf8cf8e5240 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/linkRole.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var linkRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-expanded': null, + 'aria-haspopup': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['set'], + name: 'href' + }], + name: 'a' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'href' + }], + name: 'area' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command']] +}; +var _default = exports.default = linkRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/listRole.js b/node_modules/aria-query/lib/etc/roles/literal/listRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e0ae6dcbe1395d6b2551570dbb615b0924a4680e --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/listRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var listRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'menu' + }, + module: 'HTML' + }, { + concept: { + name: 'ol' + }, + module: 'HTML' + }, { + concept: { + name: 'ul' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['listitem']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = listRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/listboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/listboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..95746cd750423ddc2168111bd21210aedb9030c8 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/listboxRole.js @@ -0,0 +1,63 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var listboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-expanded': null, + 'aria-invalid': null, + 'aria-multiselectable': null, + 'aria-readonly': null, + 'aria-required': null, + 'aria-orientation': 'vertical' + }, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['>1'], + name: 'size' + }], + constraints: ['the size attribute value is greater than 1'], + name: 'select' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'multiple' + }], + name: 'select' + }, + module: 'HTML' + }, { + concept: { + name: 'datalist' + }, + module: 'HTML' + }, { + concept: { + name: 'list' + }, + module: 'ARIA' + }, { + concept: { + name: 'select' + }, + module: 'XForms' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['option', 'group'], ['option']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']] +}; +var _default = exports.default = listboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/listitemRole.js b/node_modules/aria-query/lib/etc/roles/literal/listitemRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ab9cca8ec710b46fa489be4555a6f8fe48618971 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/listitemRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var listitemRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-level': null, + 'aria-posinset': null, + 'aria-setsize': null + }, + relatedConcepts: [{ + concept: { + constraints: ['direct descendant of ol', 'direct descendant of ul', 'direct descendant of menu'], + name: 'li' + }, + module: 'HTML' + }, { + concept: { + name: 'item' + }, + module: 'XForms' + }], + requireContextRole: ['directory', 'list'], + requiredContextRole: ['directory', 'list'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = listitemRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/logRole.js b/node_modules/aria-query/lib/etc/roles/literal/logRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8fbd3b2c5a2a76a9330f234a4bda967c4019a299 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/logRole.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var logRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-live': 'polite' + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = logRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/mainRole.js b/node_modules/aria-query/lib/etc/roles/literal/mainRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8735815b325f7bb0d1539c73058354982dba675c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/mainRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var mainRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'main' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = mainRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/markRole.js b/node_modules/aria-query/lib/etc/roles/literal/markRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2ec8d5c72774ac108032940d06c92913ccc886f9 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/markRole.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var markRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: [], + props: { + 'aria-braillelabel': null, + 'aria-brailleroledescription': null, + 'aria-description': null + }, + relatedConcepts: [{ + concept: { + name: 'mark' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = markRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/marqueeRole.js b/node_modules/aria-query/lib/etc/roles/literal/marqueeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..73962ae45f2ee8369696f494d248dbe1a984e37e --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/marqueeRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var marqueeRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = marqueeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/mathRole.js b/node_modules/aria-query/lib/etc/roles/literal/mathRole.js new file mode 100644 index 0000000000000000000000000000000000000000..6a4fee1b1ac687ef60cddcbc68606fddcc26bc22 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/mathRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var mathRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'math' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = mathRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/menuRole.js b/node_modules/aria-query/lib/etc/roles/literal/menuRole.js new file mode 100644 index 0000000000000000000000000000000000000000..2189677f4f213a8b071c8ffd7adfbeb08509ca6b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/menuRole.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var menuRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-orientation': 'vertical' + }, + relatedConcepts: [{ + concept: { + name: 'MENU' + }, + module: 'JAPI' + }, { + concept: { + name: 'list' + }, + module: 'ARIA' + }, { + concept: { + name: 'select' + }, + module: 'XForms' + }, { + concept: { + name: 'sidebar' + }, + module: 'DTB' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['menuitem', 'group'], ['menuitemradio', 'group'], ['menuitemcheckbox', 'group'], ['menuitem'], ['menuitemcheckbox'], ['menuitemradio']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']] +}; +var _default = exports.default = menuRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/menubarRole.js b/node_modules/aria-query/lib/etc/roles/literal/menubarRole.js new file mode 100644 index 0000000000000000000000000000000000000000..8977f41cd6c1616ece4d23d9b33f16379f3fad51 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/menubarRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var menubarRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-orientation': 'horizontal' + }, + relatedConcepts: [{ + concept: { + name: 'toolbar' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['menuitem', 'group'], ['menuitemradio', 'group'], ['menuitemcheckbox', 'group'], ['menuitem'], ['menuitemcheckbox'], ['menuitemradio']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'select', 'menu'], ['roletype', 'structure', 'section', 'group', 'select', 'menu']] +}; +var _default = exports.default = menubarRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/menuitemRole.js b/node_modules/aria-query/lib/etc/roles/literal/menuitemRole.js new file mode 100644 index 0000000000000000000000000000000000000000..7a3afef1416b01c3a9b5c2644fface4ca8eb6b68 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/menuitemRole.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var menuitemRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-posinset': null, + 'aria-setsize': null + }, + relatedConcepts: [{ + concept: { + name: 'MENU_ITEM' + }, + module: 'JAPI' + }, { + concept: { + name: 'listitem' + }, + module: 'ARIA' + }, { + concept: { + name: 'option' + }, + module: 'ARIA' + }], + requireContextRole: ['group', 'menu', 'menubar'], + requiredContextRole: ['group', 'menu', 'menubar'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'command']] +}; +var _default = exports.default = menuitemRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..a924e0c5d99c4ce86783c922b5b83c694d8fee2f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var menuitemcheckboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'menuitem' + }, + module: 'ARIA' + }], + requireContextRole: ['group', 'menu', 'menubar'], + requiredContextRole: ['group', 'menu', 'menubar'], + requiredOwnedElements: [], + requiredProps: { + 'aria-checked': null + }, + superClass: [['roletype', 'widget', 'input', 'checkbox'], ['roletype', 'widget', 'command', 'menuitem']] +}; +var _default = exports.default = menuitemcheckboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/menuitemradioRole.js b/node_modules/aria-query/lib/etc/roles/literal/menuitemradioRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e25d8761d8421e459b7a1c7f9c8b7ee231435b8c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/menuitemradioRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var menuitemradioRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'menuitem' + }, + module: 'ARIA' + }], + requireContextRole: ['group', 'menu', 'menubar'], + requiredContextRole: ['group', 'menu', 'menubar'], + requiredOwnedElements: [], + requiredProps: { + 'aria-checked': null + }, + superClass: [['roletype', 'widget', 'input', 'checkbox', 'menuitemcheckbox'], ['roletype', 'widget', 'command', 'menuitem', 'menuitemcheckbox'], ['roletype', 'widget', 'input', 'radio']] +}; +var _default = exports.default = menuitemradioRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/meterRole.js b/node_modules/aria-query/lib/etc/roles/literal/meterRole.js new file mode 100644 index 0000000000000000000000000000000000000000..95bca21a33d2c0088ef58c82f82b1aec0e73f654 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/meterRole.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var meterRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-valuetext': null, + 'aria-valuemax': '100', + 'aria-valuemin': '0' + }, + relatedConcepts: [{ + concept: { + name: 'meter' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-valuenow': null + }, + superClass: [['roletype', 'structure', 'range']] +}; +var _default = exports.default = meterRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/navigationRole.js b/node_modules/aria-query/lib/etc/roles/literal/navigationRole.js new file mode 100644 index 0000000000000000000000000000000000000000..71e50cf6e220c49a79a5a26090cefed1415ba518 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/navigationRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var navigationRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'nav' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = navigationRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/noneRole.js b/node_modules/aria-query/lib/etc/roles/literal/noneRole.js new file mode 100644 index 0000000000000000000000000000000000000000..db67f399376c2f62acbaf6c19bcf81c53ae58b75 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/noneRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var noneRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: [], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [] +}; +var _default = exports.default = noneRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/noteRole.js b/node_modules/aria-query/lib/etc/roles/literal/noteRole.js new file mode 100644 index 0000000000000000000000000000000000000000..87941b63de00e213cafe44db840b7417984f8ab8 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/noteRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var noteRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = noteRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/optionRole.js b/node_modules/aria-query/lib/etc/roles/literal/optionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..41c45b068b864da3dabf565dd0a3b59b642a973a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/optionRole.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var optionRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-checked': null, + 'aria-posinset': null, + 'aria-setsize': null, + 'aria-selected': 'false' + }, + relatedConcepts: [{ + concept: { + name: 'item' + }, + module: 'XForms' + }, { + concept: { + name: 'listitem' + }, + module: 'ARIA' + }, { + concept: { + name: 'option' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-selected': 'false' + }, + superClass: [['roletype', 'widget', 'input']] +}; +var _default = exports.default = optionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/paragraphRole.js b/node_modules/aria-query/lib/etc/roles/literal/paragraphRole.js new file mode 100644 index 0000000000000000000000000000000000000000..4a4b4bd9d6064dbe49b3739fa1f2a855da73c8fd --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/paragraphRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var paragraphRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'p' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = paragraphRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/presentationRole.js b/node_modules/aria-query/lib/etc/roles/literal/presentationRole.js new file mode 100644 index 0000000000000000000000000000000000000000..35bc5054abe302e0ef086132ccf8434dc30b4654 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/presentationRole.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var presentationRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'alt', + value: '' + }], + name: 'img' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = presentationRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/progressbarRole.js b/node_modules/aria-query/lib/etc/roles/literal/progressbarRole.js new file mode 100644 index 0000000000000000000000000000000000000000..6acddb978551a012e4d6aa8a2b162074867a9635 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/progressbarRole.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var progressbarRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-valuetext': null + }, + relatedConcepts: [{ + concept: { + name: 'progress' + }, + module: 'HTML' + }, { + concept: { + name: 'status' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'range'], ['roletype', 'widget']] +}; +var _default = exports.default = progressbarRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/radioRole.js b/node_modules/aria-query/lib/etc/roles/literal/radioRole.js new file mode 100644 index 0000000000000000000000000000000000000000..3f764c857951be3dd97cb09ed034953b99157475 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/radioRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var radioRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-checked': null, + 'aria-posinset': null, + 'aria-setsize': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'type', + value: 'radio' + }], + name: 'input' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-checked': null + }, + superClass: [['roletype', 'widget', 'input']] +}; +var _default = exports.default = radioRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/radiogroupRole.js b/node_modules/aria-query/lib/etc/roles/literal/radiogroupRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9c542039dddeb6a37b188ad37929871620810cdd --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/radiogroupRole.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var radiogroupRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-required': null + }, + relatedConcepts: [{ + concept: { + name: 'list' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['radio']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']] +}; +var _default = exports.default = radiogroupRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/regionRole.js b/node_modules/aria-query/lib/etc/roles/literal/regionRole.js new file mode 100644 index 0000000000000000000000000000000000000000..b9ec6c2af28a85541c56970f083af35f857b034b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/regionRole.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var regionRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-label' + }], + name: 'section' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['set'], + name: 'aria-labelledby' + }], + name: 'section' + }, + module: 'HTML' + }, { + concept: { + name: 'Device Independence Glossart perceivable unit' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = regionRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/rowRole.js b/node_modules/aria-query/lib/etc/roles/literal/rowRole.js new file mode 100644 index 0000000000000000000000000000000000000000..f234616badf73e9126d7974b96d0b082dab53636 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/rowRole.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var rowRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-colindex': null, + 'aria-expanded': null, + 'aria-level': null, + 'aria-posinset': null, + 'aria-rowindex': null, + 'aria-selected': null, + 'aria-setsize': null + }, + relatedConcepts: [{ + concept: { + name: 'tr' + }, + module: 'HTML' + }], + requireContextRole: ['grid', 'rowgroup', 'table', 'treegrid'], + requiredContextRole: ['grid', 'rowgroup', 'table', 'treegrid'], + requiredOwnedElements: [['cell'], ['columnheader'], ['gridcell'], ['rowheader']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'group'], ['roletype', 'widget']] +}; +var _default = exports.default = rowRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/rowgroupRole.js b/node_modules/aria-query/lib/etc/roles/literal/rowgroupRole.js new file mode 100644 index 0000000000000000000000000000000000000000..82441a2f0c4bf6f16d951ac504cabb008d2d8e3b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/rowgroupRole.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var rowgroupRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'tbody' + }, + module: 'HTML' + }, { + concept: { + name: 'tfoot' + }, + module: 'HTML' + }, { + concept: { + name: 'thead' + }, + module: 'HTML' + }], + requireContextRole: ['grid', 'table', 'treegrid'], + requiredContextRole: ['grid', 'table', 'treegrid'], + requiredOwnedElements: [['row']], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = rowgroupRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/rowheaderRole.js b/node_modules/aria-query/lib/etc/roles/literal/rowheaderRole.js new file mode 100644 index 0000000000000000000000000000000000000000..9009c4e6c906534649a9eb24683b07a789261600 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/rowheaderRole.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var rowheaderRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-sort': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'scope', + value: 'row' + }], + name: 'th' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + name: 'scope', + value: 'rowgroup' + }], + name: 'th' + }, + module: 'HTML' + }], + requireContextRole: ['row', 'rowgroup'], + requiredContextRole: ['row', 'rowgroup'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'structure', 'section', 'cell', 'gridcell'], ['roletype', 'widget', 'gridcell'], ['roletype', 'structure', 'sectionhead']] +}; +var _default = exports.default = rowheaderRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/scrollbarRole.js b/node_modules/aria-query/lib/etc/roles/literal/scrollbarRole.js new file mode 100644 index 0000000000000000000000000000000000000000..54e78bce8b7572ded5c1da5297aa628718745ba4 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/scrollbarRole.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var scrollbarRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-valuetext': null, + 'aria-orientation': 'vertical', + 'aria-valuemax': '100', + 'aria-valuemin': '0' + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-controls': null, + 'aria-valuenow': null + }, + superClass: [['roletype', 'structure', 'range'], ['roletype', 'widget']] +}; +var _default = exports.default = scrollbarRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/searchRole.js b/node_modules/aria-query/lib/etc/roles/literal/searchRole.js new file mode 100644 index 0000000000000000000000000000000000000000..df444189e09396df0399105b2c4cea9c276ad708 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/searchRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var searchRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'landmark']] +}; +var _default = exports.default = searchRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..ac4ccefb3ef91acc4237854067bed10906e630bb --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var searchboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'list' + }, { + name: 'type', + value: 'search' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'input', 'textbox']] +}; +var _default = exports.default = searchboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/separatorRole.js b/node_modules/aria-query/lib/etc/roles/literal/separatorRole.js new file mode 100644 index 0000000000000000000000000000000000000000..a4cc1306f3aaa428d0b395c1ba7acffb2f53d53c --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/separatorRole.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var separatorRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-orientation': 'horizontal', + 'aria-valuemax': '100', + 'aria-valuemin': '0', + 'aria-valuenow': null, + 'aria-valuetext': null + }, + relatedConcepts: [{ + concept: { + name: 'hr' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure']] +}; +var _default = exports.default = separatorRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/sliderRole.js b/node_modules/aria-query/lib/etc/roles/literal/sliderRole.js new file mode 100644 index 0000000000000000000000000000000000000000..1a7f0d6655fde0349c8fba7c186a3656dc7d2f86 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/sliderRole.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var sliderRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-haspopup': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-valuetext': null, + 'aria-orientation': 'horizontal', + 'aria-valuemax': '100', + 'aria-valuemin': '0' + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'type', + value: 'range' + }], + name: 'input' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-valuenow': null + }, + superClass: [['roletype', 'widget', 'input'], ['roletype', 'structure', 'range']] +}; +var _default = exports.default = sliderRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/spinbuttonRole.js b/node_modules/aria-query/lib/etc/roles/literal/spinbuttonRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c47cf08a7a146801682f251a1b645d9d469152cd --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/spinbuttonRole.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var spinbuttonRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null, + 'aria-readonly': null, + 'aria-required': null, + 'aria-valuetext': null, + 'aria-valuenow': '0' + }, + relatedConcepts: [{ + concept: { + attributes: [{ + name: 'type', + value: 'number' + }], + name: 'input' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite'], ['roletype', 'widget', 'input'], ['roletype', 'structure', 'range']] +}; +var _default = exports.default = spinbuttonRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/statusRole.js b/node_modules/aria-query/lib/etc/roles/literal/statusRole.js new file mode 100644 index 0000000000000000000000000000000000000000..892890f5e31807d535c1f17acc3aa6be117062cf --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/statusRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var statusRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-atomic': 'true', + 'aria-live': 'polite' + }, + relatedConcepts: [{ + concept: { + name: 'output' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = statusRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/strongRole.js b/node_modules/aria-query/lib/etc/roles/literal/strongRole.js new file mode 100644 index 0000000000000000000000000000000000000000..54e9bc829c7d8fbafb1df27327596e7d477a16b2 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/strongRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var strongRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'strong' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = strongRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/subscriptRole.js b/node_modules/aria-query/lib/etc/roles/literal/subscriptRole.js new file mode 100644 index 0000000000000000000000000000000000000000..22df2192ba9b7cb1669cb7d4e1ccd2bdf780651d --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/subscriptRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var subscriptRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'sub' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = subscriptRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/superscriptRole.js b/node_modules/aria-query/lib/etc/roles/literal/superscriptRole.js new file mode 100644 index 0000000000000000000000000000000000000000..315f0b23e55b34bbcd1a3eb2a104eed8224832f8 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/superscriptRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var superscriptRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['prohibited'], + prohibitedProps: ['aria-label', 'aria-labelledby'], + props: {}, + relatedConcepts: [{ + concept: { + name: 'sup' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = superscriptRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/switchRole.js b/node_modules/aria-query/lib/etc/roles/literal/switchRole.js new file mode 100644 index 0000000000000000000000000000000000000000..dbe5d183eddbf04c183ffc5bcb3c8db9b29cfd5b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/switchRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var switchRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'button' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: { + 'aria-checked': null + }, + superClass: [['roletype', 'widget', 'input', 'checkbox']] +}; +var _default = exports.default = switchRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/tabRole.js b/node_modules/aria-query/lib/etc/roles/literal/tabRole.js new file mode 100644 index 0000000000000000000000000000000000000000..537031ea5b9db2dc5bf8a99056668a3bf1fc44d0 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/tabRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var tabRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: true, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-disabled': null, + 'aria-expanded': null, + 'aria-haspopup': null, + 'aria-posinset': null, + 'aria-setsize': null, + 'aria-selected': 'false' + }, + relatedConcepts: [], + requireContextRole: ['tablist'], + requiredContextRole: ['tablist'], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'sectionhead'], ['roletype', 'widget']] +}; +var _default = exports.default = tabRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/tableRole.js b/node_modules/aria-query/lib/etc/roles/literal/tableRole.js new file mode 100644 index 0000000000000000000000000000000000000000..bc65d875fcd4dd0f99c48ff9ab9e789d8cc56943 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/tableRole.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var tableRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-colcount': null, + 'aria-rowcount': null + }, + relatedConcepts: [{ + concept: { + name: 'table' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['row'], ['row', 'rowgroup']], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = tableRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/tablistRole.js b/node_modules/aria-query/lib/etc/roles/literal/tablistRole.js new file mode 100644 index 0000000000000000000000000000000000000000..a422bc59c48001b5fb250fc6df5e46d53594de25 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/tablistRole.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var tablistRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-level': null, + 'aria-multiselectable': null, + 'aria-orientation': 'horizontal' + }, + relatedConcepts: [{ + module: 'DAISY', + concept: { + name: 'guide' + } + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['tab']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite']] +}; +var _default = exports.default = tablistRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/tabpanelRole.js b/node_modules/aria-query/lib/etc/roles/literal/tabpanelRole.js new file mode 100644 index 0000000000000000000000000000000000000000..e276ff9b820300d438e93094684399d3bb85ae30 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/tabpanelRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var tabpanelRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = tabpanelRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/termRole.js b/node_modules/aria-query/lib/etc/roles/literal/termRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c934ef6237d76105e8e7a788288d0f7c4e723fe4 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/termRole.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var termRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'dfn' + }, + module: 'HTML' + }, { + concept: { + name: 'dt' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = termRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/textboxRole.js b/node_modules/aria-query/lib/etc/roles/literal/textboxRole.js new file mode 100644 index 0000000000000000000000000000000000000000..3bd26717d4d4a002fb094aceab91b51bd8ae1d1d --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/textboxRole.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var textboxRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-activedescendant': null, + 'aria-autocomplete': null, + 'aria-errormessage': null, + 'aria-haspopup': null, + 'aria-invalid': null, + 'aria-multiline': null, + 'aria-placeholder': null, + 'aria-readonly': null, + 'aria-required': null + }, + relatedConcepts: [{ + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'type' + }, { + constraints: ['undefined'], + name: 'list' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'list' + }, { + name: 'type', + value: 'email' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'list' + }, { + name: 'type', + value: 'tel' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'list' + }, { + name: 'type', + value: 'text' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + attributes: [{ + constraints: ['undefined'], + name: 'list' + }, { + name: 'type', + value: 'url' + }], + constraints: ['the list attribute is not set'], + name: 'input' + }, + module: 'HTML' + }, { + concept: { + name: 'input' + }, + module: 'XForms' + }, { + concept: { + name: 'textarea' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'widget', 'input']] +}; +var _default = exports.default = textboxRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/timeRole.js b/node_modules/aria-query/lib/etc/roles/literal/timeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d07bafd9d054308059ce1c7f2b6b65875a74d287 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/timeRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var timeRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [{ + concept: { + name: 'time' + }, + module: 'HTML' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = timeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/timerRole.js b/node_modules/aria-query/lib/etc/roles/literal/timerRole.js new file mode 100644 index 0000000000000000000000000000000000000000..89983c66a334408114caf14570cbac4970a7235b --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/timerRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var timerRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'status']] +}; +var _default = exports.default = timerRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js b/node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js new file mode 100644 index 0000000000000000000000000000000000000000..53d55b834957cb1eea7898c1b8dbcab7c37bca0f --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var toolbarRole = { + abstract: false, + accessibleNameRequired: false, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-orientation': 'horizontal' + }, + relatedConcepts: [{ + concept: { + name: 'menubar' + }, + module: 'ARIA' + }], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section', 'group']] +}; +var _default = exports.default = toolbarRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/tooltipRole.js b/node_modules/aria-query/lib/etc/roles/literal/tooltipRole.js new file mode 100644 index 0000000000000000000000000000000000000000..78cc64c78d32376976dfd9daf16d2062290203dc --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/tooltipRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var tooltipRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [], + requiredProps: {}, + superClass: [['roletype', 'structure', 'section']] +}; +var _default = exports.default = tooltipRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/treeRole.js b/node_modules/aria-query/lib/etc/roles/literal/treeRole.js new file mode 100644 index 0000000000000000000000000000000000000000..d0df6dbeb9b9d7148978f47b3855a1290b7738db --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/treeRole.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var treeRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: { + 'aria-errormessage': null, + 'aria-invalid': null, + 'aria-multiselectable': null, + 'aria-required': null, + 'aria-orientation': 'vertical' + }, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['treeitem', 'group'], ['treeitem']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']] +}; +var _default = exports.default = treeRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/treegridRole.js b/node_modules/aria-query/lib/etc/roles/literal/treegridRole.js new file mode 100644 index 0000000000000000000000000000000000000000..958f1305b1836f433febf7a4ee3d88f6beb4ddd0 --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/treegridRole.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var treegridRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author'], + prohibitedProps: [], + props: {}, + relatedConcepts: [], + requireContextRole: [], + requiredContextRole: [], + requiredOwnedElements: [['row'], ['row', 'rowgroup']], + requiredProps: {}, + superClass: [['roletype', 'widget', 'composite', 'grid'], ['roletype', 'structure', 'section', 'table', 'grid'], ['roletype', 'widget', 'composite', 'select', 'tree'], ['roletype', 'structure', 'section', 'group', 'select', 'tree']] +}; +var _default = exports.default = treegridRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/etc/roles/literal/treeitemRole.js b/node_modules/aria-query/lib/etc/roles/literal/treeitemRole.js new file mode 100644 index 0000000000000000000000000000000000000000..c33b19cdfed9abd90232c5b5d3b9a481006f0c2a --- /dev/null +++ b/node_modules/aria-query/lib/etc/roles/literal/treeitemRole.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var treeitemRole = { + abstract: false, + accessibleNameRequired: true, + baseConcepts: [], + childrenPresentational: false, + nameFrom: ['author', 'contents'], + prohibitedProps: [], + props: { + 'aria-expanded': null, + 'aria-haspopup': null + }, + relatedConcepts: [], + requireContextRole: ['group', 'tree'], + requiredContextRole: ['group', 'tree'], + requiredOwnedElements: [], + requiredProps: { + 'aria-selected': null + }, + superClass: [['roletype', 'structure', 'section', 'listitem'], ['roletype', 'widget', 'input', 'option']] +}; +var _default = exports.default = treeitemRole; \ No newline at end of file diff --git a/node_modules/aria-query/lib/index.js b/node_modules/aria-query/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ef69707003d2f9732d82c7519d96b193014ff49d --- /dev/null +++ b/node_modules/aria-query/lib/index.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.roles = exports.roleElements = exports.elementRoles = exports.dom = exports.aria = void 0; +var _ariaPropsMap = _interopRequireDefault(require("./ariaPropsMap")); +var _domMap = _interopRequireDefault(require("./domMap")); +var _rolesMap = _interopRequireDefault(require("./rolesMap")); +var _elementRoleMap = _interopRequireDefault(require("./elementRoleMap")); +var _roleElementMap = _interopRequireDefault(require("./roleElementMap")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var aria = exports.aria = _ariaPropsMap.default; +var dom = exports.dom = _domMap.default; +var roles = exports.roles = _rolesMap.default; +var elementRoles = exports.elementRoles = _elementRoleMap.default; +var roleElements = exports.roleElements = _roleElementMap.default; \ No newline at end of file diff --git a/node_modules/aria-query/lib/roleElementMap.js b/node_modules/aria-query/lib/roleElementMap.js new file mode 100644 index 0000000000000000000000000000000000000000..aaef7b8b773d543b0bf5206a553dcfc457fa4a11 --- /dev/null +++ b/node_modules/aria-query/lib/roleElementMap.js @@ -0,0 +1,75 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); +var _rolesMap = _interopRequireDefault(require("./rolesMap")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +var roleElement = []; +var keys = _rolesMap.default.keys(); +for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var role = _rolesMap.default.get(key); + var relationConcepts = []; + if (role) { + var concepts = [].concat(role.baseConcepts, role.relatedConcepts); + for (var k = 0; k < concepts.length; k++) { + var relation = concepts[k]; + if (relation.module === 'HTML') { + var concept = relation.concept; + if (concept != null) { + relationConcepts.push(concept); + } + } + } + if (relationConcepts.length > 0) { + roleElement.push([key, relationConcepts]); + } + } +} +var roleElementMap = { + entries: function entries() { + return roleElement; + }, + forEach: function forEach(fn) { + var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + for (var _i = 0, _roleElement = roleElement; _i < _roleElement.length; _i++) { + var _roleElement$_i = _slicedToArray(_roleElement[_i], 2), + _key = _roleElement$_i[0], + values = _roleElement$_i[1]; + fn.call(thisArg, values, _key, roleElement); + } + }, + get: function get(key) { + var item = roleElement.filter(function (tuple) { + return tuple[0] === key ? true : false; + })[0]; + return item && item[1]; + }, + has: function has(key) { + return !!roleElementMap.get(key); + }, + keys: function keys() { + return roleElement.map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 1), + key = _ref2[0]; + return key; + }); + }, + values: function values() { + return roleElement.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + values = _ref4[1]; + return values; + }); + } +}; +var _default = exports.default = (0, _iterationDecorator.default)(roleElementMap, roleElementMap.entries()); \ No newline at end of file diff --git a/node_modules/aria-query/lib/rolesMap.js b/node_modules/aria-query/lib/rolesMap.js new file mode 100644 index 0000000000000000000000000000000000000000..9e2850e3f06936836b92940b3befdff32eafada8 --- /dev/null +++ b/node_modules/aria-query/lib/rolesMap.js @@ -0,0 +1,113 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _ariaAbstractRoles = _interopRequireDefault(require("./etc/roles/ariaAbstractRoles")); +var _ariaLiteralRoles = _interopRequireDefault(require("./etc/roles/ariaLiteralRoles")); +var _ariaDpubRoles = _interopRequireDefault(require("./etc/roles/ariaDpubRoles")); +var _ariaGraphicsRoles = _interopRequireDefault(require("./etc/roles/ariaGraphicsRoles")); +var _iterationDecorator = _interopRequireDefault(require("./util/iterationDecorator")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +var roles = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default, _ariaGraphicsRoles.default); +roles.forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + roleDefinition = _ref2[1]; + // Conglomerate the properties + var _iterator = _createForOfIteratorHelper(roleDefinition.superClass), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var superClassIter = _step.value; + var _iterator2 = _createForOfIteratorHelper(superClassIter), + _step2; + try { + var _loop = function _loop() { + var superClassName = _step2.value; + var superClassRoleTuple = roles.filter(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 1), + name = _ref4[0]; + return name === superClassName; + })[0]; + if (superClassRoleTuple) { + var superClassDefinition = superClassRoleTuple[1]; + for (var _i = 0, _Object$keys = Object.keys(superClassDefinition.props); _i < _Object$keys.length; _i++) { + var prop = _Object$keys[_i]; + if ( + // $FlowIssue Accessing the hasOwnProperty on the Object prototype is fine. + !Object.prototype.hasOwnProperty.call(roleDefinition.props, prop)) { + // $FlowIgnore assigning without an index signature is fine + roleDefinition.props[prop] = superClassDefinition.props[prop]; + } + } + } + }; + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + _loop(); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } +}); +var rolesMap = { + entries: function entries() { + return roles; + }, + forEach: function forEach(fn) { + var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var _iterator3 = _createForOfIteratorHelper(roles), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var _step3$value = _slicedToArray(_step3.value, 2), + key = _step3$value[0], + values = _step3$value[1]; + fn.call(thisArg, values, key, roles); + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + }, + get: function get(key) { + var item = roles.filter(function (tuple) { + return tuple[0] === key ? true : false; + })[0]; + return item && item[1]; + }, + has: function has(key) { + return !!rolesMap.get(key); + }, + keys: function keys() { + return roles.map(function (_ref5) { + var _ref6 = _slicedToArray(_ref5, 1), + key = _ref6[0]; + return key; + }); + }, + values: function values() { + return roles.map(function (_ref7) { + var _ref8 = _slicedToArray(_ref7, 2), + values = _ref8[1]; + return values; + }); + } +}; +var _default = exports.default = (0, _iterationDecorator.default)(rolesMap, rolesMap.entries()); \ No newline at end of file diff --git a/node_modules/aria-query/lib/util/iterationDecorator.js b/node_modules/aria-query/lib/util/iterationDecorator.js new file mode 100644 index 0000000000000000000000000000000000000000..779fa59ef9fca35e915124264ecd80d900c243de --- /dev/null +++ b/node_modules/aria-query/lib/util/iterationDecorator.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = iterationDecorator; +var _iteratorProxy = _interopRequireDefault(require("./iteratorProxy")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function iterationDecorator(collection, entries) { + if (typeof Symbol === 'function' && _typeof(Symbol.iterator) === 'symbol') { + Object.defineProperty(collection, Symbol.iterator, { + value: _iteratorProxy.default.bind(entries) + }); + } + return collection; +} \ No newline at end of file diff --git a/node_modules/aria-query/lib/util/iteratorProxy.js b/node_modules/aria-query/lib/util/iteratorProxy.js new file mode 100644 index 0000000000000000000000000000000000000000..9e3d637b28d1087a08ef9e1bc6a7a7887467fb34 --- /dev/null +++ b/node_modules/aria-query/lib/util/iteratorProxy.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +// eslint-disable-next-line no-unused-vars +function iteratorProxy() { + var values = this; + var index = 0; + var iter = { + '@@iterator': function iterator() { + return iter; + }, + next: function next() { + if (index < values.length) { + var value = values[index]; + index = index + 1; + return { + done: false, + value: value + }; + } else { + return { + done: true + }; + } + } + }; + return iter; +} +var _default = exports.default = iteratorProxy; \ No newline at end of file diff --git a/node_modules/aria-query/package.json b/node_modules/aria-query/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d523cce8026721229f4159d3dfa10f47e9fca2ae --- /dev/null +++ b/node_modules/aria-query/package.json @@ -0,0 +1,70 @@ +{ + "name": "aria-query", + "version": "5.3.2", + "description": "Programmatic access to the ARIA specification", + "main": "lib/index.js", + "files": [ + "lib" + ], + "scripts": { + "prepack": "npm run build", + "prebuild": "rimraf lib", + "build": "babel src --out-dir lib", + "lint": "eslint --ext=js,mjs .", + "prepublishOnly": "npm run build", + "pretest": "npm run lint && flow", + "build:tests": "npm run build && rimraf __tests-built__ && BABEL_ENV=test babel __tests__ --out-dir __tests-built__", + "tests-built": "nyc tape --strict -r array.from/auto '__tests-built__/**/*.js'", + "tests-only": "nyc tape --strict -r @babel/register '__tests__/**/*.js'", + "test": "npm run tests-only", + "posttest": "npm audit --production", + "output_as_hack": "babel-node ./scripts/output_as_hack.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/A11yance/aria-query.git" + }, + "keywords": [ + "accessibility", + "ARIA" + ], + "author": "Jesse Beach ", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/A11yance/aria-query/issues" + }, + "homepage": "https://github.com/A11yance/aria-query#readme", + "devDependencies": { + "@babel/cli": "^7.25.6", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/node": "^7.25.0", + "@babel/plugin-transform-react-jsx": "^7.25.2", + "@babel/preset-env": "^7.25.4", + "@babel/preset-flow": "^7.24.7", + "@babel/register": "^7.24.6", + "array.from": "^1.1.6", + "array.prototype.some": "^1.1.6", + "babel-plugin-module-resolver": "^5.0.2", + "commander": "^9.4.1", + "deep-equal-json": "^1.0.0", + "eslint": "^8.57.0", + "eslint-plugin-flowtype": "^8.0.3", + "flow-bin": "^0.191.0", + "mock-property": "^1.1.0", + "nyc": "^10.3.2", + "object-inspect": "^1.13.2", + "object.values": "^1.2.0", + "rimraf": "^2.7.1", + "tape": "^5.9.0" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not op_mini all", + "ie 11" + ], + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/array-buffer-byte-length/.eslintrc b/node_modules/array-buffer-byte-length/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..fe2fefe961454cb2a48eabf78507593ea7590af5 --- /dev/null +++ b/node_modules/array-buffer-byte-length/.eslintrc @@ -0,0 +1,9 @@ +{ + "root": true, + + "extends": "@ljharb", + + "globals": { + "DataView": false, + }, +} diff --git a/node_modules/array-buffer-byte-length/.github/FUNDING.yml b/node_modules/array-buffer-byte-length/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..b3b30fa8b862410d0dc08e14b359080f23b4dd89 --- /dev/null +++ b/node_modules/array-buffer-byte-length/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/array-buffer-byte-length +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/array-buffer-byte-length/.nycrc b/node_modules/array-buffer-byte-length/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..1826526e091b89c896e7099ccd891db79165e329 --- /dev/null +++ b/node_modules/array-buffer-byte-length/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/array-buffer-byte-length/CHANGELOG.md b/node_modules/array-buffer-byte-length/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..dad50cd02965d90b9c3d7df7b0eec56363d85a49 --- /dev/null +++ b/node_modules/array-buffer-byte-length/CHANGELOG.md @@ -0,0 +1,43 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/inspect-js/array-buffer-byte-length/compare/v1.0.1...v1.0.2) - 2024-12-19 + +### Commits + +- [types] use shared config [`b15321c`](https://github.com/inspect-js/array-buffer-byte-length/commit/b15321cf546dae5d3bc2b354fb8e2a4629d6afb3) +- [actions] split out node 10-20, and 20+ [`fa1eb7d`](https://github.com/inspect-js/array-buffer-byte-length/commit/fa1eb7df107d382b47d7b9e7a07e1c4588e81cbd) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `es-value-fixtures`, `object-inspect`, `tape` [`53e3f93`](https://github.com/inspect-js/array-buffer-byte-length/commit/53e3f93c456b7a8a8217a832b48c416962a176e0) +- [Tests] replace `aud` with `npm audit` [`2d1b66f`](https://github.com/inspect-js/array-buffer-byte-length/commit/2d1b66ff6417b825f58adf859b540c2303d2dbde) +- [Refactor] use `call-bound` directly [`433be34`](https://github.com/inspect-js/array-buffer-byte-length/commit/433be3427e20526d74ab1faaaf0117aaf967f406) +- [Deps] update `call-bind`, `is-array-buffer` [`4ff7467`](https://github.com/inspect-js/array-buffer-byte-length/commit/4ff74673567dcae00e5a8c5d4d0f8c23b29c9a0a) +- [Dev Deps] update `tape`, `typescript` [`42c9f19`](https://github.com/inspect-js/array-buffer-byte-length/commit/42c9f1998fe8630634388b6db2c0563be05c6897) +- [Tests] add attw [`29a72f1`](https://github.com/inspect-js/array-buffer-byte-length/commit/29a72f12eb83dcfaef6a6bed0403e56699669f27) +- [Deps] update `call-bind` [`1e9e902`](https://github.com/inspect-js/array-buffer-byte-length/commit/1e9e90292388a609aa0e722bddbc9313a575ef10) +- [types] remove incorrect overload [`b509518`](https://github.com/inspect-js/array-buffer-byte-length/commit/b509518bc188f79c46aa851311f20c188faa0678) +- [Dev Deps] add missing peer dep [`31962b6`](https://github.com/inspect-js/array-buffer-byte-length/commit/31962b631a173696ceef94e9d00edf13af87d305) + +## [v1.0.1](https://github.com/inspect-js/array-buffer-byte-length/compare/v1.0.0...v1.0.1) - 2024-02-03 + +### Commits + +- [patch] add types [`598d446`](https://github.com/inspect-js/array-buffer-byte-length/commit/598d446f45c8f4246493b2a1fa2b32cd0c669602) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `object-inspect`, `tape` [`2572345`](https://github.com/inspect-js/array-buffer-byte-length/commit/257234593f576a7cbb1dce1b21d52abeb68db34d) +- [Tests] add coverage [`d27357d`](https://github.com/inspect-js/array-buffer-byte-length/commit/d27357de558c3272341e252c3acc010d38edeb0f) +- [Deps] update `call-bind`, `is-array-buffer` [`2ea13ad`](https://github.com/inspect-js/array-buffer-byte-length/commit/2ea13adc85b7d775d1649ac8e9469ac380cb3665) +- [meta] add missing `engines.node` [`380e96d`](https://github.com/inspect-js/array-buffer-byte-length/commit/380e96d1c91dd579df0261950b46b62d4fed7a23) +- [Deps] update `is-array-buffer` [`cfa7093`](https://github.com/inspect-js/array-buffer-byte-length/commit/cfa7093daaeeccbaa5228a22e6ec32a307d81549) +- [meta] add `sideEffects` flag [`7297ddd`](https://github.com/inspect-js/array-buffer-byte-length/commit/7297dddd40a8f310bb69726a7a6edfae6111b8de) + +## v1.0.0 - 2023-02-28 + +### Commits + +- Initial implementation, tests, readme [`2db6cad`](https://github.com/inspect-js/array-buffer-byte-length/commit/2db6cad79270ab1966f5ea80160abbcd4534c91d) +- Initial commit [`b2a0c9c`](https://github.com/inspect-js/array-buffer-byte-length/commit/b2a0c9c2246514b7999d331aad868c4f32326db7) +- npm init [`376acdb`](https://github.com/inspect-js/array-buffer-byte-length/commit/376acdbd4435cb1d4c31d107cacb3b86f2363aee) +- Only apps should have lockfiles [`70cf325`](https://github.com/inspect-js/array-buffer-byte-length/commit/70cf32526fc727d0d16a12d85a4bddea70075e31) diff --git a/node_modules/array-buffer-byte-length/LICENSE b/node_modules/array-buffer-byte-length/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5ea30366fa48dfde3ad3548b09d05ed54fbe319f --- /dev/null +++ b/node_modules/array-buffer-byte-length/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Inspect JS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/array-buffer-byte-length/README.md b/node_modules/array-buffer-byte-length/README.md new file mode 100644 index 0000000000000000000000000000000000000000..64836c23197161aa6383a0f4f602f7fa814f4b21 --- /dev/null +++ b/node_modules/array-buffer-byte-length/README.md @@ -0,0 +1,40 @@ +# array-buffer-byte-length [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method. + +## Example + +```js +const assert = require('assert'); +const byteLength = require('array-buffer-byte-length'); + +assert.equal(byteLength([]), NaN, 'an array is not an ArrayBuffer, yields NaN'); + +assert.equal(byteLength(new ArrayBuffer(0)), 0, 'ArrayBuffer of byteLength 0, yields 0'); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/array-buffer-byte-length +[npm-version-svg]: https://versionbadg.es/inspect-js/array-buffer-byte-length.svg +[deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length.svg +[deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length +[dev-deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/array-buffer-byte-length.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/array-buffer-byte-length.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/array-buffer-byte-length.svg +[downloads-url]: https://npm-stat.com/charts.html?package=array-buffer-byte-length +[codecov-image]: https://codecov.io/gh/inspect-js/array-buffer-byte-length/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/array-buffer-byte-length/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/array-buffer-byte-length +[actions-url]: https://github.com/inspect-js/array-buffer-byte-length/actions diff --git a/node_modules/array-buffer-byte-length/index.d.ts b/node_modules/array-buffer-byte-length/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8594b49d3eba4e6d1e50dd2b7e0fb87e6d3f1df --- /dev/null +++ b/node_modules/array-buffer-byte-length/index.d.ts @@ -0,0 +1,4 @@ +declare function arrayBufferByteLength(buffer: ArrayBuffer): number; +declare function arrayBufferByteLength(buffer: unknown): typeof NaN; + +export = arrayBufferByteLength; diff --git a/node_modules/array-buffer-byte-length/index.js b/node_modules/array-buffer-byte-length/index.js new file mode 100644 index 0000000000000000000000000000000000000000..de1be39efa7527d777f6b18c07c52dde1d6a6f60 --- /dev/null +++ b/node_modules/array-buffer-byte-length/index.js @@ -0,0 +1,14 @@ +'use strict'; + +var callBound = require('call-bound'); +var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true); + +var isArrayBuffer = require('is-array-buffer'); + +/** @type {import('.')} */ +module.exports = function byteLength(ab) { + if (!isArrayBuffer(ab)) { + return NaN; + } + return $byteLength ? $byteLength(ab) : ab.byteLength; +}; // in node < 0.11, byteLength is an own nonconfigurable property diff --git a/node_modules/array-buffer-byte-length/package.json b/node_modules/array-buffer-byte-length/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f97c95215a4d9caff6a7f22c24ddd18079424ab1 --- /dev/null +++ b/node_modules/array-buffer-byte-length/package.json @@ -0,0 +1,94 @@ +{ + "name": "array-buffer-byte-length", + "version": "1.0.2", + "description": "Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "keywords": [ + "shim", + "polyfill", + "ArrayBuffer", + "byteLength", + "byte", + "length", + "es-shim API", + "es-shims" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/array-buffer-byte-length.git" + }, + "bugs": { + "url": "https://github.com/inspect-js/array-buffer-byte-length/issues" + }, + "homepage": "https://github.com/inspect-js/array-buffer-byte-length#readme", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.5.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "test/index.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/array-buffer-byte-length/test/index.js b/node_modules/array-buffer-byte-length/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fb328d10be3976d4af99ffe4e2a6521ca7c512f3 --- /dev/null +++ b/node_modules/array-buffer-byte-length/test/index.js @@ -0,0 +1,29 @@ +'use strict'; + +var test = require('tape'); +var forEach = require('for-each'); +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); + +var byteLength = require('../'); + +test('byteLength', function (t) { + forEach(v.objects.concat(v.primitives), function (nonAB) { + t.equal(byteLength(nonAB), NaN, inspect(nonAB) + ' is not an ArrayBuffer, and yields NaN'); + }); + + t.test('ArrayBuffers', { skip: typeof ArrayBuffer !== 'function' }, function (st) { + var ab32 = new ArrayBuffer(32); + st.equal(byteLength(ab32), 32, 'works on an ArrayBuffer of length 32: ' + inspect(ab32)); + + var ab0 = new ArrayBuffer(0); + st.equal(byteLength(ab0), 0, 'works on an ArrayBuffer of length 0: ' + inspect(ab0)); + + var dv = new DataView(ab32); + st.equal(byteLength(dv), NaN, 'a DataView returns NaN'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/array-buffer-byte-length/tsconfig.json b/node_modules/array-buffer-byte-length/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..b9fbbf12f8d0e5d60469d364c4aa201ec7d63fed --- /dev/null +++ b/node_modules/array-buffer-byte-length/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/arraybuffer.prototype.slice/.editorconfig b/node_modules/arraybuffer.prototype.slice/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..eaa214161f5cdb409c32465fd822624c633a6bd8 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/arraybuffer.prototype.slice/.eslintrc b/node_modules/arraybuffer.prototype.slice/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..963e2a847aba424bfeacf333d34d9c35cc5ff574 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/.eslintrc @@ -0,0 +1,34 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-params": 0, + "max-statements": 0, + "multiline-comment-style": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "IsSharedArrayBuffer", + "ToIntegerOrInfinity", + "GetIntrinsic", + "IsDetachedBuffer", + "SpeciesConstructor", + ], + }], + }, + + "overrides": [ + { + "files": "test/**", + "globals": { + "ArrayBuffer": false, + "Uint8Array": false, + }, + "rules": { + "max-lines-per-function": 0, + }, + }, + ], +} diff --git a/node_modules/arraybuffer.prototype.slice/.nycrc b/node_modules/arraybuffer.prototype.slice/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/arraybuffer.prototype.slice/CHANGELOG.md b/node_modules/arraybuffer.prototype.slice/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..5ba5072d277aac7e5ec7e8decd607c759ab077ba --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/CHANGELOG.md @@ -0,0 +1,52 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.4](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.3...v1.0.4) - 2024-12-15 + +### Commits + +- [actions] split out node 10-20, and 20+ [`5e59635`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/5e59635c948994b613c544b4e94fe93536d6b213) +- [Deps] update `call-bind`, `es-abstract`, `get-intrinsic` [`0afbb59`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/0afbb5942574055a8a3afdf0f69f60313e3f1af2) +- [Dev Deps] update `@es-shims/api`, `auto-changelog`, `es-value-fixtures`, `object-inspect`, `tape` [`d76caf4`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/d76caf4880ef358cf5384a6eb29d0f2f67e4d3a8) +- [Deps] update `call-bind`, `es-abstract`, `es-errors`, `get-intrinsic` [`2b374a2`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/2b374a2d4078d9122ac30bdecd8a8fae740aa74c) +- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `object-inspect`, `tape` [`a24fd39`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/a24fd39370d891ea3439f9d7a1c42183c0aa1bf7) +- [Tests] replace `aud` with `npm audit` [`c704fb0`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/c704fb0b1651ceb56b609a5b4646a993fc868219) +- [Deps] remove unused dependency [`0274b32`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/0274b32ab1d345fbf70745a79dd7a44f844179bb) +- [Dev Deps] add missing peer dep [`673f754`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/673f754797dd0c40801cca2f32ff08b372448c6b) + +## [v1.0.3](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.2...v1.0.3) - 2024-02-04 + +### Commits + +- [Deps] update `array-buffer-byte-length`, `call-bind`, `define-properties`, `es-abstract`, `get-intrinsic`, `is-array-buffer` [`d9b6859`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/d9b68591ff509613d0dfc4036539ba4e0dc34931) +- [Dev Deps] update `aud`, `npmignore`, `object-inspect`, `tape` [`38cb58d`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/38cb58dfa3f3c8b11bfb2144f8e7cc74dd461f5e) +- [Refactor] use `es-errors` where possible, so things that only need those do not need `get-intrinsic` [`5c07bef`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/5c07befd134cae93ad5f9ab307ff67691ff5155b) + +## [v1.0.2](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.1...v1.0.2) - 2023-09-05 + +### Commits + +- [Deps] update `es-abstract` [`a9ab0d2`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/a9ab0d2551bb301b740e333ea3795fad23fcbe40) +- [Dev Deps] update `tape` [`6b24af5`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/6b24af585dc9176c8ac3fd482cb1d5257e550a09) +- [Fix] move `es-abstract` to runtime deps [`63a8397`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/63a8397623d7749856f6392ae93bf87152c3916c) + +## [v1.0.1](https://github.com/es-shims/ArrayBuffer.prototype.slice/compare/v1.0.0...v1.0.1) - 2023-07-11 + +### Commits + +- [Fix] node < 0.11 has an own nonconfigurable `slice` property; use it [`554823c`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/554823c92ce16d6b7184a7d0ccfe315b663584d7) +- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `tape` [`53b0421`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/53b04217048c645306597e2cfc55adb69c384146) +- [Deps] update `define-properties`, `get-intrinsic` [`4966b02`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/4966b02bc25ac006709b29ca370b9f6e159f723a) + +## v1.0.0 - 2023-07-09 + +### Commits + +- Initial implementation, tests, readme [`36b4b5e`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/36b4b5eedfa225c3086e9453b9db0088c299640a) +- Initial commit [`51499df`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/51499dfac7d8c67c2928cb47363a4de7ff17904a) +- npm init [`8ec604e`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/8ec604e7d3ef8d4c27376b09645f779c2244b08f) +- Only apps should have lockfiles [`ac54435`](https://github.com/es-shims/ArrayBuffer.prototype.slice/commit/ac54435161d4415e2122e3a682499f3a6df2f6de) diff --git a/node_modules/arraybuffer.prototype.slice/LICENSE b/node_modules/arraybuffer.prototype.slice/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eb970aa5c97e857bc35d652dafc6976006dc6ec5 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/arraybuffer.prototype.slice/README.md b/node_modules/arraybuffer.prototype.slice/README.md new file mode 100644 index 0000000000000000000000000000000000000000..503585715baa221167b052c9dfb2c1b2fe6cecca --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/README.md @@ -0,0 +1,61 @@ +# ArrayBuffer.prototype.slice [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +An ES spec-compliant `ArrayBuffer.prototype.slice` shim. Invoke its "shim" method to shim ArrayBuffer.prototype.slice if it is unavailable. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice). + +Most common usage: +```js +var assert = require('assert'); +var slice = require('arraybuffer.prototype.slice'); + +var ab = new ArrayBuffer(1); +var arr = new Uint8Array(ab); +arr[0] = 123; + +var ab2 = slice(ab); + +var arr2 = new Uint8Array(ab2); +arr2[0] = 234; + +assert.deepEqual(arr, new Uint8Array([123])); +assert.deepEqual(arr2, new Uint8Array([234])); + +if (!ArrayBuffer.prototype.transfer) { + slice.shim(); +} + +var ab2 = ab.slice(); + +var arr2 = new Uint8Array(ab2); +arr2[0] = 234; + +assert.deepEqual(arr, new Uint8Array([123])); +assert.deepEqual(arr2, new Uint8Array([234])); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/arraybuffer.prototype.slice +[npm-version-svg]: https://versionbadg.es/es-shims/ArrayBuffer.prototype.slice.svg +[deps-svg]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice.svg +[deps-url]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice +[dev-deps-svg]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/arraybuffer.prototype.slice.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/arraybuffer.prototype.slice.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/arraybuffer.prototype.slice.svg +[downloads-url]: https://npm-stat.com/charts.html?package=arraybuffer.prototype.slice +[codecov-image]: https://codecov.io/gh/es-shims/ArrayBuffer.prototype.slice/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/ArrayBuffer.prototype.slice/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/ArrayBuffer.prototype.slice +[actions-url]: https://github.com/es-shims/ArrayBuffer.prototype.slice/actions diff --git a/node_modules/arraybuffer.prototype.slice/auto.js b/node_modules/arraybuffer.prototype.slice/auto.js new file mode 100644 index 0000000000000000000000000000000000000000..8ebf606cb02ff3a8c6ef786afa37d21a19254f46 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/arraybuffer.prototype.slice/implementation.js b/node_modules/arraybuffer.prototype.slice/implementation.js new file mode 100644 index 0000000000000000000000000000000000000000..49ed964415147037ddd814ca03ef9f47f70e646c --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/implementation.js @@ -0,0 +1,84 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $ArrayBuffer = GetIntrinsic('%ArrayBuffer%', true); +var $Uint8Array = GetIntrinsic('%Uint8Array%', true); + +var IsDetachedBuffer = require('es-abstract/2024/IsDetachedBuffer'); +var IsSharedArrayBuffer = require('es-abstract/2024/IsSharedArrayBuffer'); +var max = require('es-abstract/2024/max'); +var min = require('es-abstract/2024/min'); +var SpeciesConstructor = require('es-abstract/2024/SpeciesConstructor'); +var ToIntegerOrInfinity = require('es-abstract/2024/ToIntegerOrInfinity'); + +var arrayBufferByteLength = require('array-buffer-byte-length'); +var isArrayBuffer = require('is-array-buffer'); +var $TypeError = require('es-errors/type'); + +module.exports = function slice(start, end) { + var O = this; // step 1 + + if (!isArrayBuffer(O) || IsSharedArrayBuffer(O) || IsDetachedBuffer(O)) { + throw new $TypeError('receiver must be a non-detached, non-shared ArrayBuffer'); // steps 2-4 + } + + var len = arrayBufferByteLength(O); // step 5 + + var relativeStart = ToIntegerOrInfinity(start); // step 6 + + var first; + if (relativeStart === -Infinity) { + first = 0; // step 7 + } else if (relativeStart < 0) { + first = max(len + relativeStart, 0); // step 8 + } else { + first = min(relativeStart, len); // step 9 + } + + var relativeEnd = typeof end === 'undefined' ? len : ToIntegerOrInfinity(end); // step 10 + + var final; + if (relativeEnd === -Infinity) { + final = 0; // step 11 + } else if (relativeEnd < 0) { + final = max(len + relativeEnd, 0); // step 12 + } else { + final = min(relativeEnd, len); // step 13 + } + + var newLen = max(final - first, 0); // step 14 + + var Ctor = SpeciesConstructor(O, $ArrayBuffer); // step 15 + + var new$ = new Ctor(newLen); // step 16 + + if (!isArrayBuffer(new$) || IsSharedArrayBuffer(new$) || IsDetachedBuffer(new$)) { + throw new $TypeError('Species constructor must produce a non-detached, non-shared Array Buffer'); // steps 17-19 + } + + if (new$ === O) { + throw new $TypeError('new ArrayBuffer should not have been the same as the receiver'); // step 20 + } + + if (arrayBufferByteLength(new$) < newLen) { + throw new $TypeError('new ArrayBuffer\'s byteLength must be at least the requested length'); // step 21 + } + + if (IsDetachedBuffer(O)) { + throw new $TypeError('receiver became an detached ArrayBuffer'); // step 23 + } + + /* + 24. Let fromBuf be O.[[ArrayBufferData]]. + 25. Let toBuf be new.[[ArrayBufferData]]. + 26. Perform CopyDataBlockBytes(toBuf, 0, fromBuf, first, newLen). + */ + var sourceArr = new $Uint8Array(O); + var destArr = new $Uint8Array(new$); + for (var i = start, ii = 0; i < end; i++, ii++) { + destArr[ii] = sourceArr[i]; + } + + return new$; // step 27 +}; diff --git a/node_modules/arraybuffer.prototype.slice/index.js b/node_modules/arraybuffer.prototype.slice/index.js new file mode 100644 index 0000000000000000000000000000000000000000..517c4147e95eb17c4f92a9583e020b7971762c8e --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var define = require('define-properties'); +var callBind = require('call-bind'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var bound = callBind(getPolyfill()); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; diff --git a/node_modules/arraybuffer.prototype.slice/package.json b/node_modules/arraybuffer.prototype.slice/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c4d6c9e96ed80103d0234c31192f5cafcc40fe02 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/package.json @@ -0,0 +1,102 @@ +{ + "name": "arraybuffer.prototype.slice", + "version": "1.0.4", + "description": "ES spec-compliant shim for ArrayBuffer.prototype.slice", + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "main": "index.js", + "exports": { + ".": "./index.js", + "./auto": "./auto.js", + "./polyfill": "./polyfill.js", + "./implementation": "./implementation.js", + "./shim": "./shim.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "tests-only": "nyc tape 'test/**/*.js'", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "evalmd README.md && es-shim-api --bound", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/ArrayBuffer.prototype.slice.git" + }, + "homepage": "https://github.com/es-shims/ArrayBuffer.prototype.slice#readme", + "bugs": { + "url": "https://github.com/es-shims/ArrayBuffer.prototype.slice/issues" + }, + "keywords": [ + "javascript", + "ecmascript", + "ArrayBuffer.prototype.slice", + "polyfill", + "shim", + "ArrayBuffer", + "array", + "buffer", + "ArrayBuffer#slice", + "slice", + "typed array", + "es-shim API" + ], + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "devDependencies": { + "@es-shims/api": "^2.5.1", + "@ljharb/eslint-config": "^21.1.1", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.5.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "functions-have-names": "^1.2.3", + "has-strict-mode": "^1.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0" + }, + "testling": { + "files": "test/index.js" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/arraybuffer.prototype.slice/polyfill.js b/node_modules/arraybuffer.prototype.slice/polyfill.js new file mode 100644 index 0000000000000000000000000000000000000000..a4a90ca166ee027f736734902943b2001a8ebe98 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/polyfill.js @@ -0,0 +1,21 @@ +'use strict'; + +var callBind = require('call-bind'); + +var implementation = require('./implementation'); + +var ownSlice = typeof ArrayBuffer === 'function' && new ArrayBuffer(0).slice; +var ownSliceBound = ownSlice && callBind(ownSlice); +var ownSliceWrapper = ownSliceBound && function slice(start, end) { + /* eslint no-invalid-this: 0 */ + if (arguments.length < 2) { + return ownSliceBound(this, arguments.length > 0 ? start : 0); + } + return ownSliceBound(this, start, end); +}; + +module.exports = function getPolyfill() { + return (typeof ArrayBuffer === 'function' && ArrayBuffer.prototype.slice) + || ownSliceWrapper + || implementation; +}; diff --git a/node_modules/arraybuffer.prototype.slice/shim.js b/node_modules/arraybuffer.prototype.slice/shim.js new file mode 100644 index 0000000000000000000000000000000000000000..cb52c0710281803247e13a827ea429212ad662b2 --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/shim.js @@ -0,0 +1,18 @@ +'use strict'; + +var define = require('define-properties'); + +var getPolyfill = require('./polyfill'); + +module.exports = function shimArrayBufferSlice() { + if (typeof ArrayBuffer === 'function') { + var polyfill = getPolyfill(); + define( + ArrayBuffer.prototype, + { slice: polyfill }, + { slice: function () { return ArrayBuffer.prototype.slice !== polyfill; } } + ); + } + + return polyfill; +}; diff --git a/node_modules/arraybuffer.prototype.slice/test/implementation.js b/node_modules/arraybuffer.prototype.slice/test/implementation.js new file mode 100644 index 0000000000000000000000000000000000000000..7d97bb77c3e91762b2fcce32cc888e221add14aa --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/test/implementation.js @@ -0,0 +1,32 @@ +'use strict'; + +var implementation = require('../implementation'); +var callBind = require('call-bind'); +var test = require('tape'); +var hasStrictMode = require('has-strict-mode')(); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('ArrayBuffer support', { skip: typeof ArrayBuffer === 'undefined' }, function (st) { + st.test('bad array/this value', { skip: !hasStrictMode }, function (s2t) { + /* eslint no-useless-call: 0 */ + s2t['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object'); + s2t['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object'); + s2t.end(); + }); + + runTests(callBind(implementation), st); + + st.end(); + }); + + t.test('no ArrayBuffer support', { skip: typeof ArrayBuffer !== 'undefined' }, function (st) { + st['throws']( + function () { implementation.call({}); }, + SyntaxError, + 'ArrayBuffer is not supported' + ); + }); + + t.end(); +}); diff --git a/node_modules/arraybuffer.prototype.slice/test/index.js b/node_modules/arraybuffer.prototype.slice/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0e9dd102cd8e7d63b454f9562d4b548a6b4135ac --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/test/index.js @@ -0,0 +1,29 @@ +'use strict'; + +var index = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + t.test('ArrayBuffer support', { skip: typeof ArrayBuffer === 'undefined' }, function (st) { + st.test('bad array/this value', function (s2t) { + s2t['throws'](function () { index(undefined); }, TypeError, 'undefined is not an object'); + s2t['throws'](function () { index(null); }, TypeError, 'null is not an object'); + s2t.end(); + }); + + runTests(index, st); + + st.end(); + }); + + t.test('no ArrayBuffer support', { skip: typeof ArrayBuffer !== 'undefined' }, function (st) { + st['throws']( + function () { index({}); }, + SyntaxError, + 'ArrayBuffer is not supported' + ); + }); + + t.end(); +}); diff --git a/node_modules/arraybuffer.prototype.slice/test/shimmed.js b/node_modules/arraybuffer.prototype.slice/test/shimmed.js new file mode 100644 index 0000000000000000000000000000000000000000..8dd4f72142e89a94bbed91769a5327018548e77b --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/test/shimmed.js @@ -0,0 +1,54 @@ +'use strict'; + +require('../auto'); + +var test = require('tape'); +var defineProperties = require('define-properties'); +var callBind = require('call-bind'); + +var isEnumerable = Object.prototype.propertyIsEnumerable; +var functionsHaveNames = require('functions-have-names')(); +var hasStrictMode = require('has-strict-mode')(); + +var runTests = require('./tests'); + +test('shimmed', function (t) { + t.test('ArrayBuffer support', { skip: typeof ArrayBuffer === 'undefined' }, function (st) { + var method = ArrayBuffer.prototype.slice; + + st.equal(method.length, 2, 'ArrayBuffer#slice has a length of 2'); + + st.test('Function name', { skip: !functionsHaveNames }, function (s2t) { + s2t.equal(method.name, 'slice', 'ArrayBuffer#slice name "slice"'); + s2t.end(); + }); + + st.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(ArrayBuffer.prototype, 'slice'), 'ArrayBuffer#slice is not enumerable'); + et.end(); + }); + + st.test('bad array/this value', { skip: !hasStrictMode }, function (s2t) { + /* eslint no-useless-call: 0 */ + s2t['throws'](function () { return method.call(undefined); }, TypeError, 'undefined is not an object'); + s2t['throws'](function () { return method.call(null); }, TypeError, 'null is not an object'); + s2t.end(); + }); + + t.test('has the correct descriptor', { skip: !Object.getOwnPropertyDescriptor }, function (s2t) { + var descriptor = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'slice'); + + s2t.equal(descriptor.configurable, true); + s2t.equal(descriptor.enumerable, false); + s2t.equal(typeof descriptor.value, 'function'); + s2t.equal(descriptor.writable, true); + s2t.end(); + }); + + runTests(callBind(method), st); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/arraybuffer.prototype.slice/test/tests.js b/node_modules/arraybuffer.prototype.slice/test/tests.js new file mode 100644 index 0000000000000000000000000000000000000000..4128b1b9fd16569649e115ecd72483f16433f88b --- /dev/null +++ b/node_modules/arraybuffer.prototype.slice/test/tests.js @@ -0,0 +1,81 @@ +'use strict'; + +var inspect = require('object-inspect'); +var IsDetachedBuffer = require('es-abstract/2024/IsDetachedBuffer'); + +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var byteLength = require('array-buffer-byte-length'); + +module.exports = function runTests(slice, t) { + forEach(v.primitives.concat(v.objects), function (nonAB) { + t['throws']( + function () { slice(nonAB); }, + TypeError, + inspect(nonAB) + ' is not an ArrayBuffer' + ); + }); + + t.test('ArrayBuffers', { skip: typeof ArrayBuffer === 'undefined' }, function (st) { + var ab = new ArrayBuffer(0); + + st.equal(IsDetachedBuffer(ab), false, 'ArrayBuffer is not detached'); + + try { + var nb = slice(ab); + } catch (e) { + if (e instanceof SyntaxError) { + st.skip('Detaching ArrayBuffer is not supported'); + return st.end(); + } + console.log(e.stack); + } + + st.notEqual(nb, ab, 'new ArrayBuffer is not the same as the original'); + st.equal(IsDetachedBuffer(ab), false, 'old ArrayBuffer is not detached'); + st.equal(IsDetachedBuffer(nb), false, 'new ArrayBuffer is not detached'); + + var ab2 = new ArrayBuffer(8); + st.equal(byteLength(ab2), 8, 'original ArrayBuffer has length 8'); + try { + var nbLen = slice(ab2, 4); + } catch (e) { + if (e instanceof SyntaxError) { + st.skip('Detaching ArrayBuffer is not supported'); + return st.end(); + } + } + st.equal(IsDetachedBuffer(ab2), false, 'old ArrayBuffer is not detached'); + st.equal(IsDetachedBuffer(nbLen), false, 'new ArrayBuffer is not detached'); + + st.equal(byteLength(ab2), 8, 'original ArrayBuffer has length 8'); + st.equal(byteLength(nbLen), 4, 'newly sliced ArrayBuffer has length 4'); + + var one = new ArrayBuffer(1); + var arr = new Uint8Array(one); + arr[0] = 123; + + var two = slice(one); + + var arr2 = new Uint8Array(two); + arr2[0] = 234; + + st.deepEqual(arr, new Uint8Array([123]), 'original buffer is unchanged'); + st.deepEqual(arr2, new Uint8Array([234]), 'sliced buffer is changed'); + + return st.end(); + }); + + t.test('SharedArrayBuffers', { skip: typeof SharedArrayBuffer === 'undefined' }, function (st) { + var sab = new SharedArrayBuffer(0); + + st['throws']( + function () { slice(sab); }, + TypeError, + inspect(sab) + ' is not an ArrayBuffer' + ); + + st.end(); + }); +}; diff --git a/node_modules/assertion-error/LICENSE b/node_modules/assertion-error/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5e9f3ac637bf65413e58f692249f6138c4ad0172 --- /dev/null +++ b/node_modules/assertion-error/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Jake Luer jake@qualiancy.com (http://qualiancy.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/assertion-error/README.md b/node_modules/assertion-error/README.md new file mode 100644 index 0000000000000000000000000000000000000000..37c392879ab0340727c15ac2860cf965a4aa0362 --- /dev/null +++ b/node_modules/assertion-error/README.md @@ -0,0 +1,68 @@ +

+ AssertionError and AssertionResult classes. +

+ +

+ + build:? + + downloads:? + + devDependencies:none + +

+ +## What is AssertionError? + +Assertion Error is a module that contains two classes: `AssertionError`, which +is an instance of an `Error`, and `AssertionResult` which is not an instance of +Error. + +These can be useful for returning from a function - if the function "succeeds" +return an `AssertionResult` and if the function fails return (or throw) an +`AssertionError`. + +Both `AssertionError` and `AssertionResult` implement the `Result` interface: + +```typescript +interface Result { + name: "AssertionError" | "AssertionResult"; + ok: boolean; + toJSON(...args: unknown[]): Record; +} +``` + +So if a function returns `AssertionResult | AssertionError` it is easy to check +_which_ one is returned by checking either `.name` or `.ok`, or check +`instanceof Error`. + +## Installation + +### Node.js + +`assertion-error` is available on [npm](http://npmjs.org). + +``` +$ npm install --save assertion-error +``` + +### Deno + +`assertion_error` is available on +[Deno.land](https://deno.land/x/assertion_error) + +```typescript +import { + AssertionError, + AssertionResult, +} from "https://deno.land/x/assertion_error@2.0.0/mod.ts"; +``` diff --git a/node_modules/assertion-error/index.d.ts b/node_modules/assertion-error/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8fda2c783699a14b450070815b4ae070417c8e4 --- /dev/null +++ b/node_modules/assertion-error/index.d.ts @@ -0,0 +1,27 @@ +interface Result { + name: "AssertionError" | "AssertionResult"; + ok: boolean; + toJSON(...args: unknown[]): Record; +} + +declare class AssertionError extends Error implements Result { + [key: string]: unknown + name: "AssertionError"; + ok: false; + message: string; + // deno-lint-ignore ban-types + constructor(message: string, props?: T, ssf?: Function); + stack: string; + toJSON(stack?: boolean): Record; +} + +declare class AssertionResult implements Result { + [key: string]: unknown + name: "AssertionResult"; + ok: true; + message: string; + constructor(props?: T); + toJSON(): Record; +} + +export { AssertionError, AssertionResult, Result }; diff --git a/node_modules/assertion-error/index.js b/node_modules/assertion-error/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2bfcb81ed4731d59533729c5e3d1bd5c33e89e2c --- /dev/null +++ b/node_modules/assertion-error/index.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file +// This code was bundled using `deno bundle` and it's not recommended to edit it manually + +const canElideFrames = "captureStackTrace" in Error; +class AssertionError extends Error { + message; + get name() { + return "AssertionError"; + } + get ok() { + return false; + } + constructor(message = "Unspecified AssertionError", props, ssf){ + super(message); + this.message = message; + if (canElideFrames) { + Error.captureStackTrace(this, ssf || AssertionError); + } + for(const key in props){ + if (!(key in this)) { + this[key] = props[key]; + } + } + } + toJSON(stack) { + return { + ...this, + name: this.name, + message: this.message, + ok: false, + stack: stack !== false ? this.stack : undefined + }; + } +} +class AssertionResult { + get name() { + return "AssertionResult"; + } + get ok() { + return true; + } + constructor(props){ + for(const key in props){ + if (!(key in this)) { + this[key] = props[key]; + } + } + } + toJSON() { + return { + ...this, + name: this.name, + ok: this.ok + }; + } +} +export { AssertionError as AssertionError }; +export { AssertionResult as AssertionResult }; + diff --git a/node_modules/assertion-error/package.json b/node_modules/assertion-error/package.json new file mode 100644 index 0000000000000000000000000000000000000000..02dc0f5b6bb4d0a6c5d6e6419c138d45dbe33dfb --- /dev/null +++ b/node_modules/assertion-error/package.json @@ -0,0 +1,32 @@ +{ + "name": "assertion-error", + "version": "2.0.1", + "description": "Error constructor for test and validation frameworks that implements standardized AssertionError specification.", + "author": "Jake Luer (http://qualiancy.com)", + "license": "MIT", + "types": "./index.d.ts", + "keywords": [ + "test", + "assertion", + "assertion-error" + ], + "repository": { + "type": "git", + "url": "git@github.com:chaijs/assertion-error.git" + }, + "engines": { + "node": ">=12" + }, + "files": [ + "index.d.ts" + ], + "type": "module", + "module": "index.js", + "main": "index.js", + "scripts": { + "build": "deno bundle mod.ts > index.js", + "pretest": "rm -rf coverage/", + "test": "deno test --coverage=coverage", + "posttest": "deno coverage coverage --lcov > coverage/lcov.info && lcov --summary coverage/lcov.info" + } +} diff --git a/node_modules/async-function/.eslintrc b/node_modules/async-function/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..2e3c83be9c859621498dba15dd26ae073c42b6b6 --- /dev/null +++ b/node_modules/async-function/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "overrides": [ + { + "files": "./index.js", + "extends": "@ljharb/eslint-config/node/8" + }, + { + "files": "./require.mjs", + "extends": "@ljharb/eslint-config/node/16", + }, + ], +} diff --git a/node_modules/async-function/.github/FUNDING.yml b/node_modules/async-function/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..dfc72fe06ab4f4207ef4363b495e095019b2389d --- /dev/null +++ b/node_modules/async-function/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/async-function +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/async-function/.nycrc b/node_modules/async-function/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/async-function/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/async-function/CHANGELOG.md b/node_modules/async-function/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..b656257f9bb28522673af8706c46699f061aefb5 --- /dev/null +++ b/node_modules/async-function/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v1.0.0 - 2025-01-22 + +### Commits + +- Initial implementation, tests, readme, types [`8ad64e4`](https://github.com/ljharb/async-function/commit/8ad64e45668359cf032e095afcbe6ef0d291d6b4) +- Initial commit [`36dac0d`](https://github.com/ljharb/async-function/commit/36dac0de439b8b6d7af6a246cf984b087efaaf87) +- [meta] reformat `package.json` [`11ff004`](https://github.com/ljharb/async-function/commit/11ff0044813122c6d22e3bf360af979f7c3f7fc8) +- first publish [`5ed020c`](https://github.com/ljharb/async-function/commit/5ed020c7852e90f280517a06e4a4d3cb1d295e40) +- Only apps should have lockfiles [`b746134`](https://github.com/ljharb/async-function/commit/b74613407f749720b7d02b26b9fb2093a0124878) diff --git a/node_modules/async-function/LICENSE b/node_modules/async-function/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a88aff075e81a0c181da7ea8d2f19249f1fc6ba9 --- /dev/null +++ b/node_modules/async-function/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 EduardoRFS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/async-function/README.md b/node_modules/async-function/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8de7a0cf855bd0e1f57a348c7ca94e891989e85b --- /dev/null +++ b/node_modules/async-function/README.md @@ -0,0 +1,51 @@ +# async-function [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A function that returns the normally hidden `AsyncFunction` constructor, when available. + +## Getting started + +```sh +npm install --save async-function +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const AsyncFunction = require('async-function')(); + +const fn = new AsyncFunction('return 1'); + +assert.equal(fn.toString(), 'async function anonymous(\n) {\nreturn 1\n}'); + +fn().then(x => { + assert.equal(x, 1); +}); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/async-function +[npm-version-svg]: https://versionbadg.es/ljharb/async-function.svg +[deps-svg]: https://david-dm.org/ljharb/async-function.svg +[deps-url]: https://david-dm.org/ljharb/async-function +[dev-deps-svg]: https://david-dm.org/ljharb/async-function/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/async-function#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/async-function.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/async-function.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/async-function.svg +[downloads-url]: https://npm-stat.com/charts.html?package=async-function +[codecov-image]: https://codecov.io/gh/ljharb/async-function/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/async-function/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/async-function +[actions-url]: https://github.com/ljharb/async-function/actions diff --git a/node_modules/async-function/index.d.mts b/node_modules/async-function/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fba3c9486623a9b2f3c3958bacb078059219e860 --- /dev/null +++ b/node_modules/async-function/index.d.mts @@ -0,0 +1,3 @@ +import getAsyncFunction = require('.'); + +export default getAsyncFunction; \ No newline at end of file diff --git a/node_modules/async-function/index.d.ts b/node_modules/async-function/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..36a2c0d4bca7c5ee9de9d8e415d36ea1600fd1f3 --- /dev/null +++ b/node_modules/async-function/index.d.ts @@ -0,0 +1,13 @@ +declare namespace getAsyncFunction { + type AsyncFunction = (...args: any[]) => Promise; + + interface AsyncFunctionConstructor extends FunctionConstructor { + new (...args: string[]): AsyncFunction; + (...args: string[]): AsyncFunction; + readonly prototype: AsyncFunction; + } +} + +declare function getAsyncFunction(): getAsyncFunction.AsyncFunctionConstructor | false; + +export = getAsyncFunction; \ No newline at end of file diff --git a/node_modules/async-function/index.js b/node_modules/async-function/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e784f647e5804dd6799d87c0a9ce9b21d8519a1e --- /dev/null +++ b/node_modules/async-function/index.js @@ -0,0 +1,8 @@ +'use strict'; + +// eslint-disable-next-line no-extra-parens, no-empty-function +const cached = /** @type {import('.').AsyncFunctionConstructor} */ (async function () {}.constructor); + +/** @type {import('.')} */ +module.exports = () => cached; + diff --git a/node_modules/async-function/index.mjs b/node_modules/async-function/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fdec9169a5a6f34ce5c0b57b2b5a466ae662b195 --- /dev/null +++ b/node_modules/async-function/index.mjs @@ -0,0 +1,4 @@ +import getAsyncFunction from './index.js'; + +/** @type {import('./index.d.mts').default} */ +export default getAsyncFunction; diff --git a/node_modules/async-function/legacy.js b/node_modules/async-function/legacy.js new file mode 100644 index 0000000000000000000000000000000000000000..9efd971ab6a42fe888d0bf04738f93e876d36d07 --- /dev/null +++ b/node_modules/async-function/legacy.js @@ -0,0 +1,18 @@ +'use strict'; + +/** @type {import('.').AsyncFunctionConstructor | false} */ +var cached; + +/** @type {import('.')} */ +module.exports = function getAsyncFunction() { + if (typeof cached === 'undefined') { + try { + // eslint-disable-next-line no-new-func + cached = Function('return async function () {}')().constructor; + } catch (e) { + cached = false; + } + } + return cached; +}; + diff --git a/node_modules/async-function/package.json b/node_modules/async-function/package.json new file mode 100644 index 0000000000000000000000000000000000000000..807170ceca3bd8b11cf7890033908a15e9fac6c7 --- /dev/null +++ b/node_modules/async-function/package.json @@ -0,0 +1,86 @@ +{ + "name": "async-function", + "version": "1.0.0", + "description": "A function that returns the normally hidden `AsyncFunction` constructor", + "main": "./legacy.js", + "jsnext:main": "./index.mjs", + "module": "./index.mjs", + "exports": { + ".": [ + { + "module-sync": "./require.mjs", + "import": "./index.mjs", + "default": "./index.js" + }, + "./index.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run --silent lint", + "test": "npm run tests-only", + "posttest": "npx npm@\">=10.2\" audit --production", + "tests-only": "nyc tape 'test/**/*.js'", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/async-function.git" + }, + "keywords": [ + "async", + "await", + "function", + "native" + ], + "author": "Jordan Harbamd ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/async-function/issues" + }, + "homepage": "https://github.com/ljharb/async-function#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/semver": "^6.2.7", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "get-proto": "^1.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.1", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "testling": { + "files": "test/index.js" + } +} diff --git a/node_modules/async-function/require.mjs b/node_modules/async-function/require.mjs new file mode 100644 index 0000000000000000000000000000000000000000..59e79a4369b4d4b86cdbb58dce7800d0cdd40a2c --- /dev/null +++ b/node_modules/async-function/require.mjs @@ -0,0 +1,5 @@ +import getAsyncFunction from './index.js'; + +export default getAsyncFunction; + +export { getAsyncFunction as 'module.exports' }; diff --git a/node_modules/async-function/test/index.js b/node_modules/async-function/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fc98706dbd6579e16219f15432d7bd0158d20d76 --- /dev/null +++ b/node_modules/async-function/test/index.js @@ -0,0 +1,40 @@ +'use strict'; + +var test = require('tape'); +var getProto = require('get-proto'); +var semver = require('semver'); + +var getAsyncFunction = require('../'); + +test('getAsyncFunction', function (t) { + var result = getAsyncFunction(); + + /* eslint-env browser */ + if (typeof window === 'undefined' && typeof process !== 'undefined') { + t.equal( + !!result, + semver.satisfies(process.version, '>= 7.6'), + 'result is present or absent as expected for node ' + process.version + ); + } + + t.test('exists', { skip: !result }, function (st) { + if (result && getProto) { // TS can't infer `skip`, or that getProto definitely exists if AsyncFunction exists + st.equal(typeof result, 'function', 'is a function'); + st.equal(getProto(result), Function, 'extends Function'); + + return result('a', 'return a')(42).then(function (a) { + st.equal(a, 42, 'returns an async function'); + }); + } + return st.fail('should never get here'); + }); + + t.test('does not exist', { skip: !!result }, function (st) { + st.equal(result, false, 'is false'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/async-function/tsconfig.json b/node_modules/async-function/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..d9a6668c3ae6be748c78fbd5694053706b3d6942 --- /dev/null +++ b/node_modules/async-function/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/async/CHANGELOG.md b/node_modules/async/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..ce990a51c49edb690bd62b34ee0f814730296217 --- /dev/null +++ b/node_modules/async/CHANGELOG.md @@ -0,0 +1,351 @@ +# v3.2.5 +- Ensure `Error` objects such as `AggregateError` are propagated without modification (#1920) + +# v3.2.4 +- Fix a bug in `priorityQueue` where it didn't wait for the result. (#1725) +- Fix a bug where `unshiftAsync` was included in `priorityQueue`. (#1790) + +# v3.2.3 +- Fix bugs in comment parsing in `autoInject`. (#1767, #1780) + +# v3.2.2 +- Fix potential prototype pollution exploit + +# v3.2.1 +- Use `queueMicrotask` if available to the environment (#1761) +- Minor perf improvement in `priorityQueue` (#1727) +- More examples in documentation (#1726) +- Various doc fixes (#1708, #1712, #1717, #1740, #1739, #1749, #1756) +- Improved test coverage (#1754) + +# v3.2.0 +- Fix a bug in Safari related to overwriting `func.name` +- Remove built-in browserify configuration (#1653) +- Varios doc fixes (#1688, #1703, #1704) + +# v3.1.1 +- Allow redefining `name` property on wrapped functions. + +# v3.1.0 + +- Added `q.pushAsync` and `q.unshiftAsync`, analagous to `q.push` and `q.unshift`, except they always do not accept a callback, and reject if processing the task errors. (#1659) +- Promises returned from `q.push` and `q.unshift` when a callback is not passed now resolve even if an error ocurred. (#1659) +- Fixed a parsing bug in `autoInject` with complicated function bodies (#1663) +- Added ES6+ configuration for Browserify bundlers (#1653) +- Various doc fixes (#1664, #1658, #1665, #1652) + +# v3.0.1 + +## Bug fixes +- Fixed a regression where arrays passed to `queue` and `cargo` would be completely flattened. (#1645) +- Clarified Async's browser support (#1643) + + +# v3.0.0 + +The `async`/`await` release! + +There are a lot of new features and subtle breaking changes in this major version, but the biggest feature is that most Async methods return a Promise if you omit the callback, meaning you can `await` them from within an `async` function. + +```js +const results = await async.mapLimit(urls, 5, async url => { + const resp = await fetch(url) + return resp.body +}) +``` + +## Breaking Changes +- Most Async methods return a Promise when the final callback is omitted, making them `await`-able! (#1572) +- We are now making heavy use of ES2015 features, this means we have dropped out-of-the-box support for Node 4 and earlier, and many old versions of browsers. (#1541, #1553) +- In `queue`, `priorityQueue`, `cargo` and `cargoQueue`, the "event"-style methods, like `q.drain` and `q.saturated` are now methods that register a callback, rather than properties you assign a callback to. They are now of the form `q.drain(callback)`. If you do not pass a callback a Promise will be returned for the next occurrence of the event, making them `await`-able, e.g. `await q.drain()`. (#1586, #1641) +- Calling `callback(false)` will cancel an async method, preventing further iteration and callback calls. This is useful for preventing memory leaks when you break out of an async flow by calling an outer callback. (#1064, #1542) +- `during` and `doDuring` have been removed, and instead `whilst`, `doWhilst`, `until` and `doUntil` now have asynchronous `test` functions. (#850, #1557) +- `limits` of less than 1 now cause an error to be thrown in queues and collection methods. (#1249, #1552) +- `memoize` no longer memoizes errors (#1465, #1466) +- `applyEach`/`applyEachSeries` have a simpler interface, to make them more easily type-able. It always returns a function that takes in a single callback argument. If that callback is omitted, a promise is returned, making it awaitable. (#1228, #1640) + +## New Features +- Async generators are now supported in all the Collection methods. (#1560) +- Added `cargoQueue`, a queue with both `concurrency` and `payload` size parameters. (#1567) +- Queue objects returned from `queue` now have a `Symbol.iterator` method, meaning they can be iterated over to inspect the current list of items in the queue. (#1459, #1556) +- A ESM-flavored `async.mjs` is included in the `async` package. This is described in the `package.json` `"module"` field, meaning it should be automatically used by Webpack and other compatible bundlers. + +## Bug fixes +- Better handle arbitrary error objects in `asyncify` (#1568, #1569) + +## Other +- Removed Lodash as a dependency (#1283, #1528) +- Miscellaneous docs fixes (#1393, #1501, #1540, #1543, #1558, #1563, #1564, #1579, #1581) +- Miscellaneous test fixes (#1538) + +------- + +# v2.6.1 +- Updated lodash to prevent `npm audit` warnings. (#1532, #1533) +- Made `async-es` more optimized for webpack users (#1517) +- Fixed a stack overflow with large collections and a synchronous iterator (#1514) +- Various small fixes/chores (#1505, #1511, #1527, #1530) + +# v2.6.0 +- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483) +- Improved `queue` performance. (#1448, #1454) +- Add missing sourcemap (#1452, #1453) +- Various doc updates (#1448, #1471, #1483) + +# v2.5.0 +- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430)) +- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436)) +- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429)) +- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424)) + +# v2.4.1 +- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419)) + +# v2.4.0 +- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687)) +- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395)) +- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391)) +- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403)) +- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408)) +- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367)) +- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412)) + +# v2.3.0 +- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390)) +- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392)) + +# v2.2.0 +- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364)) +- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381)) +- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385)) + +# v2.1.5 +- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358)) +- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349)) +- Avoid stack overflow case in queue +- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined. +- Cleanup implementations of `some`, `every` and `find` + +# v2.1.3 +- Make bundle size smaller +- Create optimized hotpath for `filter` in array case. + +# v2.1.2 +- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)). + +# v2.1.0 + +- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261)) +- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253)) +- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254)) +- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300)) +- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302)) + +# v2.0.1 + +- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)). + +# v2.0.0 + +Lots of changes here! + +First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well. + +The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. + +We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. + +Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy. + +Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: + +1. Takes a variable number of arguments +2. The last argument is always a callback +3. The callback can accept any number of arguments +4. The first argument passed to the callback will be treated as an error result, if the argument is truthy +5. Any number of result arguments can be passed after the "error" argument +6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop. + +There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`. + +Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. + +Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205). + +## New Features + +- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) +- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) +- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038)) +- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074)) +- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) +- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027)) +- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095)) +- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052)) +- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053)) +- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)). +- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100)) +- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637)) +- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058)) +- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161)) +- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)). +- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034)) +- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170)) +- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088)) + +## Breaking changes + +- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050)) +- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042)) +- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050)) +- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) +- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041)) +- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847)) +- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058)) +- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224)) +- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)). +- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078)) +- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237)) +- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176)) + +## Bug Fixes + +- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)). +- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)). +- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)). + +## Other + +- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases. +- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`). +- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238)) + +Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async. + +------------------------------------------ + +# v1.5.2 +- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998)) +- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994)) +- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002)) + +# v1.5.1 +- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946)) +- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963)) +- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966)) +- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993)) +- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980)) + +# v1.5.0 + +- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892)) +- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873)) +- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637)) +- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891)) +- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904)) +- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912)) + +# v1.4.2 + +- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879)) + +# v1.4.1 + +- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866)) +- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861)) +- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870)) + +# v1.4.0 + +- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840)) +- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836)) +- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) +- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) +- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers +- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823)) +- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824)) +- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) + + +# v1.3.0 + +New Features: +- Added `constant` +- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806)) +- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800)) +- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793)) +- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804)) +- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642)) +- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803)) +- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794)) + +Bug Fixes: +- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783)) + + +# v1.2.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) + + +# v1.2.0 + +New Features: + +- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743)) +- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772)) + +Bug Fixes: + +- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777)) + + +# v1.1.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) + + +# v1.1.0 + +New Features: + +- `cargo` now supports all of the same methods and event callbacks as `queue`. +- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769)) +- Optimized `map`, `eachOf`, and `waterfall` families of functions +- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)). +- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618)) +- Reduced file size by 4kb, (minified version by 1kb) +- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768)) + +Bug Fixes: + +- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622)) +- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754)) +- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439)) +- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668)) +- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578)) +- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557)) +- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593)) +- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766)) + + +# v1.0.0 + +No known breaking changes, we are simply complying with semver from here on out. + +Changes: + +- Start using a changelog! +- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321)) +- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663)) +- Better support for require.js ([#527](https://github.com/caolan/async/issues/527)) +- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714)) +- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758)) +- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611)) +- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729)) +- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546)) +- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/node_modules/async/LICENSE b/node_modules/async/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b18aed69219562718858d972467ba0a68b1ce178 --- /dev/null +++ b/node_modules/async/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2018 Caolan McMahon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/async/README.md b/node_modules/async/README.md new file mode 100644 index 0000000000000000000000000000000000000000..55a0626de4acb1b94f3e39a0b547bc2bdf6dcf95 --- /dev/null +++ b/node_modules/async/README.md @@ -0,0 +1,59 @@ +![Async Logo](https://raw.githubusercontent.com/caolan/async/master/logo/async-logo_readme.jpg) + +![Github Actions CI status](https://github.com/caolan/async/actions/workflows/ci.yml/badge.svg) +[![NPM version](https://img.shields.io/npm/v/async.svg)](https://www.npmjs.com/package/async) +[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) +[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/async/badge?style=rounded)](https://www.jsdelivr.com/package/npm/async) + + + +Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/v3/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm i async`, it can also be used directly in the browser. An ESM/MJS version is included in the main `async` package that should automatically be used with compatible bundlers such as Webpack and Rollup. + +A pure ESM version of Async is available as [`async-es`](https://www.npmjs.com/package/async-es). + +For Documentation, visit + +*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)* + + +```javascript +// for use with Node-style callbacks... +var async = require("async"); + +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, (value, key, callback) => { + fs.readFile(__dirname + value, "utf8", (err, data) => { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }); +}, err => { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}); +``` + +```javascript +var async = require("async"); + +// ...or ES2017 async functions +async.mapLimit(urls, 5, async function(url) { + const response = await fetch(url) + return response.body +}, (err, results) => { + if (err) throw err + // results is now an array of the response bodies + console.log(results) +}) +``` diff --git a/node_modules/async/all.js b/node_modules/async/all.js new file mode 100644 index 0000000000000000000000000000000000000000..622b301941b95c7c756a5f8b98a3116b3a07b908 --- /dev/null +++ b/node_modules/async/all.js @@ -0,0 +1,119 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(every, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/allLimit.js b/node_modules/async/allLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..375e126021af6f8f30ebee8fa4e9bd61d5d0be29 --- /dev/null +++ b/node_modules/async/allLimit.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everyLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/allSeries.js b/node_modules/async/allSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..9a6bf7d468409fd7bf6c77aba5cb2e79f32e1847 --- /dev/null +++ b/node_modules/async/allSeries.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everySeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/any.js b/node_modules/async/any.js new file mode 100644 index 0000000000000000000000000000000000000000..a5bd328abe14685f2a467aa57e630be88158476f --- /dev/null +++ b/node_modules/async/any.js @@ -0,0 +1,122 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(some, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/anyLimit.js b/node_modules/async/anyLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..3a8096fdaac1b272d6a66ab985ff22dec372dd73 --- /dev/null +++ b/node_modules/async/anyLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/anySeries.js b/node_modules/async/anySeries.js new file mode 100644 index 0000000000000000000000000000000000000000..51aad19bdc2a5fc65cced4db170d273d94ba5790 --- /dev/null +++ b/node_modules/async/anySeries.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js new file mode 100644 index 0000000000000000000000000000000000000000..d40784f303af9f79ab899f810f3154b236251624 --- /dev/null +++ b/node_modules/async/apply.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn, ...args) { + return (...callArgs) => fn(...args, ...callArgs); +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/applyEach.js b/node_modules/async/applyEach.js new file mode 100644 index 0000000000000000000000000000000000000000..841842c8b488777c87028f594ef464305b44cd74 --- /dev/null +++ b/node_modules/async/applyEach.js @@ -0,0 +1,57 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach.js'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _map = require('./map.js'); + +var _map2 = _interopRequireDefault(_map); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ +exports.default = (0, _applyEach2.default)(_map2.default); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/applyEachSeries.js b/node_modules/async/applyEachSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..f5267f67f427b8f5b738830c67aad76ba6b94b7b --- /dev/null +++ b/node_modules/async/applyEachSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach.js'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _mapSeries = require('./mapSeries.js'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ +exports.default = (0, _applyEach2.default)(_mapSeries2.default); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/asyncify.js b/node_modules/async/asyncify.js new file mode 100644 index 0000000000000000000000000000000000000000..ddc3f02ff2c1367d97e8a8a5e0a1cff2d19cac20 --- /dev/null +++ b/node_modules/async/asyncify.js @@ -0,0 +1,118 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function (...args /*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback); + }; + } + + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback); + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate2.default)(e => { + throw e; + }, err); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/auto.js b/node_modules/async/auto.js new file mode 100644 index 0000000000000000000000000000000000000000..163c4f278121ba19fe88c66cda97a33782312ce0 --- /dev/null +++ b/node_modules/async/auto.js @@ -0,0 +1,333 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = auto; + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return; + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while (readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = (0, _onlyOnce2.default)((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return; + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return; + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error('async.auto cannot execute tasks due to a recursive dependency'); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[_promiseCallback.PROMISE_SYMBOL]; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/autoInject.js b/node_modules/async/autoInject.js new file mode 100644 index 0000000000000000000000000000000000000000..5db2653ae6333c9d10375170797da57e10caf3bf --- /dev/null +++ b/node_modules/async/autoInject.js @@ -0,0 +1,182 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = autoInject; + +var _auto = require('./auto.js'); + +var _auto2 = _interopRequireDefault(_auto); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; +var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; + +function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index + 1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = endIndex === -1 ? string.length : endIndex; + } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; +} + +function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src); + let [, args] = match; + return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim()); +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); + var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + (0, _wrapAsync2.default)(taskFn)(...newArgs); + } + }); + + return (0, _auto2.default)(newTasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/bower.json b/node_modules/async/bower.json new file mode 100644 index 0000000000000000000000000000000000000000..390c6502f581075c067713444865d08b81a8bbd5 --- /dev/null +++ b/node_modules/async/bower.json @@ -0,0 +1,17 @@ +{ + "name": "async", + "main": "dist/async.js", + "ignore": [ + "bower_components", + "lib", + "test", + "node_modules", + "perf", + "support", + "**/.*", + "*.config.js", + "*.json", + "index.js", + "Makefile" + ] +} diff --git a/node_modules/async/cargo.js b/node_modules/async/cargo.js new file mode 100644 index 0000000000000000000000000000000000000000..d4abd214d0c117e72d5ca56f2a91a2a37489e3e4 --- /dev/null +++ b/node_modules/async/cargo.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cargo; + +var _queue = require('./internal/queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concat, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/concatLimit.js b/node_modules/async/concatLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..a27cc7d45ac5d77a8c275eedd60be2a162cb186c --- /dev/null +++ b/node_modules/async/concatLimit.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +exports.default = (0, _awaitify2.default)(concatLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/concatSeries.js b/node_modules/async/concatSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..332de3f3ec4fbfcc818a867872bfb09a34208659 --- /dev/null +++ b/node_modules/async/concatSeries.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concatSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/constant.js b/node_modules/async/constant.js new file mode 100644 index 0000000000000000000000000000000000000000..ea406f65548b85e46185478e7481cf44d016855a --- /dev/null +++ b/node_modules/async/constant.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (...args) { + return function (...ignoredArgs /*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detect.js b/node_modules/async/detect.js new file mode 100644 index 0000000000000000000000000000000000000000..d5896ef6435296a9abad3e771b05a9b261e018f2 --- /dev/null +++ b/node_modules/async/detect.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detect, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detectLimit.js b/node_modules/async/detectLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..c59843b6211ae6700bad86d4f73645c68b326bf4 --- /dev/null +++ b/node_modules/async/detectLimit.js @@ -0,0 +1,48 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detectSeries.js b/node_modules/async/detectSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..b48689967577f3d02265ed5053a013569be6d9ab --- /dev/null +++ b/node_modules/async/detectSeries.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); +} + +exports.default = (0, _awaitify2.default)(detectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/dir.js b/node_modules/async/dir.js new file mode 100644 index 0000000000000000000000000000000000000000..8e9fafd788f08c91fbc281891cde1657b9335f63 --- /dev/null +++ b/node_modules/async/dir.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _consoleFunc = require('./internal/consoleFunc.js'); + +var _consoleFunc2 = _interopRequireDefault(_consoleFunc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ +exports.default = (0, _consoleFunc2.default)('dir'); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js new file mode 100644 index 0000000000000000000000000000000000000000..d7b791898947d497b07bd5905d68450515bdb076 --- /dev/null +++ b/node_modules/async/dist/async.js @@ -0,0 +1,6061 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.async = {})); +})(this, (function (exports) { 'use strict'; + + /** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ + function apply(fn, ...args) { + return (...callArgs) => fn(...args,...callArgs); + } + + function initialParams (fn) { + return function (...args/*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; + } + + /* istanbul ignore file */ + + var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; + var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; + var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + + function fallback(fn) { + setTimeout(fn, 0); + } + + function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); + } + + var _defer$1; + + if (hasQueueMicrotask) { + _defer$1 = queueMicrotask; + } else if (hasSetImmediate) { + _defer$1 = setImmediate; + } else if (hasNextTick) { + _defer$1 = process.nextTick; + } else { + _defer$1 = fallback; + } + + var setImmediate$1 = wrap(_defer$1); + + /** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ + function asyncify(func) { + if (isAsync(func)) { + return function (...args/*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback) + } + } + + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback) + } else { + callback(null, result); + } + }); + } + + function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); + } + + function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + setImmediate$1(e => { throw e }, err); + } + } + + function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; + } + + function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; + } + + function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; + } + + function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function') + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; + } + + // conditionally promisify a function. + // only return a promise if a callback is omitted + function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined') + function awaitable (...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args) + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err) + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }) + } + + return awaitable + } + + function applyEach$1 (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = awaitify(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + wrapAsync(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; + } + + function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); + } + + function isArrayLike(value) { + return value && + typeof value.length === 'number' && + value.length >= 0 && + value.length % 1 === 0; + } + + // A temporary value used to identify if the loop should be broken. + // See #1064, #1293 + const breakLoop = {}; + + function once(fn) { + function wrapper (...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper + } + + function getIterator (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); + } + + function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } + } + + function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } + } + + function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? {value: obj[key], key} : null; + }; + } + + function createIterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } + + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + } + + function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; + } + + // for async generators + function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({value, done: iterDone}) => { + //console.log('got value', value) + if (canceled || done) return + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return + if (err) return handleError(err) + + if (err === false) { + done = true; + canceled = true; + return + } + + if (result === breakLoop || (done && running <= 0)) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return + awaiting = false; + done = true; + callback(err); + } + + replenish(); + } + + var eachOfLimit$2 = (limit) => { + return (obj, iteratee, callback) => { + callback = once(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1') + } + if (!obj) { + return callback(null); + } + if (isAsyncGenerator(obj)) { + return asyncEachOfLimit(obj, limit, iteratee, callback) + } + if (isAsyncIterable(obj)) { + return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) + } + var nextElem = createIterator(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (err === false) { + done = true; + canceled = true; + } + else if (value === breakLoop || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } + + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; + }; + + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); + } + + var eachOfLimit$1 = awaitify(eachOfLimit, 4); + + // eachOf implementation optimized for array-likes + function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback); + var index = 0, + completed = 0, + {length} = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } + } + + // a generic version of eachOf which can handle array, object, and iterator cases. + function eachOfGeneric (coll, iteratee, callback) { + return eachOfLimit$1(coll, Infinity, iteratee, callback); + } + + /** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ + function eachOf(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, wrapAsync(iteratee), callback); + } + + var eachOf$1 = awaitify(eachOf, 3); + + /** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function map (coll, iteratee, callback) { + return _asyncMap(eachOf$1, coll, iteratee, callback) + } + var map$1 = awaitify(map, 3); + + /** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ + var applyEach = applyEach$1(map$1); + + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfSeries(coll, iteratee, callback) { + return eachOfLimit$1(coll, 1, iteratee, callback) + } + var eachOfSeries$1 = awaitify(eachOfSeries, 3); + + /** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapSeries (coll, iteratee, callback) { + return _asyncMap(eachOfSeries$1, coll, iteratee, callback) + } + var mapSeries$1 = awaitify(mapSeries, 3); + + /** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ + var applyEachSeries = applyEach$1(mapSeries$1); + + const PROMISE_SYMBOL = Symbol('promiseCallback'); + + function promiseCallback () { + let resolve, reject; + function callback (err, ...args) { + if (err) return reject(err) + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, + reject = rej; + }); + + return callback + } + + /** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || promiseCallback()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = onlyOnce((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[PROMISE_SYMBOL] + } + + var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; + var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; + var FN_ARG_SPLIT = /,/; + var FN_ARG = /(=.+)?(\s*)$/; + + function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index+1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = (endIndex === -1) ? string.length : endIndex; + } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; + } + + function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) + let [, args] = match; + return args + .replace(/\s/g, '') + .split(FN_ARG_SPLIT) + .map((arg) => arg.replace(FN_ARG, '').trim()); + } + + /** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ + function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + wrapAsync(taskFn)(...newArgs); + } + }); + + return auto(newTasks, callback); + } + + // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation + // used for queues. This implementation assumes that the node provided by the user can be modified + // to adjust the next and last properties. We implement only the minimal functionality + // for queue support. + class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty () { + while(this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this] + } + + *[Symbol.iterator] () { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove (testFn) { + var curr = this.head; + while(curr) { + var {next} = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } + } + + function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; + } + + function queue$1(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on (event, handler) { + events[event].push(handler); + } + + function once (event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off (event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []) + if (!handler) return events[event] = [] + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger (event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback (err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res() + if (args.length <= 1) return res(args[0]) + res(args); + } + + var item = q._createTaskItem( + data, + rejectOnError ? promiseCallback : + (callback || promiseCallback) + ); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }) + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= (q.concurrency - q.buffer) ) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + setImmediate$1(() => trigger('drain')); + return true + } + return false + } + + const eventMethod = (name) => (handler) => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err) + resolve(data); + }); + }) + } + off(name); + on(name, handler); + + }; + + var isProcessing = false; + var q = { + _tasks: new DLL(), + _createTaskItem (data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator] () { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, false, callback)) + } + return _insert(data, false, false, callback); + }, + pushAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, true, callback)) + } + return _insert(data, false, true, callback); + }, + kill () { + off(); + q._tasks.empty(); + }, + unshift (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, false, callback)) + } + return _insert(data, true, false, callback); + }, + unshiftAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, true, callback)) + } + return _insert(data, true, true, callback); + }, + remove (testFn) { + q._tasks.remove(testFn); + }, + process () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = onlyOnce(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length () { + return q._tasks.length; + }, + running () { + return numRunning; + }, + workersList () { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause () { + q.paused = true; + }, + resume () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + }, + }); + return q; + } + + /** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function reduce(coll, memo, iteratee, callback) { + callback = once(callback); + var _iteratee = wrapAsync(iteratee); + return eachOfSeries$1(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); + } + var reduce$1 = awaitify(reduce, 4); + + /** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ + function seq(...functions) { + var _functions = functions.map(wrapAsync); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = promiseCallback(); + } + + reduce$1(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, + (err, results) => cb(err, ...results)); + + return cb[PROMISE_SYMBOL] + }; + } + + /** + * Creates a function which is a composition of the passed asynchronous + * functions. Each function consumes the return value of the function that + * follows. Composing functions `f()`, `g()`, and `h()` would produce the result + * of `f(g(h()))`, only this version uses callbacks to obtain the return values. + * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name compose + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} an asynchronous function that is the composed + * asynchronous `functions` + * @example + * + * function add1(n, callback) { + * setTimeout(function () { + * callback(null, n + 1); + * }, 10); + * } + * + * function mul3(n, callback) { + * setTimeout(function () { + * callback(null, n * 3); + * }, 10); + * } + * + * var add1mul3 = async.compose(mul3, add1); + * add1mul3(4, function (err, result) { + * // result now equals 15 + * }); + */ + function compose(...args) { + return seq(...args.reverse()); + } + + /** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapLimit (coll, limit, iteratee, callback) { + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) + } + var mapLimit$1 = awaitify(mapLimit, 4); + + /** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); + } + var concatLimit$1 = awaitify(concatLimit, 4); + + /** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ + function concat(coll, iteratee, callback) { + return concatLimit$1(coll, Infinity, iteratee, callback) + } + var concat$1 = awaitify(concat, 3); + + /** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatSeries(coll, iteratee, callback) { + return concatLimit$1(coll, 1, iteratee, callback) + } + var concatSeries$1 = awaitify(concatSeries, 3); + + /** + * Returns a function that when called, calls-back with the values provided. + * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to + * [`auto`]{@link module:ControlFlow.auto}. + * + * @name constant + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {...*} arguments... - Any number of arguments to automatically invoke + * callback with. + * @returns {AsyncFunction} Returns a function that when invoked, automatically + * invokes the callback with the previous given arguments. + * @example + * + * async.waterfall([ + * async.constant(42), + * function (value, next) { + * // value === 42 + * }, + * //... + * ], callback); + * + * async.waterfall([ + * async.constant(filename, "utf8"), + * fs.readFile, + * function (fileData, next) { + * //... + * } + * //... + * ], callback); + * + * async.auto({ + * hostname: async.constant("https://server.net/"), + * port: findFreePort, + * launchServer: ["hostname", "port", function (options, cb) { + * startServer(options, cb); + * }], + * //... + * }, callback); + */ + function constant$1(...args) { + return function (...ignoredArgs/*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; + } + + function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = wrapAsync(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, breakLoop); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; + } + + /** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function detect(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) + } + var detect$1 = awaitify(detect, 3); + + /** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectLimit(coll, limit, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var detectLimit$1 = awaitify(detectLimit, 4); + + /** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectSeries(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) + } + + var detectSeries$1 = awaitify(detectSeries, 3); + + function consoleFunc(name) { + return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }) + } + + /** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ + var dir = consoleFunc('dir'); + + /** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); + } + + var doWhilst$1 = awaitify(doWhilst, 3); + + /** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doUntil(iteratee, test, callback) { + const _test = wrapAsync(test); + return doWhilst$1(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb (err, !truth)); + }, callback); + } + + function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); + } + + /** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ + function eachLimit$2(coll, iteratee, callback) { + return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } + + var each = awaitify(eachLimit$2, 3); + + /** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } + var eachLimit$1 = awaitify(eachLimit, 4); + + /** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachSeries(coll, iteratee, callback) { + return eachLimit$1(coll, 1, iteratee, callback) + } + var eachSeries$1 = awaitify(eachSeries, 3); + + /** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ + function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return function (...args/*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + setImmediate$1(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; + } + + /** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function every(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) + } + var every$1 = awaitify(every, 3); + + /** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everyLimit(coll, limit, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var everyLimit$1 = awaitify(everyLimit, 4); + + /** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everySeries(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) + } + var everySeries$1 = awaitify(everySeries, 3); + + function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); + } + + function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({index, value: x}); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results + .sort((a, b) => a.index - b.index) + .map(v => v.value)); + }); + } + + function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, wrapAsync(iteratee), callback); + } + + /** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function filter (coll, iteratee, callback) { + return _filter(eachOf$1, coll, iteratee, callback) + } + var filter$1 = awaitify(filter, 3); + + /** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ + function filterLimit (coll, limit, iteratee, callback) { + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) + } + var filterLimit$1 = awaitify(filterLimit, 4); + + /** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ + function filterSeries (coll, iteratee, callback) { + return _filter(eachOfSeries$1, coll, iteratee, callback) + } + var filterSeries$1 = awaitify(filterSeries, 3); + + /** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ + function forever(fn, errback) { + var done = onlyOnce(errback); + var task = wrapAsync(ensureAsync(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); + } + var forever$1 = awaitify(forever, 2); + + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, {key, val}); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var {hasOwnProperty} = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var {key} = mapResults[i]; + var {val} = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); + } + + var groupByLimit$1 = awaitify(groupByLimit, 4); + + /** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function groupBy (coll, iteratee, callback) { + return groupByLimit$1(coll, Infinity, iteratee, callback) + } + + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupBySeries (coll, iteratee, callback) { + return groupByLimit$1(coll, 1, iteratee, callback) + } + + /** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ + var log = consoleFunc('log'); + + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); + } + + var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); + + /** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function mapValues(obj, iteratee, callback) { + return mapValuesLimit$1(obj, Infinity, iteratee, callback) + } + + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesSeries(obj, iteratee, callback) { + return mapValuesLimit$1(obj, 1, iteratee, callback) + } + + /** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ + function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = wrapAsync(fn); + var memoized = initialParams((args, callback) => { + var key = hasher(...args); + if (key in memo) { + setImmediate$1(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + } + + /* istanbul ignore file */ + + /** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ + var _defer; + + if (hasNextTick) { + _defer = process.nextTick; + } else if (hasSetImmediate) { + _defer = setImmediate; + } else { + _defer = fallback; + } + + var nextTick = wrap(_defer); + + var _parallel = awaitify((eachfn, tasks, callback) => { + var results = isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + wrapAsync(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); + }, 3); + + /** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); + } + + /** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ + function parallelLimit(tasks, limit, callback) { + return _parallel(eachOfLimit$2(limit), tasks, callback); + } + + /** + * A queue of tasks for the worker function to complete. + * @typedef {Iterable} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {number} payload - an integer that specifies how many items are + * passed to the worker function at a time. only applies if this is a + * [cargo]{@link module:ControlFlow.cargo} object + * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns + * a promise that rejects if an error occurs. + * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns + * a promise that rejects if an error occurs. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a function that sets a callback that is + * called when the number of running workers hits the `concurrency` limit, and + * further tasks will be queued. If the callback is omitted, `q.saturated()` + * returns a promise for the next occurrence. + * @property {Function} unsaturated - a function that sets a callback that is + * called when the number of running workers is less than the `concurrency` & + * `buffer` limits, and further tasks will not be queued. If the callback is + * omitted, `q.unsaturated()` returns a promise for the next occurrence. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a function that sets a callback that is called + * when the last item from the `queue` is given to a `worker`. If the callback + * is omitted, `q.empty()` returns a promise for the next occurrence. + * @property {Function} drain - a function that sets a callback that is called + * when the last item from the `queue` has returned from the `worker`. If the + * callback is omitted, `q.drain()` returns a promise for the next occurrence. + * @property {Function} error - a function that sets a callback that is called + * when a task errors. Has the signature `function(error, task)`. If the + * callback is omitted, `error()` returns a promise that rejects on the next + * error. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + * + * @example + * const q = async.queue(worker, 2) + * q.push(item1) + * q.push(item2) + * q.push(item3) + * // queues are iterable, spread into an array to inspect + * const items = [...q] // [item1, item2, item3] + * // or use for of + * for (let item of q) { + * console.log(item) + * } + * + * q.drain(() => { + * console.log('all done') + * }) + * // or + * await q.drain() + */ + + /** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain(function() { + * console.log('all items have been processed'); + * }); + * // or await the end + * await q.drain() + * + * // assign an error callback + * q.error(function(err, task) { + * console.error('task experienced an error'); + * }); + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * // callback is optional + * q.push({name: 'bar'}); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ + function queue (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue$1((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); + } + + // Binary min-heap implementation used for priority queue. + // Implementation is stable, i.e. push time is considered for equal priorities + class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty () { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l=leftChi(index)) < this.heap.length) { + if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { + l = l+1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length-1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length-1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator] () { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove (testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length-1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } + } + + function leftChi(i) { + return (i<<1)+1; + } + + function parent(i) { + return ((i+1)>>1)-1; + } + + function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } + else { + return x.pushCount < y.pushCount; + } + } + + /** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, + * except this returns a promise that rejects if an error occurs. + * * The `unshift` and `unshiftAsync` methods were removed. + */ + function priorityQueue(worker, concurrency) { + // Start with a normal queue + var q = queue(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new Heap(); + q._createTaskItem = ({data, priority}, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return {data: tasks, priority}; + } + return tasks.map(data => { return {data, priority}; }); + } + + // Override push to accept second parameter representing priority + q.push = function(data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function(data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; + } + + /** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ + function race(tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } + } + + var race$1 = awaitify(race, 2); + + /** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function reduceRight (array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return reduce$1(reversed, memo, iteratee, callback); + } + + /** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ + function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0){ + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); + } + + /** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ + function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(reflect); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = reflect.call(this, tasks[key]); + }); + } + return results; + } + + function reject$2(eachfn, arr, _iteratee, callback) { + const iteratee = wrapAsync(_iteratee); + return _filter(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); + } + + /** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) + } + var reject$1 = awaitify(reject, 3); + + /** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectLimit (coll, limit, iteratee, callback) { + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) + } + var rejectLimit$1 = awaitify(rejectLimit, 4); + + /** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectSeries (coll, iteratee, callback) { + return reject$2(eachOfSeries$1, coll, iteratee, callback) + } + var rejectSeries$1 = awaitify(rejectSeries, 3); + + function constant(value) { + return function () { + return value; + } + } + + /** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ + const DEFAULT_TIMES = 5; + const DEFAULT_INTERVAL = 0; + + function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || promiseCallback(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || promiseCallback(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = wrapAsync(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[PROMISE_SYMBOL] + } + + function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } + } + + /** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ + function retryable (opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = (opts && opts.arity) || task.length; + if (isAsync(task)) { + arity += 1; + } + var _task = wrapAsync(task); + return initialParams((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = promiseCallback(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + + return callback[PROMISE_SYMBOL] + }); + } + + /** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function series(tasks, callback) { + return _parallel(eachOfSeries$1, tasks, callback); + } + + /** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function some(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) + } + var some$1 = awaitify(some, 3); + + /** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someLimit(coll, limit, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var someLimit$1 = awaitify(someLimit, 4); + + /** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someSeries(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) + } + var someSeries$1 = awaitify(someSeries, 3); + + /** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return map$1(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, {value: x, criteria}); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + } + var sortBy$1 = awaitify(sortBy, 3); + + /** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ + function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); + + return initialParams((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); + } + + function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; + } + + /** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(range(count), limit, _iteratee, callback); + } + + /** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ + function times (n, iteratee, callback) { + return timesLimit(n, Infinity, iteratee, callback) + } + + /** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesSeries (n, iteratee, callback) { + return timesLimit(n, 1, iteratee, callback) + } + + /** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = once(callback || promiseCallback()); + var _iteratee = wrapAsync(iteratee); + + eachOf$1(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[PROMISE_SYMBOL] + } + + /** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ + function tryEach(tasks, callback) { + var error = null; + var result; + return eachSeries$1(tasks, (task, taskCb) => { + wrapAsync(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); + } + + var tryEach$1 = awaitify(tryEach); + + /** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ + function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; + } + + /** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ + function whilst(test, iteratee, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); + } + var whilst$1 = awaitify(whilst, 3); + + /** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ + function until(test, iteratee, callback) { + const _test = wrapAsync(test); + return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); + } + + /** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ + function waterfall (tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + task(...args, onlyOnce(next)); + } + + function next(err, ...args) { + if (err === false) return + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); + } + + var waterfall$1 = awaitify(waterfall); + + /** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + + + var index = { + apply, + applyEach, + applyEachSeries, + asyncify, + auto, + autoInject, + cargo: cargo$1, + cargoQueue: cargo, + compose, + concat: concat$1, + concatLimit: concatLimit$1, + concatSeries: concatSeries$1, + constant: constant$1, + detect: detect$1, + detectLimit: detectLimit$1, + detectSeries: detectSeries$1, + dir, + doUntil, + doWhilst: doWhilst$1, + each, + eachLimit: eachLimit$1, + eachOf: eachOf$1, + eachOfLimit: eachOfLimit$1, + eachOfSeries: eachOfSeries$1, + eachSeries: eachSeries$1, + ensureAsync, + every: every$1, + everyLimit: everyLimit$1, + everySeries: everySeries$1, + filter: filter$1, + filterLimit: filterLimit$1, + filterSeries: filterSeries$1, + forever: forever$1, + groupBy, + groupByLimit: groupByLimit$1, + groupBySeries, + log, + map: map$1, + mapLimit: mapLimit$1, + mapSeries: mapSeries$1, + mapValues, + mapValuesLimit: mapValuesLimit$1, + mapValuesSeries, + memoize, + nextTick, + parallel, + parallelLimit, + priorityQueue, + queue, + race: race$1, + reduce: reduce$1, + reduceRight, + reflect, + reflectAll, + reject: reject$1, + rejectLimit: rejectLimit$1, + rejectSeries: rejectSeries$1, + retry, + retryable, + seq, + series, + setImmediate: setImmediate$1, + some: some$1, + someLimit: someLimit$1, + someSeries: someSeries$1, + sortBy: sortBy$1, + timeout, + times, + timesLimit, + timesSeries, + transform, + tryEach: tryEach$1, + unmemoize, + until, + waterfall: waterfall$1, + whilst: whilst$1, + + // aliases + all: every$1, + allLimit: everyLimit$1, + allSeries: everySeries$1, + any: some$1, + anyLimit: someLimit$1, + anySeries: someSeries$1, + find: detect$1, + findLimit: detectLimit$1, + findSeries: detectSeries$1, + flatMap: concat$1, + flatMapLimit: concatLimit$1, + flatMapSeries: concatSeries$1, + forEach: each, + forEachSeries: eachSeries$1, + forEachLimit: eachLimit$1, + forEachOf: eachOf$1, + forEachOfSeries: eachOfSeries$1, + forEachOfLimit: eachOfLimit$1, + inject: reduce$1, + foldl: reduce$1, + foldr: reduceRight, + select: filter$1, + selectLimit: filterLimit$1, + selectSeries: filterSeries$1, + wrapSync: asyncify, + during: whilst$1, + doDuring: doWhilst$1 + }; + + exports.all = every$1; + exports.allLimit = everyLimit$1; + exports.allSeries = everySeries$1; + exports.any = some$1; + exports.anyLimit = someLimit$1; + exports.anySeries = someSeries$1; + exports.apply = apply; + exports.applyEach = applyEach; + exports.applyEachSeries = applyEachSeries; + exports.asyncify = asyncify; + exports.auto = auto; + exports.autoInject = autoInject; + exports.cargo = cargo$1; + exports.cargoQueue = cargo; + exports.compose = compose; + exports.concat = concat$1; + exports.concatLimit = concatLimit$1; + exports.concatSeries = concatSeries$1; + exports.constant = constant$1; + exports.default = index; + exports.detect = detect$1; + exports.detectLimit = detectLimit$1; + exports.detectSeries = detectSeries$1; + exports.dir = dir; + exports.doDuring = doWhilst$1; + exports.doUntil = doUntil; + exports.doWhilst = doWhilst$1; + exports.during = whilst$1; + exports.each = each; + exports.eachLimit = eachLimit$1; + exports.eachOf = eachOf$1; + exports.eachOfLimit = eachOfLimit$1; + exports.eachOfSeries = eachOfSeries$1; + exports.eachSeries = eachSeries$1; + exports.ensureAsync = ensureAsync; + exports.every = every$1; + exports.everyLimit = everyLimit$1; + exports.everySeries = everySeries$1; + exports.filter = filter$1; + exports.filterLimit = filterLimit$1; + exports.filterSeries = filterSeries$1; + exports.find = detect$1; + exports.findLimit = detectLimit$1; + exports.findSeries = detectSeries$1; + exports.flatMap = concat$1; + exports.flatMapLimit = concatLimit$1; + exports.flatMapSeries = concatSeries$1; + exports.foldl = reduce$1; + exports.foldr = reduceRight; + exports.forEach = each; + exports.forEachLimit = eachLimit$1; + exports.forEachOf = eachOf$1; + exports.forEachOfLimit = eachOfLimit$1; + exports.forEachOfSeries = eachOfSeries$1; + exports.forEachSeries = eachSeries$1; + exports.forever = forever$1; + exports.groupBy = groupBy; + exports.groupByLimit = groupByLimit$1; + exports.groupBySeries = groupBySeries; + exports.inject = reduce$1; + exports.log = log; + exports.map = map$1; + exports.mapLimit = mapLimit$1; + exports.mapSeries = mapSeries$1; + exports.mapValues = mapValues; + exports.mapValuesLimit = mapValuesLimit$1; + exports.mapValuesSeries = mapValuesSeries; + exports.memoize = memoize; + exports.nextTick = nextTick; + exports.parallel = parallel; + exports.parallelLimit = parallelLimit; + exports.priorityQueue = priorityQueue; + exports.queue = queue; + exports.race = race$1; + exports.reduce = reduce$1; + exports.reduceRight = reduceRight; + exports.reflect = reflect; + exports.reflectAll = reflectAll; + exports.reject = reject$1; + exports.rejectLimit = rejectLimit$1; + exports.rejectSeries = rejectSeries$1; + exports.retry = retry; + exports.retryable = retryable; + exports.select = filter$1; + exports.selectLimit = filterLimit$1; + exports.selectSeries = filterSeries$1; + exports.seq = seq; + exports.series = series; + exports.setImmediate = setImmediate$1; + exports.some = some$1; + exports.someLimit = someLimit$1; + exports.someSeries = someSeries$1; + exports.sortBy = sortBy$1; + exports.timeout = timeout; + exports.times = times; + exports.timesLimit = timesLimit; + exports.timesSeries = timesSeries; + exports.transform = transform; + exports.tryEach = tryEach$1; + exports.unmemoize = unmemoize; + exports.until = until; + exports.waterfall = waterfall$1; + exports.whilst = whilst$1; + exports.wrapSync = asyncify; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/node_modules/async/dist/async.min.js b/node_modules/async/dist/async.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f0b7fdf5f2e5601f5ae97705f2f8ff678872ebcf --- /dev/null +++ b/node_modules/async/dist/async.min.js @@ -0,0 +1 @@ +(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"==typeof globalThis?e||self:globalThis,t(e.async={}))})(this,function(e){"use strict";function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}function a(e){setTimeout(e,0)}function i(e){return(t,...n)=>e(()=>t(...n))}function r(e){return d(e)?function(...t){const n=t.pop(),a=e.apply(this,t);return s(a,n)}:n(function(t,n){var a;try{a=e.apply(this,t)}catch(t){return n(t)}return a&&"function"==typeof a.then?s(a,n):void n(null,a)})}function s(e,t){return e.then(e=>{l(t,null,e)},e=>{l(t,e&&(e instanceof Error||e.message)?e:new Error(e))})}function l(e,t,n){try{e(t,n)}catch(e){_e(t=>{throw t},e)}}function d(e){return"AsyncFunction"===e[Symbol.toStringTag]}function u(e){return"AsyncGenerator"===e[Symbol.toStringTag]}function p(e){return"function"==typeof e[Symbol.asyncIterator]}function c(e){if("function"!=typeof e)throw new Error("expected a function");return d(e)?r(e):e}function o(e,t){function n(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((a,i)=>{n[t-1]=(e,...t)=>e?i(e):void a(1{c(e).apply(i,n.concat(t))},a)});return i}}function f(e,t,n,a){t=t||[];var i=[],r=0,s=c(n);return e(t,(e,t,n)=>{var a=r++;s(e,(e,t)=>{i[a]=t,n(e)})},e=>{a(e,i)})}function y(e){return e&&"number"==typeof e.length&&0<=e.length&&0==e.length%1}function m(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function g(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function k(e){var t=-1,n=e.length;return function a(){return++t=t||u||l||(u=!0,e.next().then(({value:e,done:t})=>{if(!(d||l))return u=!1,t?(l=!0,void(0>=p&&a(null))):void(p++,n(e,c,r),c++,i())}).catch(s))}function r(e,t){return p-=1,d?void 0:e?s(e):!1===e?(l=!0,void(d=!0)):t===be||l&&0>=p?(l=!0,a(null)):void i()}function s(e){d||(u=!1,l=!0,a(e))}let l=!1,d=!1,u=!1,p=0,c=0;i()}function O(e,t,n){function a(e,t){!1===e&&(l=!0);!0===l||(e?n(e):(++r===s||t===be)&&n(null))}n=m(n);var i=0,r=0,{length:s}=e,l=!1;for(0===s&&n(null);i{t=e,n=a}),e}function A(e,t,n){function a(e,t){k.push(()=>l(e,t))}function i(){if(!f){if(0===k.length&&0===h)return n(null,o);for(;k.length&&he()),i()}function l(e,t){if(!y){var a=L((t,...a)=>{if(h--,!1===t)return void(f=!0);if(2>a.length&&([a]=a),t){var i={};if(Object.keys(o).forEach(e=>{i[e]=o[e]}),i[e]=a,y=!0,g=Object.create(null),f)return;n(t,i)}else o[e]=a,s(e)});h++;var i=c(t[t.length-1]);1{0==--S[e]&&v.push(e)});if(t!==p)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function u(t){var n=[];return Object.keys(e).forEach(a=>{const i=e[a];Array.isArray(i)&&0<=i.indexOf(t)&&n.push(a)}),n}"number"!=typeof t&&(n=t,t=null),n=m(n||b());var p=Object.keys(e).length;if(!p)return n(null);t||(t=p);var o={},h=0,f=!1,y=!1,g=Object.create(null),k=[],v=[],S={};return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return a(t,[n]),void v.push(t);var i=n.slice(0,n.length-1),s=i.length;return 0===s?(a(t,n),void v.push(t)):void(S[t]=s,i.forEach(l=>{if(!e[l])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+l+"` in "+i.join(", "));r(l,()=>{s--,0===s&&a(t,n)})}))}),d(),i(),n[Ce]}function I(e){let t="",n=0,a=e.indexOf("*/");for(;ne.replace(Ne,"").trim())}function j(e,t){var n={};return Object.keys(e).forEach(t=>{function a(e,t){var n=i.map(t=>e[t]);n.push(t),c(r)(...n)}var i,r=e[t],s=d(r),l=!s&&1===r.length||s&&0===r.length;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(0{r(e,n),t(...a)};f[e].push(n)}function r(e,t){return e?t?void(f[e]=f[e].filter(e=>e!==t)):f[e]=[]:Object.keys(f).forEach(e=>f[e]=[])}function s(e,...t){f[e].forEach(e=>e(...t))}function l(e,t,n,a){function i(e,...t){return e?n?s(e):r():1>=t.length?r(t[0]):void r(t)}if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");k.started=!0;var r,s,l=k._createTaskItem(e,n?i:a||i);if(t?k._tasks.unshift(l):k._tasks.push(l),y||(y=!0,_e(()=>{y=!1,k.process()})),n||!a)return new Promise((e,t)=>{r=e,s=t})}function d(e){return function(t,...n){o-=1;for(var a=0,r=e.length;as("drain")),!0)}if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var p=c(e),o=0,h=[];const f={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};var y=!1;const m=e=>t=>t?void(r(e),a(e,t)):new Promise((t,n)=>{i(e,(e,a)=>e?n(e):void t(a))});var g=!1,k={_tasks:new Ve,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*k._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!1,!1,t)):l(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!1,!0,t)):l(e,!1,!0,t)},kill(){r(),k._tasks.empty()},unshift(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!0,!1,t)):l(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!0,!0,t)):l(e,!0,!0,t)},remove(e){k._tasks.remove(e)},process(){var e=Math.min;if(!g){for(g=!0;!k.paused&&o{t.apply(n,e.concat((e,...t)=>{a(e,t)}))},(e,t)=>a(e,...t)),a[Ce]}}function P(...e){return C(...e.reverse())}function R(...e){return function(...t){var n=t.pop();return n(null,...e)}}function z(e,t){return(n,a,i,r)=>{var s,l=!1;const d=c(i);n(a,(n,a,i)=>{d(n,(a,r)=>a||!1===a?i(a):e(r)&&!s?(l=!0,s=t(!0,n),i(null,be)):void i())},e=>e?r(e):void r(null,l?s:t(!1)))}}function N(e){return(t,...n)=>c(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}function V(e,t,n){const a=c(t);return Xe(e,(...e)=>{const t=e.pop();a(...e,(e,n)=>t(e,!n))},n)}function Y(e){return(t,n,a)=>e(t,a)}function q(e){return d(e)?e:function(...t){var n=t.pop(),a=!0;t.push((...e)=>{a?_e(()=>n(...e)):n(...e)}),e.apply(this,t),a=!1}}function D(e,t,n,a){var r=Array(t.length);e(t,(e,t,a)=>{n(e,(e,n)=>{r[t]=!!n,a(e)})},e=>{if(e)return a(e);for(var n=[],s=0;s{n(e,(n,r)=>n?a(n):void(r&&i.push({index:t,value:e}),a(n)))},e=>e?a(e):void a(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value)))}function U(e,t,n,a){var i=y(t)?D:Q;return i(e,t,c(n),a)}function G(e,t,n){return dt(e,1/0,t,n)}function W(e,t,n){return dt(e,1,t,n)}function H(e,t,n){return pt(e,1/0,t,n)}function J(e,t,n){return pt(e,1,t,n)}function K(e,t=e=>e){var a=Object.create(null),r=Object.create(null),s=c(e),l=n((e,n)=>{var d=t(...e);d in a?_e(()=>n(null,...a[d])):d in r?r[d].push(n):(r[d]=[n],s(...e,(e,...t)=>{e||(a[d]=t);var n=r[d];delete r[d];for(var s=0,u=n.length;s{n(e[0],t)},t,1)}function ee(e){return(e<<1)+1}function te(e){return(e+1>>1)-1}function ne(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t})):{data:e,priority:t}}var a=$(e,t),{push:i,pushAsync:r}=a;return a._tasks=new ht,a._createTaskItem=({data:e,priority:t},n)=>({data:e,priority:t,callback:n}),a.push=function(e,t=0,a){return i(n(e,t),a)},a.pushAsync=function(e,t=0,a){return r(n(e,t),a)},delete a.unshift,delete a.unshiftAsync,a}function ie(e,t,n,a){var i=[...e].reverse();return qe(i,t,n,a)}function re(e){var t=c(e);return n(function a(e,n){return e.push((e,...t)=>{let a={};if(e&&(a.error=e),0=t.length&&([i]=t),a.value=i}n(null,a)}),t.apply(this,e)})}function se(e){var t;return Array.isArray(e)?t=e.map(re):(t={},Object.keys(e).forEach(n=>{t[n]=re.call(this,e[n])})),t}function le(e,t,n,a){const i=c(n);return U(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},a)}function de(e){return function(){return e}}function ue(e,t,n){function a(){r((e,...t)=>{!1===e||(e&&s++arguments.length&&"function"==typeof e?(n=t||b(),t=e):(pe(i,e),n=n||b()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var r=c(t),s=1;return a(),n[Ce]}function pe(e,n){if("object"==typeof n)e.times=+n.times||kt,e.intervalFunc="function"==typeof n.interval?n.interval:de(+n.interval||vt),e.errorFilter=n.errorFilter;else if("number"==typeof n||"string"==typeof n)e.times=+n||kt;else throw new Error("Invalid arguments for async.retry")}function ce(e,t){t||(t=e,e=null);let a=e&&e.arity||t.length;d(t)&&(a+=1);var i=c(t);return n((t,n)=>{function r(e){i(...t,e)}return(t.length{function s(){var t=e.name||"anonymous",n=new Error("Callback function \""+t+"\" timed out.");n.code="ETIMEDOUT",a&&(n.info=a),d=!0,r(n)}var l,d=!1;n.push((...e)=>{d||(r(...e),clearTimeout(l))}),l=setTimeout(s,t),i(...n)})}function fe(e){for(var t=Array(e);e--;)t[e]=e;return t}function ye(e,t,n,a){var i=c(n);return De(fe(e),t,i,a)}function me(e,t,n){return ye(e,1/0,t,n)}function ge(e,t,n){return ye(e,1,t,n)}function ke(e,t,n,a){3>=arguments.length&&"function"==typeof t&&(a=n,n=t,t=Array.isArray(e)?[]:{}),a=m(a||b());var i=c(n);return Me(e,(e,n,a)=>{i(t,e,n,a)},e=>a(e,t)),a[Ce]}function ve(e){return(...t)=>(e.unmemoized||e)(...t)}function Se(e,t,n){const a=c(e);return _t(e=>a((t,n)=>e(t,!n)),t,n)}var xe,Le="function"==typeof queueMicrotask&&queueMicrotask,Ee="function"==typeof setImmediate&&setImmediate,Oe="object"==typeof process&&"function"==typeof process.nextTick;xe=Le?queueMicrotask:Ee?setImmediate:Oe?process.nextTick:a;var _e=i(xe);const be={};var Ae=e=>(t,n,a)=>{function i(e,t){if(!d)if(c-=1,e)l=!0,a(e);else if(!1===e)l=!0,d=!0;else{if(t===be||l&&0>=c)return l=!0,a(null);o||r()}}function r(){for(o=!0;c=c&&a(null));c+=1,n(t.value,t.key,L(i))}o=!1}if(a=m(a),0>=e)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return a(null);if(u(t))return E(t,e,n,a);if(p(t))return E(t[Symbol.asyncIterator](),e,n,a);var s=x(t),l=!1,d=!1,c=0,o=!1;r()},Ie=o(function i(e,t,n,a){return Ae(t)(e,c(n),a)},4),Me=o(function a(e,t,n){var i=y(e)?O:_;return i(e,c(t),n)},3),je=o(function a(e,t,n){return f(Me,e,t,n)},3),we=h(je),Be=o(function a(e,t,n){return Ie(e,1,t,n)},3),Te=o(function a(e,t,n){return f(Be,e,t,n)},3),Fe=h(Te);const Ce=Symbol("promiseCallback");var Pe=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,Re=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,ze=/,/,Ne=/(=.+)?(\s*)$/;class Ve{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):w(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):w(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}var Ye,qe=o(function i(e,t,n,a){a=m(a);var r=c(n);return Be(e,(e,n,a)=>{r(t,e,(e,n)=>{t=n,a(e)})},e=>a(e,t))},4),De=o(function i(e,t,n,a){return f(Ae(t),e,n,a)},4),Qe=o(function i(e,t,n,a){var r=c(n);return De(e,t,(e,t)=>{r(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],r=0;re,(e,t)=>t)(Me,e,t,n)},3),He=o(function i(e,t,n,a){return z(e=>e,(e,t)=>t)(Ae(t),e,n,a)},4),Je=o(function a(e,t,n){return z(e=>e,(e,t)=>t)(Ae(1),e,t,n)},3),Ke=N("dir"),Xe=o(function a(e,t,n){function i(e,...t){return e?n(e):void(!1===e||(s=t,d(...t,r)))}function r(e,t){return e?n(e):!1===e?void 0:t?void l(i):n(null,...s)}n=L(n);var s,l=c(e),d=c(t);return r(null,!0)},3),Ze=o(function a(e,t,n){return Me(e,Y(c(t)),n)},3),$e=o(function i(e,t,n,a){return Ae(t)(e,Y(c(n)),a)},4),et=o(function a(e,t,n){return $e(e,1,t,n)},3),tt=o(function a(e,t,n){return z(e=>!e,e=>!e)(Me,e,t,n)},3),nt=o(function i(e,t,n,a){return z(e=>!e,e=>!e)(Ae(t),e,n,a)},4),at=o(function a(e,t,n){return z(e=>!e,e=>!e)(Be,e,t,n)},3),it=o(function a(e,t,n){return U(Me,e,t,n)},3),rt=o(function i(e,t,n,a){return U(Ae(t),e,n,a)},4),st=o(function a(e,t,n){return U(Be,e,t,n)},3),lt=o(function n(e,t){function a(e){return e?i(e):void(!1===e||r(a))}var i=L(t),r=c(q(e));return a()},2),dt=o(function i(e,t,n,a){var r=c(n);return De(e,t,(e,t)=>{r(e,(n,a)=>n?t(n):t(n,{key:a,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:r}=Object.prototype,s=0;s{s(e,t,(e,a)=>e?n(e):void(r[t]=a,n(e)))},e=>a(e,r))},4);Ye=Oe?process.nextTick:Ee?setImmediate:a;var ct=i(Ye),ot=o((e,t,n)=>{var a=y(t)?[]:{};e(t,(e,t,n)=>{c(e)((e,...i)=>{2>i.length&&([i]=i),a[t]=i,n(e)})},e=>n(e,a))},3);class ht{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){for(let n;0e)(Me,e,t,n)},3),xt=o(function i(e,t,n,a){return z(Boolean,e=>e)(Ae(t),e,n,a)},4),Lt=o(function a(e,t,n){return z(Boolean,e=>e)(Be,e,t,n)},3),Et=o(function a(e,t,n){function i(e,t){var n=e.criteria,a=t.criteria;return na?1:0}var r=c(t);return je(e,(e,t)=>{r(e,(n,a)=>n?t(n):void t(n,{value:e,criteria:a}))},(e,t)=>e?n(e):void n(null,t.sort(i).map(e=>e.value)))},3),Ot=o(function n(e,t){var a,i=null;return et(e,(e,t)=>{c(e)((e,...n)=>!1===e?t(e):void(2>n.length?[a]=n:a=n,i=e,t(e?null:{})))},()=>t(i,a))}),_t=o(function a(e,t,n){function i(e,...t){if(e)return n(e);d=t;!1===e||l(r)}function r(e,t){return e?n(e):!1===e?void 0:t?void s(i):n(null,...d)}n=L(n);var s=c(t),l=c(e),d=[];return l(r)},3),bt=o(function n(e,t){function a(t){var n=c(e[r++]);n(...t,L(i))}function i(n,...i){return!1===n?void 0:n||r===e.length?t(n,...i):void a(i)}if(t=m(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;a([])});e.all=tt,e.allLimit=nt,e.allSeries=at,e.any=St,e.anyLimit=xt,e.anySeries=Lt,e.apply=t,e.applyEach=we,e.applyEachSeries=Fe,e.asyncify=r,e.auto=A,e.autoInject=j,e.cargo=T,e.cargoQueue=F,e.compose=P,e.concat=Ue,e.concatLimit=Qe,e.concatSeries=Ge,e.constant=R,e.default={apply:t,applyEach:we,applyEachSeries:Fe,asyncify:r,auto:A,autoInject:j,cargo:T,cargoQueue:F,compose:P,concat:Ue,concatLimit:Qe,concatSeries:Ge,constant:R,detect:We,detectLimit:He,detectSeries:Je,dir:Ke,doUntil:V,doWhilst:Xe,each:Ze,eachLimit:$e,eachOf:Me,eachOfLimit:Ie,eachOfSeries:Be,eachSeries:et,ensureAsync:q,every:tt,everyLimit:nt,everySeries:at,filter:it,filterLimit:rt,filterSeries:st,forever:lt,groupBy:G,groupByLimit:dt,groupBySeries:W,log:ut,map:je,mapLimit:De,mapSeries:Te,mapValues:H,mapValuesLimit:pt,mapValuesSeries:J,memoize:K,nextTick:ct,parallel:X,parallelLimit:Z,priorityQueue:ae,queue:$,race:ft,reduce:qe,reduceRight:ie,reflect:re,reflectAll:se,reject:yt,rejectLimit:mt,rejectSeries:gt,retry:ue,retryable:ce,seq:C,series:oe,setImmediate:_e,some:St,someLimit:xt,someSeries:Lt,sortBy:Et,timeout:he,times:me,timesLimit:ye,timesSeries:ge,transform:ke,tryEach:Ot,unmemoize:ve,until:Se,waterfall:bt,whilst:_t,all:tt,allLimit:nt,allSeries:at,any:St,anyLimit:xt,anySeries:Lt,find:We,findLimit:He,findSeries:Je,flatMap:Ue,flatMapLimit:Qe,flatMapSeries:Ge,forEach:Ze,forEachSeries:et,forEachLimit:$e,forEachOf:Me,forEachOfSeries:Be,forEachOfLimit:Ie,inject:qe,foldl:qe,foldr:ie,select:it,selectLimit:rt,selectSeries:st,wrapSync:r,during:_t,doDuring:Xe},e.detect=We,e.detectLimit=He,e.detectSeries=Je,e.dir=Ke,e.doDuring=Xe,e.doUntil=V,e.doWhilst=Xe,e.during=_t,e.each=Ze,e.eachLimit=$e,e.eachOf=Me,e.eachOfLimit=Ie,e.eachOfSeries=Be,e.eachSeries=et,e.ensureAsync=q,e.every=tt,e.everyLimit=nt,e.everySeries=at,e.filter=it,e.filterLimit=rt,e.filterSeries=st,e.find=We,e.findLimit=He,e.findSeries=Je,e.flatMap=Ue,e.flatMapLimit=Qe,e.flatMapSeries=Ge,e.foldl=qe,e.foldr=ie,e.forEach=Ze,e.forEachLimit=$e,e.forEachOf=Me,e.forEachOfLimit=Ie,e.forEachOfSeries=Be,e.forEachSeries=et,e.forever=lt,e.groupBy=G,e.groupByLimit=dt,e.groupBySeries=W,e.inject=qe,e.log=ut,e.map=je,e.mapLimit=De,e.mapSeries=Te,e.mapValues=H,e.mapValuesLimit=pt,e.mapValuesSeries=J,e.memoize=K,e.nextTick=ct,e.parallel=X,e.parallelLimit=Z,e.priorityQueue=ae,e.queue=$,e.race=ft,e.reduce=qe,e.reduceRight=ie,e.reflect=re,e.reflectAll=se,e.reject=yt,e.rejectLimit=mt,e.rejectSeries=gt,e.retry=ue,e.retryable=ce,e.select=it,e.selectLimit=rt,e.selectSeries=st,e.seq=C,e.series=oe,e.setImmediate=_e,e.some=St,e.someLimit=xt,e.someSeries=Lt,e.sortBy=Et,e.timeout=he,e.times=me,e.timesLimit=ye,e.timesSeries=ge,e.transform=ke,e.tryEach=Ot,e.unmemoize=ve,e.until=Se,e.waterfall=bt,e.whilst=_t,e.wrapSync=r,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/node_modules/async/dist/async.mjs b/node_modules/async/dist/async.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2c599653364adb384d88e49e712dd471b83cd49a --- /dev/null +++ b/node_modules/async/dist/async.mjs @@ -0,0 +1,5948 @@ +/** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ +function apply(fn, ...args) { + return (...callArgs) => fn(...args,...callArgs); +} + +function initialParams (fn) { + return function (...args/*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; +} + +/* istanbul ignore file */ + +var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; +var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); +} + +var _defer$1; + +if (hasQueueMicrotask) { + _defer$1 = queueMicrotask; +} else if (hasSetImmediate) { + _defer$1 = setImmediate; +} else if (hasNextTick) { + _defer$1 = process.nextTick; +} else { + _defer$1 = fallback; +} + +var setImmediate$1 = wrap(_defer$1); + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if (isAsync(func)) { + return function (...args/*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback) + } + } + + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback) + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + setImmediate$1(e => { throw e }, err); + } +} + +function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; +} + +function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; +} + +function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function') + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; +} + +// conditionally promisify a function. +// only return a promise if a callback is omitted +function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined') + function awaitable (...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args) + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err) + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }) + } + + return awaitable +} + +function applyEach$1 (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = awaitify(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + wrapAsync(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; +} + +function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); +} + +function isArrayLike(value) { + return value && + typeof value.length === 'number' && + value.length >= 0 && + value.length % 1 === 0; +} + +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +const breakLoop = {}; + +function once(fn) { + function wrapper (...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper +} + +function getIterator (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); +} + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } +} + +function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? {value: obj[key], key} : null; + }; +} + +function createIterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } + + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} + +function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; +} + +// for async generators +function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({value, done: iterDone}) => { + //console.log('got value', value) + if (canceled || done) return + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return + if (err) return handleError(err) + + if (err === false) { + done = true; + canceled = true; + return + } + + if (result === breakLoop || (done && running <= 0)) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return + awaiting = false; + done = true; + callback(err); + } + + replenish(); +} + +var eachOfLimit$2 = (limit) => { + return (obj, iteratee, callback) => { + callback = once(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1') + } + if (!obj) { + return callback(null); + } + if (isAsyncGenerator(obj)) { + return asyncEachOfLimit(obj, limit, iteratee, callback) + } + if (isAsyncIterable(obj)) { + return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) + } + var nextElem = createIterator(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (err === false) { + done = true; + canceled = true; + } + else if (value === breakLoop || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } + + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +}; + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); +} + +var eachOfLimit$1 = awaitify(eachOfLimit, 4); + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback); + var index = 0, + completed = 0, + {length} = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric (coll, iteratee, callback) { + return eachOfLimit$1(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, wrapAsync(iteratee), callback); +} + +var eachOf$1 = awaitify(eachOf, 3); + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function map (coll, iteratee, callback) { + return _asyncMap(eachOf$1, coll, iteratee, callback) +} +var map$1 = awaitify(map, 3); + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ +var applyEach = applyEach$1(map$1); + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return eachOfLimit$1(coll, 1, iteratee, callback) +} +var eachOfSeries$1 = awaitify(eachOfSeries, 3); + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapSeries (coll, iteratee, callback) { + return _asyncMap(eachOfSeries$1, coll, iteratee, callback) +} +var mapSeries$1 = awaitify(mapSeries, 3); + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ +var applyEachSeries = applyEach$1(mapSeries$1); + +const PROMISE_SYMBOL = Symbol('promiseCallback'); + +function promiseCallback () { + let resolve, reject; + function callback (err, ...args) { + if (err) return reject(err) + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, + reject = rej; + }); + + return callback +} + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || promiseCallback()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = onlyOnce((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[PROMISE_SYMBOL] +} + +var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; +var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; + +function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index+1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = (endIndex === -1) ? string.length : endIndex; + } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; +} + +function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) + let [, args] = match; + return args + .replace(/\s/g, '') + .split(FN_ARG_SPLIT) + .map((arg) => arg.replace(FN_ARG, '').trim()); +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + wrapAsync(taskFn)(...newArgs); + } + }); + + return auto(newTasks, callback); +} + +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty () { + while(this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this] + } + + *[Symbol.iterator] () { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove (testFn) { + var curr = this.head; + while(curr) { + var {next} = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } +} + +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} + +function queue$1(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on (event, handler) { + events[event].push(handler); + } + + function once (event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off (event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []) + if (!handler) return events[event] = [] + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger (event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback (err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res() + if (args.length <= 1) return res(args[0]) + res(args); + } + + var item = q._createTaskItem( + data, + rejectOnError ? promiseCallback : + (callback || promiseCallback) + ); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }) + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= (q.concurrency - q.buffer) ) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + setImmediate$1(() => trigger('drain')); + return true + } + return false + } + + const eventMethod = (name) => (handler) => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err) + resolve(data); + }); + }) + } + off(name); + on(name, handler); + + }; + + var isProcessing = false; + var q = { + _tasks: new DLL(), + _createTaskItem (data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator] () { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, false, callback)) + } + return _insert(data, false, false, callback); + }, + pushAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, true, callback)) + } + return _insert(data, false, true, callback); + }, + kill () { + off(); + q._tasks.empty(); + }, + unshift (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, false, callback)) + } + return _insert(data, true, false, callback); + }, + unshiftAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, true, callback)) + } + return _insert(data, true, true, callback); + }, + remove (testFn) { + q._tasks.remove(testFn); + }, + process () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = onlyOnce(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length () { + return q._tasks.length; + }, + running () { + return numRunning; + }, + workersList () { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause () { + q.paused = true; + }, + resume () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + }, + }); + return q; +} + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = once(callback); + var _iteratee = wrapAsync(iteratee); + return eachOfSeries$1(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +var reduce$1 = awaitify(reduce, 4); + +/** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ +function seq(...functions) { + var _functions = functions.map(wrapAsync); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = promiseCallback(); + } + + reduce$1(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, + (err, results) => cb(err, ...results)); + + return cb[PROMISE_SYMBOL] + }; +} + +/** + * Creates a function which is a composition of the passed asynchronous + * functions. Each function consumes the return value of the function that + * follows. Composing functions `f()`, `g()`, and `h()` would produce the result + * of `f(g(h()))`, only this version uses callbacks to obtain the return values. + * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name compose + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} an asynchronous function that is the composed + * asynchronous `functions` + * @example + * + * function add1(n, callback) { + * setTimeout(function () { + * callback(null, n + 1); + * }, 10); + * } + * + * function mul3(n, callback) { + * setTimeout(function () { + * callback(null, n * 3); + * }, 10); + * } + * + * var add1mul3 = async.compose(mul3, add1); + * add1mul3(4, function (err, result) { + * // result now equals 15 + * }); + */ +function compose(...args) { + return seq(...args.reverse()); +} + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapLimit (coll, limit, iteratee, callback) { + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) +} +var mapLimit$1 = awaitify(mapLimit, 4); + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +var concatLimit$1 = awaitify(concatLimit, 4); + +/** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return concatLimit$1(coll, Infinity, iteratee, callback) +} +var concat$1 = awaitify(concat, 3); + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return concatLimit$1(coll, 1, iteratee, callback) +} +var concatSeries$1 = awaitify(concatSeries, 3); + +/** + * Returns a function that when called, calls-back with the values provided. + * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to + * [`auto`]{@link module:ControlFlow.auto}. + * + * @name constant + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {...*} arguments... - Any number of arguments to automatically invoke + * callback with. + * @returns {AsyncFunction} Returns a function that when invoked, automatically + * invokes the callback with the previous given arguments. + * @example + * + * async.waterfall([ + * async.constant(42), + * function (value, next) { + * // value === 42 + * }, + * //... + * ], callback); + * + * async.waterfall([ + * async.constant(filename, "utf8"), + * fs.readFile, + * function (fileData, next) { + * //... + * } + * //... + * ], callback); + * + * async.auto({ + * hostname: async.constant("https://server.net/"), + * port: findFreePort, + * launchServer: ["hostname", "port", function (options, cb) { + * startServer(options, cb); + * }], + * //... + * }, callback); + */ +function constant$1(...args) { + return function (...ignoredArgs/*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; +} + +function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = wrapAsync(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, breakLoop); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; +} + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) +} +var detect$1 = awaitify(detect, 3); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var detectLimit$1 = awaitify(detectLimit, 4); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) +} + +var detectSeries$1 = awaitify(detectSeries, 3); + +function consoleFunc(name) { + return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }) +} + +/** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ +var dir = consoleFunc('dir'); + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +var doWhilst$1 = awaitify(doWhilst, 3); + +/** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doUntil(iteratee, test, callback) { + const _test = wrapAsync(test); + return doWhilst$1(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb (err, !truth)); + }, callback); +} + +function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); +} + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit$2(coll, iteratee, callback) { + return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} + +var each = awaitify(eachLimit$2, 3); + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} +var eachLimit$1 = awaitify(eachLimit, 4); + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return eachLimit$1(coll, 1, iteratee, callback) +} +var eachSeries$1 = awaitify(eachSeries, 3); + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return function (...args/*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + setImmediate$1(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; +} + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) +} +var every$1 = awaitify(every, 3); + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var everyLimit$1 = awaitify(everyLimit, 4); + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) +} +var everySeries$1 = awaitify(everySeries, 3); + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({index, value: x}); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results + .sort((a, b) => a.index - b.index) + .map(v => v.value)); + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, wrapAsync(iteratee), callback); +} + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter (coll, iteratee, callback) { + return _filter(eachOf$1, coll, iteratee, callback) +} +var filter$1 = awaitify(filter, 3); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit (coll, limit, iteratee, callback) { + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) +} +var filterLimit$1 = awaitify(filterLimit, 4); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries (coll, iteratee, callback) { + return _filter(eachOfSeries$1, coll, iteratee, callback) +} +var filterSeries$1 = awaitify(filterSeries, 3); + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = onlyOnce(errback); + var task = wrapAsync(ensureAsync(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); +} +var forever$1 = awaitify(forever, 2); + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, {key, val}); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var {hasOwnProperty} = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var {key} = mapResults[i]; + var {val} = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +} + +var groupByLimit$1 = awaitify(groupByLimit, 4); + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function groupBy (coll, iteratee, callback) { + return groupByLimit$1(coll, Infinity, iteratee, callback) +} + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupBySeries (coll, iteratee, callback) { + return groupByLimit$1(coll, 1, iteratee, callback) +} + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +var log = consoleFunc('log'); + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); +} + +var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function mapValues(obj, iteratee, callback) { + return mapValuesLimit$1(obj, Infinity, iteratee, callback) +} + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesSeries(obj, iteratee, callback) { + return mapValuesLimit$1(obj, 1, iteratee, callback) +} + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = wrapAsync(fn); + var memoized = initialParams((args, callback) => { + var key = hasher(...args); + if (key in memo) { + setImmediate$1(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} + +/* istanbul ignore file */ + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer; + +if (hasNextTick) { + _defer = process.nextTick; +} else if (hasSetImmediate) { + _defer = setImmediate; +} else { + _defer = fallback; +} + +var nextTick = wrap(_defer); + +var _parallel = awaitify((eachfn, tasks, callback) => { + var results = isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + wrapAsync(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); +}, 3); + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); +} + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ +function parallelLimit(tasks, limit, callback) { + return _parallel(eachOfLimit$2(limit), tasks, callback); +} + +/** + * A queue of tasks for the worker function to complete. + * @typedef {Iterable} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {number} payload - an integer that specifies how many items are + * passed to the worker function at a time. only applies if this is a + * [cargo]{@link module:ControlFlow.cargo} object + * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns + * a promise that rejects if an error occurs. + * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns + * a promise that rejects if an error occurs. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a function that sets a callback that is + * called when the number of running workers hits the `concurrency` limit, and + * further tasks will be queued. If the callback is omitted, `q.saturated()` + * returns a promise for the next occurrence. + * @property {Function} unsaturated - a function that sets a callback that is + * called when the number of running workers is less than the `concurrency` & + * `buffer` limits, and further tasks will not be queued. If the callback is + * omitted, `q.unsaturated()` returns a promise for the next occurrence. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a function that sets a callback that is called + * when the last item from the `queue` is given to a `worker`. If the callback + * is omitted, `q.empty()` returns a promise for the next occurrence. + * @property {Function} drain - a function that sets a callback that is called + * when the last item from the `queue` has returned from the `worker`. If the + * callback is omitted, `q.drain()` returns a promise for the next occurrence. + * @property {Function} error - a function that sets a callback that is called + * when a task errors. Has the signature `function(error, task)`. If the + * callback is omitted, `error()` returns a promise that rejects on the next + * error. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + * + * @example + * const q = async.queue(worker, 2) + * q.push(item1) + * q.push(item2) + * q.push(item3) + * // queues are iterable, spread into an array to inspect + * const items = [...q] // [item1, item2, item3] + * // or use for of + * for (let item of q) { + * console.log(item) + * } + * + * q.drain(() => { + * console.log('all done') + * }) + * // or + * await q.drain() + */ + +/** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain(function() { + * console.log('all items have been processed'); + * }); + * // or await the end + * await q.drain() + * + * // assign an error callback + * q.error(function(err, task) { + * console.error('task experienced an error'); + * }); + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * // callback is optional + * q.push({name: 'bar'}); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ +function queue (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue$1((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); +} + +// Binary min-heap implementation used for priority queue. +// Implementation is stable, i.e. push time is considered for equal priorities +class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty () { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l=leftChi(index)) < this.heap.length) { + if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { + l = l+1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length-1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length-1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator] () { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove (testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length-1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } +} + +function leftChi(i) { + return (i<<1)+1; +} + +function parent(i) { + return ((i+1)>>1)-1; +} + +function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } + else { + return x.pushCount < y.pushCount; + } +} + +/** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, + * except this returns a promise that rejects if an error occurs. + * * The `unshift` and `unshiftAsync` methods were removed. + */ +function priorityQueue(worker, concurrency) { + // Start with a normal queue + var q = queue(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new Heap(); + q._createTaskItem = ({data, priority}, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return {data: tasks, priority}; + } + return tasks.map(data => { return {data, priority}; }); + } + + // Override push to accept second parameter representing priority + q.push = function(data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function(data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; +} + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } +} + +var race$1 = awaitify(race, 2); + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight (array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return reduce$1(reversed, memo, iteratee, callback); +} + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0){ + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); +} + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(reflect); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = reflect.call(this, tasks[key]); + }); + } + return results; +} + +function reject$2(eachfn, arr, _iteratee, callback) { + const iteratee = wrapAsync(_iteratee); + return _filter(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); +} + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) +} +var reject$1 = awaitify(reject, 3); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectLimit (coll, limit, iteratee, callback) { + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) +} +var rejectLimit$1 = awaitify(rejectLimit, 4); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectSeries (coll, iteratee, callback) { + return reject$2(eachOfSeries$1, coll, iteratee, callback) +} +var rejectSeries$1 = awaitify(rejectSeries, 3); + +function constant(value) { + return function () { + return value; + } +} + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +const DEFAULT_TIMES = 5; +const DEFAULT_INTERVAL = 0; + +function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || promiseCallback(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || promiseCallback(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = wrapAsync(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[PROMISE_SYMBOL] +} + +function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } +} + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ +function retryable (opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = (opts && opts.arity) || task.length; + if (isAsync(task)) { + arity += 1; + } + var _task = wrapAsync(task); + return initialParams((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = promiseCallback(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + + return callback[PROMISE_SYMBOL] + }); +} + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function series(tasks, callback) { + return _parallel(eachOfSeries$1, tasks, callback); +} + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) +} +var some$1 = awaitify(some, 3); + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var someLimit$1 = awaitify(someLimit, 4); + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) +} +var someSeries$1 = awaitify(someSeries, 3); + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return map$1(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, {value: x, criteria}); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} +var sortBy$1 = awaitify(sortBy, 3); + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); + + return initialParams((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); +} + +function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; +} + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(range(count), limit, _iteratee, callback); +} + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +function times (n, iteratee, callback) { + return timesLimit(n, Infinity, iteratee, callback) +} + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesSeries (n, iteratee, callback) { + return timesLimit(n, 1, iteratee, callback) +} + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = once(callback || promiseCallback()); + var _iteratee = wrapAsync(iteratee); + + eachOf$1(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[PROMISE_SYMBOL] +} + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + return eachSeries$1(tasks, (task, taskCb) => { + wrapAsync(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); +} + +var tryEach$1 = awaitify(tryEach); + +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; +} + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +var whilst$1 = awaitify(whilst, 3); + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ +function until(test, iteratee, callback) { + const _test = wrapAsync(test); + return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); +} + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ +function waterfall (tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + task(...args, onlyOnce(next)); + } + + function next(err, ...args) { + if (err === false) return + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); +} + +var waterfall$1 = awaitify(waterfall); + +/** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + + +var index = { + apply, + applyEach, + applyEachSeries, + asyncify, + auto, + autoInject, + cargo: cargo$1, + cargoQueue: cargo, + compose, + concat: concat$1, + concatLimit: concatLimit$1, + concatSeries: concatSeries$1, + constant: constant$1, + detect: detect$1, + detectLimit: detectLimit$1, + detectSeries: detectSeries$1, + dir, + doUntil, + doWhilst: doWhilst$1, + each, + eachLimit: eachLimit$1, + eachOf: eachOf$1, + eachOfLimit: eachOfLimit$1, + eachOfSeries: eachOfSeries$1, + eachSeries: eachSeries$1, + ensureAsync, + every: every$1, + everyLimit: everyLimit$1, + everySeries: everySeries$1, + filter: filter$1, + filterLimit: filterLimit$1, + filterSeries: filterSeries$1, + forever: forever$1, + groupBy, + groupByLimit: groupByLimit$1, + groupBySeries, + log, + map: map$1, + mapLimit: mapLimit$1, + mapSeries: mapSeries$1, + mapValues, + mapValuesLimit: mapValuesLimit$1, + mapValuesSeries, + memoize, + nextTick, + parallel, + parallelLimit, + priorityQueue, + queue, + race: race$1, + reduce: reduce$1, + reduceRight, + reflect, + reflectAll, + reject: reject$1, + rejectLimit: rejectLimit$1, + rejectSeries: rejectSeries$1, + retry, + retryable, + seq, + series, + setImmediate: setImmediate$1, + some: some$1, + someLimit: someLimit$1, + someSeries: someSeries$1, + sortBy: sortBy$1, + timeout, + times, + timesLimit, + timesSeries, + transform, + tryEach: tryEach$1, + unmemoize, + until, + waterfall: waterfall$1, + whilst: whilst$1, + + // aliases + all: every$1, + allLimit: everyLimit$1, + allSeries: everySeries$1, + any: some$1, + anyLimit: someLimit$1, + anySeries: someSeries$1, + find: detect$1, + findLimit: detectLimit$1, + findSeries: detectSeries$1, + flatMap: concat$1, + flatMapLimit: concatLimit$1, + flatMapSeries: concatSeries$1, + forEach: each, + forEachSeries: eachSeries$1, + forEachLimit: eachLimit$1, + forEachOf: eachOf$1, + forEachOfSeries: eachOfSeries$1, + forEachOfLimit: eachOfLimit$1, + inject: reduce$1, + foldl: reduce$1, + foldr: reduceRight, + select: filter$1, + selectLimit: filterLimit$1, + selectSeries: filterSeries$1, + wrapSync: asyncify, + during: whilst$1, + doDuring: doWhilst$1 +}; + +export { every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, apply, applyEach, applyEachSeries, asyncify, auto, autoInject, cargo$1 as cargo, cargo as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant$1 as constant, index as default, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doWhilst$1 as doDuring, doUntil, doWhilst$1 as doWhilst, whilst$1 as during, each, eachLimit$1 as eachLimit, eachOf$1 as eachOf, eachOfLimit$1 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, reduce$1 as foldl, reduceRight as foldr, each as forEach, eachLimit$1 as forEachLimit, eachOf$1 as forEachOf, eachOfLimit$1 as forEachOfLimit, eachOfSeries$1 as forEachOfSeries, eachSeries$1 as forEachSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, reduce$1 as inject, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel, parallelLimit, priorityQueue, queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$1 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, asyncify as wrapSync }; diff --git a/node_modules/async/doDuring.js b/node_modules/async/doDuring.js new file mode 100644 index 0000000000000000000000000000000000000000..c72766d0aa71eda780651a75368fddfcb9bfbfd1 --- /dev/null +++ b/node_modules/async/doDuring.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +exports.default = (0, _awaitify2.default)(doWhilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/doUntil.js b/node_modules/async/doUntil.js new file mode 100644 index 0000000000000000000000000000000000000000..519900ee9971e4b30ffcd42ebb31785e6cad219c --- /dev/null +++ b/node_modules/async/doUntil.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = doUntil; + +var _doWhilst = require('./doWhilst.js'); + +var _doWhilst2 = _interopRequireDefault(_doWhilst); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doUntil(iteratee, test, callback) { + const _test = (0, _wrapAsync2.default)(test); + return (0, _doWhilst2.default)(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb(err, !truth)); + }, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/doWhilst.js b/node_modules/async/doWhilst.js new file mode 100644 index 0000000000000000000000000000000000000000..c72766d0aa71eda780651a75368fddfcb9bfbfd1 --- /dev/null +++ b/node_modules/async/doWhilst.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +exports.default = (0, _awaitify2.default)(doWhilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/during.js b/node_modules/async/during.js new file mode 100644 index 0000000000000000000000000000000000000000..4165543f818028d988dc57f051ab2a476f42abf9 --- /dev/null +++ b/node_modules/async/during.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +exports.default = (0, _awaitify2.default)(whilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/each.js b/node_modules/async/each.js new file mode 100644 index 0000000000000000000000000000000000000000..fdfcbd882196dccf29b87a410f51070310723c16 --- /dev/null +++ b/node_modules/async/each.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} + +exports.default = (0, _awaitify2.default)(eachLimit, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachLimit.js b/node_modules/async/eachLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..7f5928c615590a0f0ee25229b107a87df10533e5 --- /dev/null +++ b/node_modules/async/eachLimit.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +exports.default = (0, _awaitify2.default)(eachLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOf.js b/node_modules/async/eachOf.js new file mode 100644 index 0000000000000000000000000000000000000000..9ed20f669fcbe47bebc859d077ebab6c92e3309c --- /dev/null +++ b/node_modules/async/eachOf.js @@ -0,0 +1,185 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./internal/isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index = 0, + completed = 0, + { length } = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return; + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOf, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOfLimit.js b/node_modules/async/eachOfLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..a596e5ac08892d34395d76bfbd1d9f428675243c --- /dev/null +++ b/node_modules/async/eachOfLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit2 = require('./internal/eachOfLimit.js'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOfLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOfSeries.js b/node_modules/async/eachOfSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..04243ada0a45deac56a83f2e4a0755f710094e9b --- /dev/null +++ b/node_modules/async/eachOfSeries.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachOfSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachSeries.js b/node_modules/async/eachSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..b04896e394ee5a2eaaac746c9c0eff805ce08968 --- /dev/null +++ b/node_modules/async/eachSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit.js'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return (0, _eachLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/ensureAsync.js b/node_modules/async/ensureAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..749c5dac74d9037ca75128112b5f5b7ebde31bd4 --- /dev/null +++ b/node_modules/async/ensureAsync.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = ensureAsync; + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if ((0, _wrapAsync.isAsync)(fn)) return fn; + return function (...args /*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + (0, _setImmediate2.default)(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/every.js b/node_modules/async/every.js new file mode 100644 index 0000000000000000000000000000000000000000..622b301941b95c7c756a5f8b98a3116b3a07b908 --- /dev/null +++ b/node_modules/async/every.js @@ -0,0 +1,119 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(every, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/everyLimit.js b/node_modules/async/everyLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..375e126021af6f8f30ebee8fa4e9bd61d5d0be29 --- /dev/null +++ b/node_modules/async/everyLimit.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everyLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/everySeries.js b/node_modules/async/everySeries.js new file mode 100644 index 0000000000000000000000000000000000000000..9a6bf7d468409fd7bf6c77aba5cb2e79f32e1847 --- /dev/null +++ b/node_modules/async/everySeries.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everySeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filter.js b/node_modules/async/filter.js new file mode 100644 index 0000000000000000000000000000000000000000..2c9a63de5b447820152e40c6be73bd97a0e56964 --- /dev/null +++ b/node_modules/async/filter.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filter, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filterLimit.js b/node_modules/async/filterLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..d3b3f50c61df2797efade248307ee679548fcf3e --- /dev/null +++ b/node_modules/async/filterLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit(coll, limit, iteratee, callback) { + return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filterSeries.js b/node_modules/async/filterSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..019a2d0a9d50a34760b3d5a5d6f366509e4e381e --- /dev/null +++ b/node_modules/async/filterSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/find.js b/node_modules/async/find.js new file mode 100644 index 0000000000000000000000000000000000000000..d5896ef6435296a9abad3e771b05a9b261e018f2 --- /dev/null +++ b/node_modules/async/find.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detect, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/findLimit.js b/node_modules/async/findLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..c59843b6211ae6700bad86d4f73645c68b326bf4 --- /dev/null +++ b/node_modules/async/findLimit.js @@ -0,0 +1,48 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/findSeries.js b/node_modules/async/findSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..b48689967577f3d02265ed5053a013569be6d9ab --- /dev/null +++ b/node_modules/async/findSeries.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); +} + +exports.default = (0, _awaitify2.default)(detectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMap.js b/node_modules/async/flatMap.js new file mode 100644 index 0000000000000000000000000000000000000000..4540a79cffc444d45dcdbde37edb0b65b66d983b --- /dev/null +++ b/node_modules/async/flatMap.js @@ -0,0 +1,115 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concat, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMapLimit.js b/node_modules/async/flatMapLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..a27cc7d45ac5d77a8c275eedd60be2a162cb186c --- /dev/null +++ b/node_modules/async/flatMapLimit.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +exports.default = (0, _awaitify2.default)(concatLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMapSeries.js b/node_modules/async/flatMapSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..332de3f3ec4fbfcc818a867872bfb09a34208659 --- /dev/null +++ b/node_modules/async/flatMapSeries.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concatSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/foldl.js b/node_modules/async/foldl.js new file mode 100644 index 0000000000000000000000000000000000000000..8a69548a6efd9e974b5281f3bda4e29b1b1a48a2 --- /dev/null +++ b/node_modules/async/foldl.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/foldr.js b/node_modules/async/foldr.js new file mode 100644 index 0000000000000000000000000000000000000000..5be1b68dca537ea15872ba4b2710ad8c36b47a72 --- /dev/null +++ b/node_modules/async/foldr.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEach.js b/node_modules/async/forEach.js new file mode 100644 index 0000000000000000000000000000000000000000..fdfcbd882196dccf29b87a410f51070310723c16 --- /dev/null +++ b/node_modules/async/forEach.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} + +exports.default = (0, _awaitify2.default)(eachLimit, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachLimit.js b/node_modules/async/forEachLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..7f5928c615590a0f0ee25229b107a87df10533e5 --- /dev/null +++ b/node_modules/async/forEachLimit.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +exports.default = (0, _awaitify2.default)(eachLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOf.js b/node_modules/async/forEachOf.js new file mode 100644 index 0000000000000000000000000000000000000000..9ed20f669fcbe47bebc859d077ebab6c92e3309c --- /dev/null +++ b/node_modules/async/forEachOf.js @@ -0,0 +1,185 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./internal/isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index = 0, + completed = 0, + { length } = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return; + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOf, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOfLimit.js b/node_modules/async/forEachOfLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..a596e5ac08892d34395d76bfbd1d9f428675243c --- /dev/null +++ b/node_modules/async/forEachOfLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit2 = require('./internal/eachOfLimit.js'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOfLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOfSeries.js b/node_modules/async/forEachOfSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..04243ada0a45deac56a83f2e4a0755f710094e9b --- /dev/null +++ b/node_modules/async/forEachOfSeries.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachOfSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachSeries.js b/node_modules/async/forEachSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..b04896e394ee5a2eaaac746c9c0eff805ce08968 --- /dev/null +++ b/node_modules/async/forEachSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit.js'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return (0, _eachLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forever.js b/node_modules/async/forever.js new file mode 100644 index 0000000000000000000000000000000000000000..22925185e9d552f5a301f6132df44fe4d220ac8f --- /dev/null +++ b/node_modules/async/forever.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _ensureAsync = require('./ensureAsync.js'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = (0, _onlyOnce2.default)(errback); + var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); +} +exports.default = (0, _awaitify2.default)(forever, 2); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupBy.js b/node_modules/async/groupBy.js new file mode 100644 index 0000000000000000000000000000000000000000..f295763021ff65964deb2b47ad3c8187fb99cd66 --- /dev/null +++ b/node_modules/async/groupBy.js @@ -0,0 +1,108 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = groupBy; + +var _groupByLimit = require('./groupByLimit.js'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function groupBy(coll, iteratee, callback) { + return (0, _groupByLimit2.default)(coll, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupByLimit.js b/node_modules/async/groupByLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..30fd290af4e2282207a06fc161b2bf07d7b5bce1 --- /dev/null +++ b/node_modules/async/groupByLimit.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, { key, val }); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var { hasOwnProperty } = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var { key } = mapResults[i]; + var { val } = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +} + +exports.default = (0, _awaitify2.default)(groupByLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupBySeries.js b/node_modules/async/groupBySeries.js new file mode 100644 index 0000000000000000000000000000000000000000..e2a528749753bfb23e3fd676d64e990163ec72a0 --- /dev/null +++ b/node_modules/async/groupBySeries.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = groupBySeries; + +var _groupByLimit = require('./groupByLimit.js'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupBySeries(coll, iteratee, callback) { + return (0, _groupByLimit2.default)(coll, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/index.js b/node_modules/async/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6154647d6b28fc1c085544ddff289b0b0e4bdeef --- /dev/null +++ b/node_modules/async/index.js @@ -0,0 +1,588 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.doDuring = exports.during = exports.wrapSync = undefined; +exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.flatMapSeries = exports.flatMapLimit = exports.flatMap = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.doWhilst = exports.doUntil = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargoQueue = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; + +var _apply = require('./apply'); + +var _apply2 = _interopRequireDefault(_apply); + +var _applyEach = require('./applyEach'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _applyEachSeries = require('./applyEachSeries'); + +var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries); + +var _asyncify = require('./asyncify'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +var _auto = require('./auto'); + +var _auto2 = _interopRequireDefault(_auto); + +var _autoInject = require('./autoInject'); + +var _autoInject2 = _interopRequireDefault(_autoInject); + +var _cargo = require('./cargo'); + +var _cargo2 = _interopRequireDefault(_cargo); + +var _cargoQueue = require('./cargoQueue'); + +var _cargoQueue2 = _interopRequireDefault(_cargoQueue); + +var _compose = require('./compose'); + +var _compose2 = _interopRequireDefault(_compose); + +var _concat = require('./concat'); + +var _concat2 = _interopRequireDefault(_concat); + +var _concatLimit = require('./concatLimit'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _concatSeries = require('./concatSeries'); + +var _concatSeries2 = _interopRequireDefault(_concatSeries); + +var _constant = require('./constant'); + +var _constant2 = _interopRequireDefault(_constant); + +var _detect = require('./detect'); + +var _detect2 = _interopRequireDefault(_detect); + +var _detectLimit = require('./detectLimit'); + +var _detectLimit2 = _interopRequireDefault(_detectLimit); + +var _detectSeries = require('./detectSeries'); + +var _detectSeries2 = _interopRequireDefault(_detectSeries); + +var _dir = require('./dir'); + +var _dir2 = _interopRequireDefault(_dir); + +var _doUntil = require('./doUntil'); + +var _doUntil2 = _interopRequireDefault(_doUntil); + +var _doWhilst = require('./doWhilst'); + +var _doWhilst2 = _interopRequireDefault(_doWhilst); + +var _each = require('./each'); + +var _each2 = _interopRequireDefault(_each); + +var _eachLimit = require('./eachLimit'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _eachSeries = require('./eachSeries'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _ensureAsync = require('./ensureAsync'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _every = require('./every'); + +var _every2 = _interopRequireDefault(_every); + +var _everyLimit = require('./everyLimit'); + +var _everyLimit2 = _interopRequireDefault(_everyLimit); + +var _everySeries = require('./everySeries'); + +var _everySeries2 = _interopRequireDefault(_everySeries); + +var _filter = require('./filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _filterLimit = require('./filterLimit'); + +var _filterLimit2 = _interopRequireDefault(_filterLimit); + +var _filterSeries = require('./filterSeries'); + +var _filterSeries2 = _interopRequireDefault(_filterSeries); + +var _forever = require('./forever'); + +var _forever2 = _interopRequireDefault(_forever); + +var _groupBy = require('./groupBy'); + +var _groupBy2 = _interopRequireDefault(_groupBy); + +var _groupByLimit = require('./groupByLimit'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +var _groupBySeries = require('./groupBySeries'); + +var _groupBySeries2 = _interopRequireDefault(_groupBySeries); + +var _log = require('./log'); + +var _log2 = _interopRequireDefault(_log); + +var _map = require('./map'); + +var _map2 = _interopRequireDefault(_map); + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _mapSeries = require('./mapSeries'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +var _mapValues = require('./mapValues'); + +var _mapValues2 = _interopRequireDefault(_mapValues); + +var _mapValuesLimit = require('./mapValuesLimit'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +var _mapValuesSeries = require('./mapValuesSeries'); + +var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries); + +var _memoize = require('./memoize'); + +var _memoize2 = _interopRequireDefault(_memoize); + +var _nextTick = require('./nextTick'); + +var _nextTick2 = _interopRequireDefault(_nextTick); + +var _parallel = require('./parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +var _parallelLimit = require('./parallelLimit'); + +var _parallelLimit2 = _interopRequireDefault(_parallelLimit); + +var _priorityQueue = require('./priorityQueue'); + +var _priorityQueue2 = _interopRequireDefault(_priorityQueue); + +var _queue = require('./queue'); + +var _queue2 = _interopRequireDefault(_queue); + +var _race = require('./race'); + +var _race2 = _interopRequireDefault(_race); + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _reduceRight = require('./reduceRight'); + +var _reduceRight2 = _interopRequireDefault(_reduceRight); + +var _reflect = require('./reflect'); + +var _reflect2 = _interopRequireDefault(_reflect); + +var _reflectAll = require('./reflectAll'); + +var _reflectAll2 = _interopRequireDefault(_reflectAll); + +var _reject = require('./reject'); + +var _reject2 = _interopRequireDefault(_reject); + +var _rejectLimit = require('./rejectLimit'); + +var _rejectLimit2 = _interopRequireDefault(_rejectLimit); + +var _rejectSeries = require('./rejectSeries'); + +var _rejectSeries2 = _interopRequireDefault(_rejectSeries); + +var _retry = require('./retry'); + +var _retry2 = _interopRequireDefault(_retry); + +var _retryable = require('./retryable'); + +var _retryable2 = _interopRequireDefault(_retryable); + +var _seq = require('./seq'); + +var _seq2 = _interopRequireDefault(_seq); + +var _series = require('./series'); + +var _series2 = _interopRequireDefault(_series); + +var _setImmediate = require('./setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _some = require('./some'); + +var _some2 = _interopRequireDefault(_some); + +var _someLimit = require('./someLimit'); + +var _someLimit2 = _interopRequireDefault(_someLimit); + +var _someSeries = require('./someSeries'); + +var _someSeries2 = _interopRequireDefault(_someSeries); + +var _sortBy = require('./sortBy'); + +var _sortBy2 = _interopRequireDefault(_sortBy); + +var _timeout = require('./timeout'); + +var _timeout2 = _interopRequireDefault(_timeout); + +var _times = require('./times'); + +var _times2 = _interopRequireDefault(_times); + +var _timesLimit = require('./timesLimit'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +var _timesSeries = require('./timesSeries'); + +var _timesSeries2 = _interopRequireDefault(_timesSeries); + +var _transform = require('./transform'); + +var _transform2 = _interopRequireDefault(_transform); + +var _tryEach = require('./tryEach'); + +var _tryEach2 = _interopRequireDefault(_tryEach); + +var _unmemoize = require('./unmemoize'); + +var _unmemoize2 = _interopRequireDefault(_unmemoize); + +var _until = require('./until'); + +var _until2 = _interopRequireDefault(_until); + +var _waterfall = require('./waterfall'); + +var _waterfall2 = _interopRequireDefault(_waterfall); + +var _whilst = require('./whilst'); + +var _whilst2 = _interopRequireDefault(_whilst); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + +/** + * Async is a utility module which provides straight-forward, powerful functions + * for working with asynchronous JavaScript. Although originally designed for + * use with [Node.js](http://nodejs.org) and installable via + * `npm install --save async`, it can also be used directly in the browser. + * @module async + * @see AsyncFunction + */ + +/** + * A collection of `async` functions for manipulating collections, such as + * arrays and objects. + * @module Collections + */ + +/** + * A collection of `async` functions for controlling the flow through a script. + * @module ControlFlow + */ + +/** + * A collection of `async` utility functions. + * @module Utils + */ + +exports.default = { + apply: _apply2.default, + applyEach: _applyEach2.default, + applyEachSeries: _applyEachSeries2.default, + asyncify: _asyncify2.default, + auto: _auto2.default, + autoInject: _autoInject2.default, + cargo: _cargo2.default, + cargoQueue: _cargoQueue2.default, + compose: _compose2.default, + concat: _concat2.default, + concatLimit: _concatLimit2.default, + concatSeries: _concatSeries2.default, + constant: _constant2.default, + detect: _detect2.default, + detectLimit: _detectLimit2.default, + detectSeries: _detectSeries2.default, + dir: _dir2.default, + doUntil: _doUntil2.default, + doWhilst: _doWhilst2.default, + each: _each2.default, + eachLimit: _eachLimit2.default, + eachOf: _eachOf2.default, + eachOfLimit: _eachOfLimit2.default, + eachOfSeries: _eachOfSeries2.default, + eachSeries: _eachSeries2.default, + ensureAsync: _ensureAsync2.default, + every: _every2.default, + everyLimit: _everyLimit2.default, + everySeries: _everySeries2.default, + filter: _filter2.default, + filterLimit: _filterLimit2.default, + filterSeries: _filterSeries2.default, + forever: _forever2.default, + groupBy: _groupBy2.default, + groupByLimit: _groupByLimit2.default, + groupBySeries: _groupBySeries2.default, + log: _log2.default, + map: _map2.default, + mapLimit: _mapLimit2.default, + mapSeries: _mapSeries2.default, + mapValues: _mapValues2.default, + mapValuesLimit: _mapValuesLimit2.default, + mapValuesSeries: _mapValuesSeries2.default, + memoize: _memoize2.default, + nextTick: _nextTick2.default, + parallel: _parallel2.default, + parallelLimit: _parallelLimit2.default, + priorityQueue: _priorityQueue2.default, + queue: _queue2.default, + race: _race2.default, + reduce: _reduce2.default, + reduceRight: _reduceRight2.default, + reflect: _reflect2.default, + reflectAll: _reflectAll2.default, + reject: _reject2.default, + rejectLimit: _rejectLimit2.default, + rejectSeries: _rejectSeries2.default, + retry: _retry2.default, + retryable: _retryable2.default, + seq: _seq2.default, + series: _series2.default, + setImmediate: _setImmediate2.default, + some: _some2.default, + someLimit: _someLimit2.default, + someSeries: _someSeries2.default, + sortBy: _sortBy2.default, + timeout: _timeout2.default, + times: _times2.default, + timesLimit: _timesLimit2.default, + timesSeries: _timesSeries2.default, + transform: _transform2.default, + tryEach: _tryEach2.default, + unmemoize: _unmemoize2.default, + until: _until2.default, + waterfall: _waterfall2.default, + whilst: _whilst2.default, + + // aliases + all: _every2.default, + allLimit: _everyLimit2.default, + allSeries: _everySeries2.default, + any: _some2.default, + anyLimit: _someLimit2.default, + anySeries: _someSeries2.default, + find: _detect2.default, + findLimit: _detectLimit2.default, + findSeries: _detectSeries2.default, + flatMap: _concat2.default, + flatMapLimit: _concatLimit2.default, + flatMapSeries: _concatSeries2.default, + forEach: _each2.default, + forEachSeries: _eachSeries2.default, + forEachLimit: _eachLimit2.default, + forEachOf: _eachOf2.default, + forEachOfSeries: _eachOfSeries2.default, + forEachOfLimit: _eachOfLimit2.default, + inject: _reduce2.default, + foldl: _reduce2.default, + foldr: _reduceRight2.default, + select: _filter2.default, + selectLimit: _filterLimit2.default, + selectSeries: _filterSeries2.default, + wrapSync: _asyncify2.default, + during: _whilst2.default, + doDuring: _doWhilst2.default +}; +exports.apply = _apply2.default; +exports.applyEach = _applyEach2.default; +exports.applyEachSeries = _applyEachSeries2.default; +exports.asyncify = _asyncify2.default; +exports.auto = _auto2.default; +exports.autoInject = _autoInject2.default; +exports.cargo = _cargo2.default; +exports.cargoQueue = _cargoQueue2.default; +exports.compose = _compose2.default; +exports.concat = _concat2.default; +exports.concatLimit = _concatLimit2.default; +exports.concatSeries = _concatSeries2.default; +exports.constant = _constant2.default; +exports.detect = _detect2.default; +exports.detectLimit = _detectLimit2.default; +exports.detectSeries = _detectSeries2.default; +exports.dir = _dir2.default; +exports.doUntil = _doUntil2.default; +exports.doWhilst = _doWhilst2.default; +exports.each = _each2.default; +exports.eachLimit = _eachLimit2.default; +exports.eachOf = _eachOf2.default; +exports.eachOfLimit = _eachOfLimit2.default; +exports.eachOfSeries = _eachOfSeries2.default; +exports.eachSeries = _eachSeries2.default; +exports.ensureAsync = _ensureAsync2.default; +exports.every = _every2.default; +exports.everyLimit = _everyLimit2.default; +exports.everySeries = _everySeries2.default; +exports.filter = _filter2.default; +exports.filterLimit = _filterLimit2.default; +exports.filterSeries = _filterSeries2.default; +exports.forever = _forever2.default; +exports.groupBy = _groupBy2.default; +exports.groupByLimit = _groupByLimit2.default; +exports.groupBySeries = _groupBySeries2.default; +exports.log = _log2.default; +exports.map = _map2.default; +exports.mapLimit = _mapLimit2.default; +exports.mapSeries = _mapSeries2.default; +exports.mapValues = _mapValues2.default; +exports.mapValuesLimit = _mapValuesLimit2.default; +exports.mapValuesSeries = _mapValuesSeries2.default; +exports.memoize = _memoize2.default; +exports.nextTick = _nextTick2.default; +exports.parallel = _parallel2.default; +exports.parallelLimit = _parallelLimit2.default; +exports.priorityQueue = _priorityQueue2.default; +exports.queue = _queue2.default; +exports.race = _race2.default; +exports.reduce = _reduce2.default; +exports.reduceRight = _reduceRight2.default; +exports.reflect = _reflect2.default; +exports.reflectAll = _reflectAll2.default; +exports.reject = _reject2.default; +exports.rejectLimit = _rejectLimit2.default; +exports.rejectSeries = _rejectSeries2.default; +exports.retry = _retry2.default; +exports.retryable = _retryable2.default; +exports.seq = _seq2.default; +exports.series = _series2.default; +exports.setImmediate = _setImmediate2.default; +exports.some = _some2.default; +exports.someLimit = _someLimit2.default; +exports.someSeries = _someSeries2.default; +exports.sortBy = _sortBy2.default; +exports.timeout = _timeout2.default; +exports.times = _times2.default; +exports.timesLimit = _timesLimit2.default; +exports.timesSeries = _timesSeries2.default; +exports.transform = _transform2.default; +exports.tryEach = _tryEach2.default; +exports.unmemoize = _unmemoize2.default; +exports.until = _until2.default; +exports.waterfall = _waterfall2.default; +exports.whilst = _whilst2.default; +exports.all = _every2.default; +exports.allLimit = _everyLimit2.default; +exports.allSeries = _everySeries2.default; +exports.any = _some2.default; +exports.anyLimit = _someLimit2.default; +exports.anySeries = _someSeries2.default; +exports.find = _detect2.default; +exports.findLimit = _detectLimit2.default; +exports.findSeries = _detectSeries2.default; +exports.flatMap = _concat2.default; +exports.flatMapLimit = _concatLimit2.default; +exports.flatMapSeries = _concatSeries2.default; +exports.forEach = _each2.default; +exports.forEachSeries = _eachSeries2.default; +exports.forEachLimit = _eachLimit2.default; +exports.forEachOf = _eachOf2.default; +exports.forEachOfSeries = _eachOfSeries2.default; +exports.forEachOfLimit = _eachOfLimit2.default; +exports.inject = _reduce2.default; +exports.foldl = _reduce2.default; +exports.foldr = _reduceRight2.default; +exports.select = _filter2.default; +exports.selectLimit = _filterLimit2.default; +exports.selectSeries = _filterSeries2.default; +exports.wrapSync = _asyncify2.default; +exports.during = _whilst2.default; +exports.doDuring = _doWhilst2.default; \ No newline at end of file diff --git a/node_modules/async/inject.js b/node_modules/async/inject.js new file mode 100644 index 0000000000000000000000000000000000000000..8a69548a6efd9e974b5281f3bda4e29b1b1a48a2 --- /dev/null +++ b/node_modules/async/inject.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/DoublyLinkedList.js b/node_modules/async/internal/DoublyLinkedList.js new file mode 100644 index 0000000000000000000000000000000000000000..419ce44bd15becbdaf45bbcf27f01c95cf32fbea --- /dev/null +++ b/node_modules/async/internal/DoublyLinkedList.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next;else this.head = node.next; + if (node.next) node.next.prev = node.prev;else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty() { + while (this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode;else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode;else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator]() { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove(testFn) { + var curr = this.head; + while (curr) { + var { next } = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } +} + +exports.default = DLL; +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/Heap.js b/node_modules/async/internal/Heap.js new file mode 100644 index 0000000000000000000000000000000000000000..7867c92818719cd70e8c8f08d98cff9464cf70dd --- /dev/null +++ b/node_modules/async/internal/Heap.js @@ -0,0 +1,120 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Binary min-heap implementation used for priority queue. +// Implementation is stable, i.e. push time is considered for equal priorities +class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty() { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l = leftChi(index)) < this.heap.length) { + if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { + l = l + 1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length - 1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length - 1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator]() { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove(testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length - 1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } +} + +exports.default = Heap; +function leftChi(i) { + return (i << 1) + 1; +} + +function parent(i) { + return (i + 1 >> 1) - 1; +} + +function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } else { + return x.pushCount < y.pushCount; + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/applyEach.js b/node_modules/async/internal/applyEach.js new file mode 100644 index 0000000000000000000000000000000000000000..544491267177eb1fa9bccd95c9cb12a724e48ac7 --- /dev/null +++ b/node_modules/async/internal/applyEach.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = (0, _awaitify2.default)(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + (0, _wrapAsync2.default)(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; +}; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/asyncEachOfLimit.js b/node_modules/async/internal/asyncEachOfLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..34dd82bf697b76cfd6f741b8fc8da999a824e4f6 --- /dev/null +++ b/node_modules/async/internal/asyncEachOfLimit.js @@ -0,0 +1,75 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncEachOfLimit; + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// for async generators +function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return; + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({ value, done: iterDone }) => { + //console.log('got value', value) + if (canceled || done) return; + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return; + if (err) return handleError(err); + + if (err === false) { + done = true; + canceled = true; + return; + } + + if (result === _breakLoop2.default || done && running <= 0) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return; + awaiting = false; + done = true; + callback(err); + } + + replenish(); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/awaitify.js b/node_modules/async/internal/awaitify.js new file mode 100644 index 0000000000000000000000000000000000000000..bb7a609adcb1af30cccebbe33b0dec3d74c09423 --- /dev/null +++ b/node_modules/async/internal/awaitify.js @@ -0,0 +1,28 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = awaitify; +// conditionally promisify a function. +// only return a promise if a callback is omitted +function awaitify(asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined'); + function awaitable(...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args); + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err); + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }); + } + + return awaitable; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/breakLoop.js b/node_modules/async/internal/breakLoop.js new file mode 100644 index 0000000000000000000000000000000000000000..87413dd0def73e6a4d46ea528425df5619894721 --- /dev/null +++ b/node_modules/async/internal/breakLoop.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +const breakLoop = {}; +exports.default = breakLoop; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/consoleFunc.js b/node_modules/async/internal/consoleFunc.js new file mode 100644 index 0000000000000000000000000000000000000000..748d54b74ae3cf79b1f05667c7b7b5aa621e6a23 --- /dev/null +++ b/node_modules/async/internal/consoleFunc.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = consoleFunc; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function consoleFunc(name) { + return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { + /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/createTester.js b/node_modules/async/internal/createTester.js new file mode 100644 index 0000000000000000000000000000000000000000..cafdf62ebcffebf2129252ed21f8b2f597bfb867 --- /dev/null +++ b/node_modules/async/internal/createTester.js @@ -0,0 +1,40 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createTester; + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = (0, _wrapAsync2.default)(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, _breakLoop2.default); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/eachOfLimit.js b/node_modules/async/internal/eachOfLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..ceed60f47f4850c37b1df85ca078cdd845e0b3e6 --- /dev/null +++ b/node_modules/async/internal/eachOfLimit.js @@ -0,0 +1,90 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _iterator = require('./iterator.js'); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _onlyOnce = require('./onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./wrapAsync.js'); + +var _asyncEachOfLimit = require('./asyncEachOfLimit.js'); + +var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = limit => { + return (obj, iteratee, callback) => { + callback = (0, _once2.default)(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1'); + } + if (!obj) { + return callback(null); + } + if ((0, _wrapAsync.isAsyncGenerator)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); + } + if ((0, _wrapAsync.isAsyncIterable)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); + } + var nextElem = (0, _iterator2.default)(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return; + running -= 1; + if (err) { + done = true; + callback(err); + } else if (err === false) { + done = true; + canceled = true; + } else if (value === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } else if (!looping) { + replenish(); + } + } + + function replenish() { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/filter.js b/node_modules/async/internal/filter.js new file mode 100644 index 0000000000000000000000000000000000000000..065c211ec996e25bba6b067b42a1b9e08d9c7b19 --- /dev/null +++ b/node_modules/async/internal/filter.js @@ -0,0 +1,55 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _filter; + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({ index, value: x }); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results.sort((a, b) => a.index - b.index).map(v => v.value)); + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/getIterator.js b/node_modules/async/internal/getIterator.js new file mode 100644 index 0000000000000000000000000000000000000000..f518fce8c864e1118d80bdbb49948457f5f15f32 --- /dev/null +++ b/node_modules/async/internal/getIterator.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/initialParams.js b/node_modules/async/internal/initialParams.js new file mode 100644 index 0000000000000000000000000000000000000000..04c0eff797d722460624d1c52dc6c9f755b3cebc --- /dev/null +++ b/node_modules/async/internal/initialParams.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn) { + return function (...args /*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/isArrayLike.js b/node_modules/async/internal/isArrayLike.js new file mode 100644 index 0000000000000000000000000000000000000000..a4c4c8a59546276fbeae14c7fd8f78a000a629b2 --- /dev/null +++ b/node_modules/async/internal/isArrayLike.js @@ -0,0 +1,10 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isArrayLike; +function isArrayLike(value) { + return value && typeof value.length === 'number' && value.length >= 0 && value.length % 1 === 0; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/iterator.js b/node_modules/async/internal/iterator.js new file mode 100644 index 0000000000000000000000000000000000000000..5778b1e830095cd8fb89455bef827e5b84b9c48a --- /dev/null +++ b/node_modules/async/internal/iterator.js @@ -0,0 +1,57 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = createIterator; + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _getIterator = require('./getIterator.js'); + +var _getIterator2 = _interopRequireDefault(_getIterator); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? { value: coll[i], key: i } : null; + }; +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) return null; + i++; + return { value: item.value, key: i }; + }; +} + +function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? { value: obj[key], key } : null; + }; +} + +function createIterator(coll) { + if ((0, _isArrayLike2.default)(coll)) { + return createArrayIterator(coll); + } + + var iterator = (0, _getIterator2.default)(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/map.js b/node_modules/async/internal/map.js new file mode 100644 index 0000000000000000000000000000000000000000..acab1e7251241168cdad181ac4b0571ee0f9c7cf --- /dev/null +++ b/node_modules/async/internal/map.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncMap; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/once.js b/node_modules/async/internal/once.js new file mode 100644 index 0000000000000000000000000000000000000000..a8b5792663459549ac789e316dccb15819f816b5 --- /dev/null +++ b/node_modules/async/internal/once.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = once; +function once(fn) { + function wrapper(...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js new file mode 100644 index 0000000000000000000000000000000000000000..c95a92d408076c4e641baf5f3655b3ccaec3f427 --- /dev/null +++ b/node_modules/async/internal/onlyOnce.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = onlyOnce; +function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/parallel.js b/node_modules/async/internal/parallel.js new file mode 100644 index 0000000000000000000000000000000000000000..57fbd0d01e85e7a985820cc7624ba5c8debd421c --- /dev/null +++ b/node_modules/async/internal/parallel.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { + var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); +}, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/promiseCallback.js b/node_modules/async/internal/promiseCallback.js new file mode 100644 index 0000000000000000000000000000000000000000..17a83016c12b4293bb27ebd20a19540c9567e5e1 --- /dev/null +++ b/node_modules/async/internal/promiseCallback.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +const PROMISE_SYMBOL = Symbol('promiseCallback'); + +function promiseCallback() { + let resolve, reject; + function callback(err, ...args) { + if (err) return reject(err); + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, reject = rej; + }); + + return callback; +} + +exports.promiseCallback = promiseCallback; +exports.PROMISE_SYMBOL = PROMISE_SYMBOL; \ No newline at end of file diff --git a/node_modules/async/internal/queue.js b/node_modules/async/internal/queue.js new file mode 100644 index 0000000000000000000000000000000000000000..7414e03bd600c15b98a77b22fae065dd312839a2 --- /dev/null +++ b/node_modules/async/internal/queue.js @@ -0,0 +1,294 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = queue; + +var _onlyOnce = require('./onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _setImmediate = require('./setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _DoublyLinkedList = require('./DoublyLinkedList.js'); + +var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } else if (concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = (0, _wrapAsync2.default)(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on(event, handler) { + events[event].push(handler); + } + + function once(event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off(event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []); + if (!handler) return events[event] = []; + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger(event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback(err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res(); + if (args.length <= 1) return res(args[0]); + res(args); + } + + var item = q._createTaskItem(data, rejectOnError ? promiseCallback : callback || promiseCallback); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + (0, _setImmediate2.default)(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }); + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= q.concurrency - q.buffer) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + (0, _setImmediate2.default)(() => trigger('drain')); + return true; + } + return false; + } + + const eventMethod = name => handler => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err); + resolve(data); + }); + }); + } + off(name); + on(name, handler); + }; + + var isProcessing = false; + var q = { + _tasks: new _DoublyLinkedList2.default(), + _createTaskItem(data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator]() { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, false, false, callback)); + } + return _insert(data, false, false, callback); + }, + pushAsync(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, false, true, callback)); + } + return _insert(data, false, true, callback); + }, + kill() { + off(); + q._tasks.empty(); + }, + unshift(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, true, false, callback)); + } + return _insert(data, true, false, callback); + }, + unshiftAsync(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, true, true, callback)); + } + return _insert(data, true, true, callback); + }, + remove(testFn) { + q._tasks.remove(testFn); + }, + process() { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while (!q.paused && numRunning < q.concurrency && q._tasks.length) { + var tasks = [], + data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = (0, _onlyOnce2.default)(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length() { + return q._tasks.length; + }, + running() { + return numRunning; + }, + workersList() { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause() { + q.paused = true; + }, + resume() { + if (q.paused === false) { + return; + } + q.paused = false; + (0, _setImmediate2.default)(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + } + }); + return q; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/range.js b/node_modules/async/internal/range.js new file mode 100644 index 0000000000000000000000000000000000000000..cc7b3a9cdc4bd1122248ab0975db41290351fef8 --- /dev/null +++ b/node_modules/async/internal/range.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = range; +function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/reject.js b/node_modules/async/internal/reject.js new file mode 100644 index 0000000000000000000000000000000000000000..9d9bc80bc464048ac39b58afb8c14a692eda89d9 --- /dev/null +++ b/node_modules/async/internal/reject.js @@ -0,0 +1,26 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reject; + +var _filter = require('./filter.js'); + +var _filter2 = _interopRequireDefault(_filter); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function reject(eachfn, arr, _iteratee, callback) { + const iteratee = (0, _wrapAsync2.default)(_iteratee); + return (0, _filter2.default)(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/setImmediate.js b/node_modules/async/internal/setImmediate.js new file mode 100644 index 0000000000000000000000000000000000000000..513efd13c28363194a5aa7e1a8fd9d12a961bcbe --- /dev/null +++ b/node_modules/async/internal/setImmediate.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fallback = fallback; +exports.wrap = wrap; +/* istanbul ignore file */ + +var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; +var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); +} + +var _defer; + +if (hasQueueMicrotask) { + _defer = queueMicrotask; +} else if (hasSetImmediate) { + _defer = setImmediate; +} else if (hasNextTick) { + _defer = process.nextTick; +} else { + _defer = fallback; +} + +exports.default = wrap(_defer); \ No newline at end of file diff --git a/node_modules/async/internal/withoutIndex.js b/node_modules/async/internal/withoutIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..fa91c2d5d2e3e2b124967f0889892849c5367174 --- /dev/null +++ b/node_modules/async/internal/withoutIndex.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _withoutIndex; +function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/wrapAsync.js b/node_modules/async/internal/wrapAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4d619868ab1be3a44f753cd98e87ecb483e9c2 --- /dev/null +++ b/node_modules/async/internal/wrapAsync.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = undefined; + +var _asyncify = require('../asyncify.js'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; +} + +function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; +} + +function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function'); + return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; +} + +exports.default = wrapAsync; +exports.isAsync = isAsync; +exports.isAsyncGenerator = isAsyncGenerator; +exports.isAsyncIterable = isAsyncIterable; \ No newline at end of file diff --git a/node_modules/async/log.js b/node_modules/async/log.js new file mode 100644 index 0000000000000000000000000000000000000000..332b9da79b0847b38eb87b626d38f58bdd943e85 --- /dev/null +++ b/node_modules/async/log.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _consoleFunc = require('./internal/consoleFunc.js'); + +var _consoleFunc2 = _interopRequireDefault(_consoleFunc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +exports.default = (0, _consoleFunc2.default)('log'); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/map.js b/node_modules/async/map.js new file mode 100644 index 0000000000000000000000000000000000000000..c4b7a5ac56169367a10984a0c1efa7be1c07de54 --- /dev/null +++ b/node_modules/async/map.js @@ -0,0 +1,142 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function map(coll, iteratee, callback) { + return (0, _map3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(map, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapLimit.js b/node_modules/async/mapLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..6ad35724e761de8393f7aa14499c6d259da5d86f --- /dev/null +++ b/node_modules/async/mapLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapLimit(coll, limit, iteratee, callback) { + return (0, _map3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(mapLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapSeries.js b/node_modules/async/mapSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..8dfdd8aae4b9f55d42057a1db79a07752e061a27 --- /dev/null +++ b/node_modules/async/mapSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapSeries(coll, iteratee, callback) { + return (0, _map3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(mapSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValues.js b/node_modules/async/mapValues.js new file mode 100644 index 0000000000000000000000000000000000000000..3d0470e3120c116090476f1fb3b89b9ea0750ce9 --- /dev/null +++ b/node_modules/async/mapValues.js @@ -0,0 +1,152 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValues; + +var _mapValuesLimit = require('./mapValuesLimit.js'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function mapValues(obj, iteratee, callback) { + return (0, _mapValuesLimit2.default)(obj, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValuesLimit.js b/node_modules/async/mapValuesLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..f59e36f2f66941604baaff074fd3f04a27b94b7b --- /dev/null +++ b/node_modules/async/mapValuesLimit.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = (0, _once2.default)(callback); + var newObj = {}; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfLimit2.default)(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); +} + +exports.default = (0, _awaitify2.default)(mapValuesLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValuesSeries.js b/node_modules/async/mapValuesSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..5f05bf2182af49b729641767c8782c76e6fbbbb3 --- /dev/null +++ b/node_modules/async/mapValuesSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValuesSeries; + +var _mapValuesLimit = require('./mapValuesLimit.js'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesSeries(obj, iteratee, callback) { + return (0, _mapValuesLimit2.default)(obj, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/memoize.js b/node_modules/async/memoize.js new file mode 100644 index 0000000000000000000000000000000000000000..6535d4e4635cb53b5b9554a6dafc756612d38da3 --- /dev/null +++ b/node_modules/async/memoize.js @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memoize; + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = (0, _wrapAsync2.default)(fn); + var memoized = (0, _initialParams2.default)((args, callback) => { + var key = hasher(...args); + if (key in memo) { + (0, _setImmediate2.default)(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/nextTick.js b/node_modules/async/nextTick.js new file mode 100644 index 0000000000000000000000000000000000000000..8ebfda9e62e5f25499a15d1301e3ab2345fa6d0a --- /dev/null +++ b/node_modules/async/nextTick.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate.js'); + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer; /* istanbul ignore file */ + + +if (_setImmediate.hasNextTick) { + _defer = process.nextTick; +} else if (_setImmediate.hasSetImmediate) { + _defer = setImmediate; +} else { + _defer = _setImmediate.fallback; +} + +exports.default = (0, _setImmediate.wrap)(_defer); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/package.json b/node_modules/async/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bcf4c41b4126cc0f2ccfeeb04be3ee0bc90eae62 --- /dev/null +++ b/node_modules/async/package.json @@ -0,0 +1,75 @@ +{ + "name": "async", + "description": "Higher-order functions and common patterns for asynchronous code", + "version": "3.2.6", + "main": "dist/async.js", + "author": "Caolan McMahon", + "homepage": "https://caolan.github.io/async/", + "repository": { + "type": "git", + "url": "https://github.com/caolan/async.git" + }, + "bugs": { + "url": "https://github.com/caolan/async/issues" + }, + "keywords": [ + "async", + "callback", + "module", + "utility" + ], + "devDependencies": { + "@babel/eslint-parser": "^7.16.5", + "@babel/core": "7.25.2", + "babel-minify": "^0.5.0", + "babel-plugin-add-module-exports": "^1.0.4", + "babel-plugin-istanbul": "^7.0.0", + "babel-plugin-syntax-async-generators": "^6.13.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "babel-preset-es2015": "^6.3.13", + "babel-preset-es2017": "^6.22.0", + "babel-register": "^6.26.0", + "babelify": "^10.0.0", + "benchmark": "^2.1.1", + "bluebird": "^3.4.6", + "browserify": "^17.0.0", + "chai": "^4.2.0", + "cheerio": "^0.22.0", + "es6-promise": "^4.2.8", + "eslint": "^8.6.0", + "eslint-plugin-prefer-arrow": "^1.2.3", + "fs-extra": "^11.1.1", + "jsdoc": "^4.0.3", + "karma": "^6.3.12", + "karma-browserify": "^8.1.0", + "karma-firefox-launcher": "^2.1.2", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.0", + "karma-safari-launcher": "^1.0.0", + "mocha": "^6.1.4", + "native-promise-only": "^0.8.0-a", + "nyc": "^17.0.0", + "rollup": "^4.2.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-npm": "^2.0.0", + "rsvp": "^4.8.5", + "semver": "^7.3.5", + "yargs": "^17.3.1" + }, + "scripts": { + "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert", + "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js", + "lint": "eslint --fix .", + "mocha-browser-test": "karma start", + "mocha-node-test": "mocha", + "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", + "test": "npm run lint && npm run mocha-node-test" + }, + "license": "MIT", + "nyc": { + "exclude": [ + "test" + ] + }, + "module": "dist/async.mjs" +} \ No newline at end of file diff --git a/node_modules/async/parallel.js b/node_modules/async/parallel.js new file mode 100644 index 0000000000000000000000000000000000000000..2c7976feda3bdb030caa096e148a10e4efc91515 --- /dev/null +++ b/node_modules/async/parallel.js @@ -0,0 +1,180 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallel; + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _parallel2 = require('./internal/parallel.js'); + +var _parallel3 = _interopRequireDefault(_parallel2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function parallel(tasks, callback) { + return (0, _parallel3.default)(_eachOf2.default, tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/parallelLimit.js b/node_modules/async/parallelLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..43379572d97931836fd1523c6da42db02660bfce --- /dev/null +++ b/node_modules/async/parallelLimit.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallelLimit; + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _parallel = require('./internal/parallel.js'); + +var _parallel2 = _interopRequireDefault(_parallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ +function parallelLimit(tasks, limit, callback) { + return (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/priorityQueue.js b/node_modules/async/priorityQueue.js new file mode 100644 index 0000000000000000000000000000000000000000..16c4daa0b790cbcb18c6a9480300ef27c34079f6 --- /dev/null +++ b/node_modules/async/priorityQueue.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + // Start with a normal queue + var q = (0, _queue2.default)(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new _Heap2.default(); + q._createTaskItem = ({ data, priority }, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return { data: tasks, priority }; + } + return tasks.map(data => { + return { data, priority }; + }); + } + + // Override push to accept second parameter representing priority + q.push = function (data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function (data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; +}; + +var _queue = require('./queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +var _Heap = require('./internal/Heap.js'); + +var _Heap2 = _interopRequireDefault(_Heap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/queue.js b/node_modules/async/queue.js new file mode 100644 index 0000000000000000000000000000000000000000..c01340dc2d5addb664b4a9669515342371e158c6 --- /dev/null +++ b/node_modules/async/queue.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + var _worker = (0, _wrapAsync2.default)(worker); + return (0, _queue2.default)((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); +}; + +var _queue = require('./internal/queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/race.js b/node_modules/async/race.js new file mode 100644 index 0000000000000000000000000000000000000000..aa167be3f3481ddcf6cc68ed7f7e2aeea69a544d --- /dev/null +++ b/node_modules/async/race.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = (0, _once2.default)(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + (0, _wrapAsync2.default)(tasks[i])(callback); + } +} + +exports.default = (0, _awaitify2.default)(race, 2); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reduce.js b/node_modules/async/reduce.js new file mode 100644 index 0000000000000000000000000000000000000000..8a69548a6efd9e974b5281f3bda4e29b1b1a48a2 --- /dev/null +++ b/node_modules/async/reduce.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reduceRight.js b/node_modules/async/reduceRight.js new file mode 100644 index 0000000000000000000000000000000000000000..5be1b68dca537ea15872ba4b2710ad8c36b47a72 --- /dev/null +++ b/node_modules/async/reduceRight.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reflect.js b/node_modules/async/reflect.js new file mode 100644 index 0000000000000000000000000000000000000000..39544956bed6c12b7b6f2e2d70512c975d071905 --- /dev/null +++ b/node_modules/async/reflect.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflect; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = (0, _wrapAsync2.default)(fn); + return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0) { + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reflectAll.js b/node_modules/async/reflectAll.js new file mode 100644 index 0000000000000000000000000000000000000000..b78d598bf5715af8872371a55f0f356e02e15393 --- /dev/null +++ b/node_modules/async/reflectAll.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflectAll; + +var _reflect = require('./reflect.js'); + +var _reflect2 = _interopRequireDefault(_reflect); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(_reflect2.default); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = _reflect2.default.call(this, tasks[key]); + }); + } + return results; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reject.js b/node_modules/async/reject.js new file mode 100644 index 0000000000000000000000000000000000000000..895949bd899bcf749545cc62dc1ae42d3926634f --- /dev/null +++ b/node_modules/async/reject.js @@ -0,0 +1,87 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function reject(coll, iteratee, callback) { + return (0, _reject3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(reject, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/rejectLimit.js b/node_modules/async/rejectLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..ce10edf57e9139c8f9800e5d9bb675b0d5f6c3d7 --- /dev/null +++ b/node_modules/async/rejectLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectLimit(coll, limit, iteratee, callback) { + return (0, _reject3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(rejectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/rejectSeries.js b/node_modules/async/rejectSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..c08e413f97462cc6240f9026561d132e910c8e9c --- /dev/null +++ b/node_modules/async/rejectSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectSeries(coll, iteratee, callback) { + return (0, _reject3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(rejectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/retry.js b/node_modules/async/retry.js new file mode 100644 index 0000000000000000000000000000000000000000..a4b02356f3693fa9f71063b181d3b2f88ea23978 --- /dev/null +++ b/node_modules/async/retry.js @@ -0,0 +1,159 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = retry; + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function constant(value) { + return function () { + return value; + }; +} + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +const DEFAULT_TIMES = 5; +const DEFAULT_INTERVAL = 0; + +function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || (0, _promiseCallback.promiseCallback)(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || (0, _promiseCallback.promiseCallback)(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = (0, _wrapAsync2.default)(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return; + if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[_promiseCallback.PROMISE_SYMBOL]; +} + +function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/retryable.js b/node_modules/async/retryable.js new file mode 100644 index 0000000000000000000000000000000000000000..68256c3162dc85500c8605fde839ff866c237bc4 --- /dev/null +++ b/node_modules/async/retryable.js @@ -0,0 +1,77 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = retryable; + +var _retry = require('./retry.js'); + +var _retry2 = _interopRequireDefault(_retry); + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ +function retryable(opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = opts && opts.arity || task.length; + if ((0, _wrapAsync.isAsync)(task)) { + arity += 1; + } + var _task = (0, _wrapAsync2.default)(task); + return (0, _initialParams2.default)((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = (0, _promiseCallback.promiseCallback)(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback); + + return callback[_promiseCallback.PROMISE_SYMBOL]; + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/select.js b/node_modules/async/select.js new file mode 100644 index 0000000000000000000000000000000000000000..2c9a63de5b447820152e40c6be73bd97a0e56964 --- /dev/null +++ b/node_modules/async/select.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filter, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/selectLimit.js b/node_modules/async/selectLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..d3b3f50c61df2797efade248307ee679548fcf3e --- /dev/null +++ b/node_modules/async/selectLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit(coll, limit, iteratee, callback) { + return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/selectSeries.js b/node_modules/async/selectSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..019a2d0a9d50a34760b3d5a5d6f366509e4e381e --- /dev/null +++ b/node_modules/async/selectSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/seq.js b/node_modules/async/seq.js new file mode 100644 index 0000000000000000000000000000000000000000..e7881cd011b2404619230d39eb2ae7522f7159e0 --- /dev/null +++ b/node_modules/async/seq.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = seq; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ +function seq(...functions) { + var _functions = functions.map(_wrapAsync2.default); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = (0, _promiseCallback.promiseCallback)(); + } + + (0, _reduce2.default)(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, (err, results) => cb(err, ...results)); + + return cb[_promiseCallback.PROMISE_SYMBOL]; + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/series.js b/node_modules/async/series.js new file mode 100644 index 0000000000000000000000000000000000000000..60c17ed655d31b9752a22a217892270640d68c89 --- /dev/null +++ b/node_modules/async/series.js @@ -0,0 +1,186 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = series; + +var _parallel2 = require('./internal/parallel.js'); + +var _parallel3 = _interopRequireDefault(_parallel2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function series(tasks, callback) { + return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/setImmediate.js b/node_modules/async/setImmediate.js new file mode 100644 index 0000000000000000000000000000000000000000..eea86771731514f526313858e88973e50ba5e157 --- /dev/null +++ b/node_modules/async/setImmediate.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `setImmediate`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name setImmediate + * @static + * @memberOf module:Utils + * @method + * @see [async.nextTick]{@link module:Utils.nextTick} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +exports.default = _setImmediate2.default; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/some.js b/node_modules/async/some.js new file mode 100644 index 0000000000000000000000000000000000000000..a5bd328abe14685f2a467aa57e630be88158476f --- /dev/null +++ b/node_modules/async/some.js @@ -0,0 +1,122 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(some, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/someLimit.js b/node_modules/async/someLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..3a8096fdaac1b272d6a66ab985ff22dec372dd73 --- /dev/null +++ b/node_modules/async/someLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/someSeries.js b/node_modules/async/someSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..51aad19bdc2a5fc65cced4db170d273d94ba5790 --- /dev/null +++ b/node_modules/async/someSeries.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/sortBy.js b/node_modules/async/sortBy.js new file mode 100644 index 0000000000000000000000000000000000000000..0988b612013a6395ea666ea80abcc92d7cd68147 --- /dev/null +++ b/node_modules/async/sortBy.js @@ -0,0 +1,190 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map = require('./map.js'); + +var _map2 = _interopRequireDefault(_map); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function sortBy(coll, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _map2.default)(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, { value: x, criteria }); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, + b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} +exports.default = (0, _awaitify2.default)(sortBy, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timeout.js b/node_modules/async/timeout.js new file mode 100644 index 0000000000000000000000000000000000000000..46bb233af39052501adc7110c5fb1dad7fa1184d --- /dev/null +++ b/node_modules/async/timeout.js @@ -0,0 +1,89 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timeout; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = (0, _wrapAsync2.default)(asyncFn); + + return (0, _initialParams2.default)((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/times.js b/node_modules/async/times.js new file mode 100644 index 0000000000000000000000000000000000000000..ca7df517be584d880d1bf1c25e6138aad2ec4ae6 --- /dev/null +++ b/node_modules/async/times.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = times; + +var _timesLimit = require('./timesLimit.js'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +function times(n, iteratee, callback) { + return (0, _timesLimit2.default)(n, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js new file mode 100644 index 0000000000000000000000000000000000000000..f76de250c85b9aca462fcc55eaefa665eb8b58bc --- /dev/null +++ b/node_modules/async/timesLimit.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timesLimit; + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _range = require('./internal/range.js'); + +var _range2 = _interopRequireDefault(_range); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesLimit(count, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)((0, _range2.default)(count), limit, _iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timesSeries.js b/node_modules/async/timesSeries.js new file mode 100644 index 0000000000000000000000000000000000000000..776b4f3afecd27ab755f223f4e0e7376e9400262 --- /dev/null +++ b/node_modules/async/timesSeries.js @@ -0,0 +1,32 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timesSeries; + +var _timesLimit = require('./timesLimit.js'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesSeries(n, iteratee, callback) { + return (0, _timesLimit2.default)(n, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/transform.js b/node_modules/async/transform.js new file mode 100644 index 0000000000000000000000000000000000000000..75dadea87ebe66ffa5832e466790cd74ec1e87ea --- /dev/null +++ b/node_modules/async/transform.js @@ -0,0 +1,173 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = transform; + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function transform(coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + (0, _eachOf2.default)(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[_promiseCallback.PROMISE_SYMBOL]; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/tryEach.js b/node_modules/async/tryEach.js new file mode 100644 index 0000000000000000000000000000000000000000..7e63f9d5a471c2ec34d22a41c40584656b8de196 --- /dev/null +++ b/node_modules/async/tryEach.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachSeries = require('./eachSeries.js'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + return (0, _eachSeries2.default)(tasks, (task, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); +} + +exports.default = (0, _awaitify2.default)(tryEach); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/unmemoize.js b/node_modules/async/unmemoize.js new file mode 100644 index 0000000000000000000000000000000000000000..badd7aecde70de2f9fd04170530ec643c00d9fd8 --- /dev/null +++ b/node_modules/async/unmemoize.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = unmemoize; +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/until.js b/node_modules/async/until.js new file mode 100644 index 0000000000000000000000000000000000000000..4b69b9723aaa4638bcfa8079cb7a54e8e9ce16f6 --- /dev/null +++ b/node_modules/async/until.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = until; + +var _whilst = require('./whilst.js'); + +var _whilst2 = _interopRequireDefault(_whilst); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ +function until(test, iteratee, callback) { + const _test = (0, _wrapAsync2.default)(test); + return (0, _whilst2.default)(cb => _test((err, truth) => cb(err, !truth)), iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/waterfall.js b/node_modules/async/waterfall.js new file mode 100644 index 0000000000000000000000000000000000000000..c3242f7975c1b2c93d7dd4cacbd9075863c87480 --- /dev/null +++ b/node_modules/async/waterfall.js @@ -0,0 +1,105 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ +function waterfall(tasks, callback) { + callback = (0, _once2.default)(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = (0, _wrapAsync2.default)(tasks[taskIndex++]); + task(...args, (0, _onlyOnce2.default)(next)); + } + + function next(err, ...args) { + if (err === false) return; + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); +} + +exports.default = (0, _awaitify2.default)(waterfall); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/whilst.js b/node_modules/async/whilst.js new file mode 100644 index 0000000000000000000000000000000000000000..4165543f818028d988dc57f051ab2a476f42abf9 --- /dev/null +++ b/node_modules/async/whilst.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +exports.default = (0, _awaitify2.default)(whilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/wrapSync.js b/node_modules/async/wrapSync.js new file mode 100644 index 0000000000000000000000000000000000000000..ddc3f02ff2c1367d97e8a8a5e0a1cff2d19cac20 --- /dev/null +++ b/node_modules/async/wrapSync.js @@ -0,0 +1,118 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function (...args /*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback); + }; + } + + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback); + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate2.default)(e => { + throw e; + }, err); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/asynckit/LICENSE b/node_modules/asynckit/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c9eca5dd999d7cead12f32f6089b577e8e78c23e --- /dev/null +++ b/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/asynckit/README.md b/node_modules/asynckit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ddcc7e6b95ca9aab30e8ef697e8941869adad32a --- /dev/null +++ b/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/node_modules/asynckit/bench.js b/node_modules/asynckit/bench.js new file mode 100644 index 0000000000000000000000000000000000000000..c612f1a55fda02075d146f05a14343a0c73e6fb6 --- /dev/null +++ b/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/node_modules/asynckit/index.js b/node_modules/asynckit/index.js new file mode 100644 index 0000000000000000000000000000000000000000..455f9454ee6483f450a3c7b2e4570a10d6e78d39 --- /dev/null +++ b/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/node_modules/asynckit/lib/abort.js b/node_modules/asynckit/lib/abort.js new file mode 100644 index 0000000000000000000000000000000000000000..114367e5fbf144ad085f0fbe8081ad8adb101dcb --- /dev/null +++ b/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/node_modules/asynckit/lib/async.js b/node_modules/asynckit/lib/async.js new file mode 100644 index 0000000000000000000000000000000000000000..7f1288a4ce9ae031b0778d38afe16dc477c59ab1 --- /dev/null +++ b/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/node_modules/asynckit/lib/defer.js b/node_modules/asynckit/lib/defer.js new file mode 100644 index 0000000000000000000000000000000000000000..b67110c7ad6e5501a355b3c96f410b4216f0fda0 --- /dev/null +++ b/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/asynckit/lib/iterate.js b/node_modules/asynckit/lib/iterate.js new file mode 100644 index 0000000000000000000000000000000000000000..5d2839a590b2bac46489909265bc3010fdc62b28 --- /dev/null +++ b/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 0000000000000000000000000000000000000000..78ad240f0afd80d9a632fc108ac482f7143615d2 --- /dev/null +++ b/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/node_modules/asynckit/lib/readable_parallel.js b/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 0000000000000000000000000000000000000000..5d2929f7a67750caca25e51ed80ced22c3f43e64 --- /dev/null +++ b/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial.js b/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 0000000000000000000000000000000000000000..78226982041ce40c7ed2906b34d3cd13b880767a --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 0000000000000000000000000000000000000000..3de89c47291b403fa38a8340c11d4db0eb99c751 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/node_modules/asynckit/lib/state.js b/node_modules/asynckit/lib/state.js new file mode 100644 index 0000000000000000000000000000000000000000..cbea7ad8f6bc63f0b9c5710b942852f9041edf73 --- /dev/null +++ b/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/node_modules/asynckit/lib/streamify.js b/node_modules/asynckit/lib/streamify.js new file mode 100644 index 0000000000000000000000000000000000000000..f56a1c92bf5c21380396826493eff1be86f19027 --- /dev/null +++ b/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/node_modules/asynckit/lib/terminator.js b/node_modules/asynckit/lib/terminator.js new file mode 100644 index 0000000000000000000000000000000000000000..d6eb99219f3d9d9d44a688312c204059aaf312f0 --- /dev/null +++ b/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..51147d6569aa0f44c087b01b93ff2db52bd1b2b7 --- /dev/null +++ b/node_modules/asynckit/package.json @@ -0,0 +1,63 @@ +{ + "name": "asynckit", + "version": "0.4.0", + "description": "Minimal async jobs utility library, with streams support", + "main": "index.js", + "scripts": { + "clean": "rimraf coverage", + "lint": "eslint *.js lib/*.js test/*.js", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js", + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "debug": "tape test/test-*.js" + }, + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "author": "Alex Indigo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "dependencies": {} +} diff --git a/node_modules/asynckit/parallel.js b/node_modules/asynckit/parallel.js new file mode 100644 index 0000000000000000000000000000000000000000..3c50344d8515f80a01d21bf7bc61cadf363e24cd --- /dev/null +++ b/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/node_modules/asynckit/serial.js b/node_modules/asynckit/serial.js new file mode 100644 index 0000000000000000000000000000000000000000..6cd949a6777137da8128895053b743915ac7d067 --- /dev/null +++ b/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/node_modules/asynckit/serialOrdered.js b/node_modules/asynckit/serialOrdered.js new file mode 100644 index 0000000000000000000000000000000000000000..607eafea56cb060292269b11c9809777c11abf62 --- /dev/null +++ b/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/node_modules/asynckit/stream.js b/node_modules/asynckit/stream.js new file mode 100644 index 0000000000000000000000000000000000000000..d43465f903ed6354a2ceae4a182768838955b528 --- /dev/null +++ b/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/node_modules/at-least-node/LICENSE b/node_modules/at-least-node/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..5e29ccc5eeed179b7044312da4cc29962aee4475 --- /dev/null +++ b/node_modules/at-least-node/LICENSE @@ -0,0 +1,6 @@ +The ISC License +Copyright (c) 2020 Ryan Zimmerman + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/at-least-node/README.md b/node_modules/at-least-node/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fd6e51468235ef9cf08fddf9ac85dde923b9538a --- /dev/null +++ b/node_modules/at-least-node/README.md @@ -0,0 +1,25 @@ +# at-least-node + +![npm](https://img.shields.io/npm/v/at-least-node) +![node](https://img.shields.io/node/v/at-least-node) +![NPM](https://img.shields.io/npm/l/at-least-node) + +Sometimes you need to check if you're on _at least_ a given Node.js version, but you don't want to pull in the whole [`semver`](https://www.npmjs.com/package/semver) kitchen sink. That's what `at-least-node` is for. + +| Package | Size | +| --------------- | ------- | +| `at-least-node` | 2.6 kB | +| `semver` | 75.5 kB | + +```js +const atLeastNode = require('at-least-node') +atLeastNode('10.12.0') +// -> true on Node 10.12.0+, false on anything below that +``` + +When passing in a version string: + +- You cannot include a leading `v` (i.e. `v10.12.0`) +- You cannot omit sections (i.e. `10.12`) +- You cannot use pre-releases (i.e. `1.0.0-beta`) +- There is no input validation, if you make a mistake, the resulting behavior is undefined diff --git a/node_modules/at-least-node/index.js b/node_modules/at-least-node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..974a2fa8542aeb4b27c49fe8767a39457f5c0c52 --- /dev/null +++ b/node_modules/at-least-node/index.js @@ -0,0 +1,5 @@ +module.exports = r => { + const n = process.versions.node.split('.').map(x => parseInt(x, 10)) + r = r.split('.').map(x => parseInt(x, 10)) + return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2]))) +} diff --git a/node_modules/at-least-node/package.json b/node_modules/at-least-node/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2c13641f9c26f0c01121587950468470082b83a4 --- /dev/null +++ b/node_modules/at-least-node/package.json @@ -0,0 +1,32 @@ +{ + "name": "at-least-node", + "version": "1.0.0", + "description": "Lightweight Node.js version sniffing/comparison", + "keywords": [ + "semver", + "feature" + ], + "homepage": "https://github.com/RyanZim/at-least-node#readme", + "bugs": { + "url": "https://github.com/RyanZim/at-least-node/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/RyanZim/at-least-node.git" + }, + "license": "ISC", + "author": "Ryan Zimmerman ", + "main": "index.js", + "files": [], + "scripts": { + "test": "ava" + }, + "devDependencies": { + "ava": "^3.1.0", + "rewire": "^4.0.1", + "semver": "^7.1.2" + }, + "engines": { + "node": ">= 4.0.0" + } +} diff --git a/node_modules/autoprefixer/LICENSE b/node_modules/autoprefixer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c2314d53d097cd36006110afd82fe3d09701a7c5 --- /dev/null +++ b/node_modules/autoprefixer/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/autoprefixer/README.md b/node_modules/autoprefixer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9aad447ba8bfd37425972d2c5cf5c0e146e2310a --- /dev/null +++ b/node_modules/autoprefixer/README.md @@ -0,0 +1,56 @@ +# Autoprefixer + + + +[PostCSS] plugin to parse CSS and add vendor prefixes to CSS rules using values +from [Can I Use]. It is recommended by Google and used in Twitter and Alibaba. + +Write your CSS rules without vendor prefixes (in fact, forget about them +entirely): + +```css +::placeholder { + color: gray; +} + +.image { + width: stretch; +} +``` + +Autoprefixer will use the data based on current browser popularity and property +support to apply prefixes for you. You can try the [interactive demo] +of Autoprefixer. + +```css +::-moz-placeholder { + color: gray; +} +::placeholder { + color: gray; +} + +.image { + width: -moz-available; + width: -webkit-fill-available; + width: stretch; +} +``` + +Twitter account for news and releases: [@autoprefixer]. + +--- + +  Autoprefixer is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups. + +--- + +[interactive demo]: https://autoprefixer.github.io/ +[@autoprefixer]: https://twitter.com/autoprefixer +[Can I Use]: https://caniuse.com/ +[PostCSS]: https://github.com/postcss/postcss + +## Docs +Read full docs **[here](https://github.com/postcss/autoprefixer#readme)**. diff --git a/node_modules/autoprefixer/bin/autoprefixer b/node_modules/autoprefixer/bin/autoprefixer new file mode 100644 index 0000000000000000000000000000000000000000..785830eafe4a0f89e1eafc15dc5899a165056886 --- /dev/null +++ b/node_modules/autoprefixer/bin/autoprefixer @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +let mode = process.argv[2] +if (mode === '--info') { + process.stdout.write(require('../')().info() + '\n') +} else if (mode === '--version') { + process.stdout.write( + 'autoprefixer ' + require('../package.json').version + '\n' + ) +} else { + process.stdout.write( + 'autoprefix\n' + + '\n' + + 'Options:\n' + + ' --info Show target browsers and used prefixes\n' + + ' --version Show version number\n' + + ' --help Show help\n' + + '\n' + + 'Usage:\n' + + ' autoprefixer --info\n' + ) +} diff --git a/node_modules/autoprefixer/data/prefixes.js b/node_modules/autoprefixer/data/prefixes.js new file mode 100644 index 0000000000000000000000000000000000000000..073a78c932a244c4028f4151f1d48068cf8a38d7 --- /dev/null +++ b/node_modules/autoprefixer/data/prefixes.js @@ -0,0 +1,1141 @@ +let unpack = require('caniuse-lite/dist/unpacker/feature') + +function browsersSort(a, b) { + a = a.split(' ') + b = b.split(' ') + if (a[0] > b[0]) { + return 1 + } else if (a[0] < b[0]) { + return -1 + } else { + return Math.sign(parseFloat(a[1]) - parseFloat(b[1])) + } +} + +// Convert Can I Use data +function f(data, opts, callback) { + data = unpack(data) + + if (!callback) { + ;[callback, opts] = [opts, {}] + } + + let match = opts.match || /\sx($|\s)/ + let need = [] + + for (let browser in data.stats) { + let versions = data.stats[browser] + for (let version in versions) { + let support = versions[version] + if (support.match(match)) { + need.push(browser + ' ' + version) + } + } + } + + callback(need.sort(browsersSort)) +} + +// Add data for all properties +let result = {} + +function prefix(names, data) { + for (let name of names) { + result[name] = Object.assign({}, data) + } +} + +function add(names, data) { + for (let name of names) { + result[name].browsers = result[name].browsers + .concat(data.browsers) + .sort(browsersSort) + } +} + +module.exports = result + +// Border Radius +let prefixBorderRadius = require('caniuse-lite/data/features/border-radius') + +f(prefixBorderRadius, browsers => + prefix( + [ + 'border-radius', + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius' + ], + { + browsers, + feature: 'border-radius', + mistakes: ['-khtml-', '-ms-', '-o-'] + } + ) +) + +// Box Shadow +let prefixBoxshadow = require('caniuse-lite/data/features/css-boxshadow') + +f(prefixBoxshadow, browsers => + prefix(['box-shadow'], { + browsers, + feature: 'css-boxshadow', + mistakes: ['-khtml-'] + }) +) + +// Animation +let prefixAnimation = require('caniuse-lite/data/features/css-animation') + +f(prefixAnimation, browsers => + prefix( + [ + 'animation', + 'animation-name', + 'animation-duration', + 'animation-delay', + 'animation-direction', + 'animation-fill-mode', + 'animation-iteration-count', + 'animation-play-state', + 'animation-timing-function', + '@keyframes' + ], + { + browsers, + feature: 'css-animation', + mistakes: ['-khtml-', '-ms-'] + } + ) +) + +// Transition +let prefixTransition = require('caniuse-lite/data/features/css-transitions') + +f(prefixTransition, browsers => + prefix( + [ + 'transition', + 'transition-property', + 'transition-duration', + 'transition-delay', + 'transition-timing-function' + ], + { + browsers, + feature: 'css-transitions', + mistakes: ['-khtml-', '-ms-'] + } + ) +) + +// Transform 2D +let prefixTransform2d = require('caniuse-lite/data/features/transforms2d') + +f(prefixTransform2d, browsers => + prefix(['transform', 'transform-origin'], { + browsers, + feature: 'transforms2d' + }) +) + +// Transform 3D +let prefixTransforms3d = require('caniuse-lite/data/features/transforms3d') + +f(prefixTransforms3d, browsers => { + prefix(['perspective', 'perspective-origin'], { + browsers, + feature: 'transforms3d' + }) + return prefix(['transform-style'], { + browsers, + feature: 'transforms3d', + mistakes: ['-ms-', '-o-'] + }) +}) + +f(prefixTransforms3d, { match: /y\sx|y\s#2/ }, browsers => + prefix(['backface-visibility'], { + browsers, + feature: 'transforms3d', + mistakes: ['-ms-', '-o-'] + }) +) + +// Gradients +let prefixGradients = require('caniuse-lite/data/features/css-gradients') + +f(prefixGradients, { match: /y\sx/ }, browsers => + prefix( + [ + 'linear-gradient', + 'repeating-linear-gradient', + 'radial-gradient', + 'repeating-radial-gradient' + ], + { + browsers, + feature: 'css-gradients', + mistakes: ['-ms-'], + props: [ + 'background', + 'background-image', + 'border-image', + 'mask', + 'list-style', + 'list-style-image', + 'content', + 'mask-image' + ] + } + ) +) + +f(prefixGradients, { match: /a\sx/ }, browsers => { + browsers = browsers.map(i => { + if (/firefox|op/.test(i)) { + return i + } else { + return `${i} old` + } + }) + return add( + [ + 'linear-gradient', + 'repeating-linear-gradient', + 'radial-gradient', + 'repeating-radial-gradient' + ], + { + browsers, + feature: 'css-gradients' + } + ) +}) + +// Box sizing +let prefixBoxsizing = require('caniuse-lite/data/features/css3-boxsizing') + +f(prefixBoxsizing, browsers => + prefix(['box-sizing'], { + browsers, + feature: 'css3-boxsizing' + }) +) + +// Filter Effects +let prefixFilters = require('caniuse-lite/data/features/css-filters') + +f(prefixFilters, browsers => + prefix(['filter'], { + browsers, + feature: 'css-filters' + }) +) + +// filter() function +let prefixFilterFunction = require('caniuse-lite/data/features/css-filter-function') + +f(prefixFilterFunction, browsers => + prefix(['filter-function'], { + browsers, + feature: 'css-filter-function', + props: [ + 'background', + 'background-image', + 'border-image', + 'mask', + 'list-style', + 'list-style-image', + 'content', + 'mask-image' + ] + }) +) + +// Backdrop-filter +let prefixBackdropFilter = require('caniuse-lite/data/features/css-backdrop-filter') + +f(prefixBackdropFilter, { match: /y\sx|y\s#2/ }, browsers => + prefix(['backdrop-filter'], { + browsers, + feature: 'css-backdrop-filter' + }) +) + +// element() function +let prefixElementFunction = require('caniuse-lite/data/features/css-element-function') + +f(prefixElementFunction, browsers => + prefix(['element'], { + browsers, + feature: 'css-element-function', + props: [ + 'background', + 'background-image', + 'border-image', + 'mask', + 'list-style', + 'list-style-image', + 'content', + 'mask-image' + ] + }) +) + +// Multicolumns +let prefixMulticolumns = require('caniuse-lite/data/features/multicolumn') + +f(prefixMulticolumns, browsers => { + prefix( + [ + 'columns', + 'column-width', + 'column-gap', + 'column-rule', + 'column-rule-color', + 'column-rule-width', + 'column-count', + 'column-rule-style', + 'column-span', + 'column-fill' + ], + { + browsers, + feature: 'multicolumn' + } + ) + + let noff = browsers.filter(i => !/firefox/.test(i)) + prefix(['break-before', 'break-after', 'break-inside'], { + browsers: noff, + feature: 'multicolumn' + }) +}) + +// User select +let prefixUserSelect = require('caniuse-lite/data/features/user-select-none') + +f(prefixUserSelect, browsers => + prefix(['user-select'], { + browsers, + feature: 'user-select-none', + mistakes: ['-khtml-'] + }) +) + +// Flexible Box Layout +let prefixFlexbox = require('caniuse-lite/data/features/flexbox') + +f(prefixFlexbox, { match: /a\sx/ }, browsers => { + browsers = browsers.map(i => { + if (/ie|firefox/.test(i)) { + return i + } else { + return `${i} 2009` + } + }) + prefix(['display-flex', 'inline-flex'], { + browsers, + feature: 'flexbox', + props: ['display'] + }) + prefix(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { + browsers, + feature: 'flexbox' + }) + prefix( + [ + 'flex-direction', + 'flex-wrap', + 'flex-flow', + 'justify-content', + 'order', + 'align-items', + 'align-self', + 'align-content' + ], + { + browsers, + feature: 'flexbox' + } + ) +}) + +f(prefixFlexbox, { match: /y\sx/ }, browsers => { + add(['display-flex', 'inline-flex'], { + browsers, + feature: 'flexbox' + }) + add(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { + browsers, + feature: 'flexbox' + }) + add( + [ + 'flex-direction', + 'flex-wrap', + 'flex-flow', + 'justify-content', + 'order', + 'align-items', + 'align-self', + 'align-content' + ], + { + browsers, + feature: 'flexbox' + } + ) +}) + +// calc() unit +let prefixCalc = require('caniuse-lite/data/features/calc') + +f(prefixCalc, browsers => + prefix(['calc'], { + browsers, + feature: 'calc', + props: ['*'] + }) +) + +// Background options +let prefixBackgroundOptions = require('caniuse-lite/data/features/background-img-opts') + +f(prefixBackgroundOptions, browsers => + prefix(['background-origin', 'background-size'], { + browsers, + feature: 'background-img-opts' + }) +) + +// background-clip: text +let prefixBackgroundClipText = require('caniuse-lite/data/features/background-clip-text') + +f(prefixBackgroundClipText, browsers => + prefix(['background-clip'], { + browsers, + feature: 'background-clip-text' + }) +) + +// Font feature settings +let prefixFontFeature = require('caniuse-lite/data/features/font-feature') + +f(prefixFontFeature, browsers => + prefix( + [ + 'font-feature-settings', + 'font-variant-ligatures', + 'font-language-override' + ], + { + browsers, + feature: 'font-feature' + } + ) +) + +// CSS font-kerning property +let prefixFontKerning = require('caniuse-lite/data/features/font-kerning') + +f(prefixFontKerning, browsers => + prefix(['font-kerning'], { + browsers, + feature: 'font-kerning' + }) +) + +// Border image +let prefixBorderImage = require('caniuse-lite/data/features/border-image') + +f(prefixBorderImage, browsers => + prefix(['border-image'], { + browsers, + feature: 'border-image' + }) +) + +// Selection selector +let prefixSelection = require('caniuse-lite/data/features/css-selection') + +f(prefixSelection, browsers => + prefix(['::selection'], { + browsers, + feature: 'css-selection', + selector: true + }) +) + +// Placeholder selector +let prefixPlaceholder = require('caniuse-lite/data/features/css-placeholder') + +f(prefixPlaceholder, browsers => { + prefix(['::placeholder'], { + browsers: browsers.concat(['ie 10 old', 'ie 11 old', 'firefox 18 old']), + feature: 'css-placeholder', + selector: true + }) +}) + +// Placeholder-shown selector +let prefixPlaceholderShown = require('caniuse-lite/data/features/css-placeholder-shown') + +f(prefixPlaceholderShown, browsers => { + prefix([':placeholder-shown'], { + browsers, + feature: 'css-placeholder-shown', + selector: true + }) +}) + +// Hyphenation +let prefixHyphens = require('caniuse-lite/data/features/css-hyphens') + +f(prefixHyphens, browsers => + prefix(['hyphens'], { + browsers, + feature: 'css-hyphens' + }) +) + +// Fullscreen selector +let prefixFullscreen = require('caniuse-lite/data/features/fullscreen') + +f(prefixFullscreen, browsers => + prefix([':fullscreen'], { + browsers, + feature: 'fullscreen', + selector: true + }) +) + +// ::backdrop pseudo-element +// https://caniuse.com/mdn-css_selectors_backdrop +let prefixBackdrop = require('caniuse-lite/data/features/mdn-css-backdrop-pseudo-element') + +f(prefixBackdrop, browsers => + prefix(['::backdrop'], { + browsers, + feature: 'backdrop', + selector: true + }) +) + +// File selector button +let prefixFileSelectorButton = require('caniuse-lite/data/features/css-file-selector-button') + +f(prefixFileSelectorButton, browsers => + prefix(['::file-selector-button'], { + browsers, + feature: 'file-selector-button', + selector: true + }) +) + +// :autofill +let prefixAutofill = require('caniuse-lite/data/features/css-autofill') + +f(prefixAutofill, browsers => + prefix([':autofill'], { + browsers, + feature: 'css-autofill', + selector: true + }) +) + +// Tab size +let prefixTabsize = require('caniuse-lite/data/features/css3-tabsize') + +f(prefixTabsize, browsers => + prefix(['tab-size'], { + browsers, + feature: 'css3-tabsize' + }) +) + +// Intrinsic & extrinsic sizing +let prefixIntrinsic = require('caniuse-lite/data/features/intrinsic-width') + +let sizeProps = [ + 'width', + 'min-width', + 'max-width', + 'height', + 'min-height', + 'max-height', + 'inline-size', + 'min-inline-size', + 'max-inline-size', + 'block-size', + 'min-block-size', + 'max-block-size', + 'grid', + 'grid-template', + 'grid-template-rows', + 'grid-template-columns', + 'grid-auto-columns', + 'grid-auto-rows' +] + +f(prefixIntrinsic, browsers => + prefix(['max-content', 'min-content'], { + browsers, + feature: 'intrinsic-width', + props: sizeProps + }) +) + +f(prefixIntrinsic, { match: /x|\s#4/ }, browsers => + prefix(['fill', 'fill-available'], { + browsers, + feature: 'intrinsic-width', + props: sizeProps + }) +) + +f(prefixIntrinsic, { match: /x|\s#5/ }, browsers => { + let ffFix = browsers.filter(i => { + let [name, version] = i.split(' ') + if (name === 'firefox' || name === 'and_ff') { + return parseInt(version) < 94 + } else { + return true + } + }) + return prefix(['fit-content'], { + browsers: ffFix, + feature: 'intrinsic-width', + props: sizeProps + }) +}) + +// Stretch value + +let prefixStretch = require('caniuse-lite/data/features/css-width-stretch') + +f(prefixStretch, browsers => { + f(prefixIntrinsic, { match: /x|\s#2/ }, firefox => { + browsers = browsers.concat(firefox) + }) + return prefix(['stretch'], { + browsers, + feature: 'css-width-stretch', + props: sizeProps + }) +}) + +// Zoom cursors +let prefixCursorsNew = require('caniuse-lite/data/features/css3-cursors-newer') + +f(prefixCursorsNew, browsers => + prefix(['zoom-in', 'zoom-out'], { + browsers, + feature: 'css3-cursors-newer', + props: ['cursor'] + }) +) + +// Grab cursors +let prefixCursorsGrab = require('caniuse-lite/data/features/css3-cursors-grab') + +f(prefixCursorsGrab, browsers => + prefix(['grab', 'grabbing'], { + browsers, + feature: 'css3-cursors-grab', + props: ['cursor'] + }) +) + +// Sticky position +let prefixSticky = require('caniuse-lite/data/features/css-sticky') + +f(prefixSticky, browsers => + prefix(['sticky'], { + browsers, + feature: 'css-sticky', + props: ['position'] + }) +) + +// Pointer Events +let prefixPointer = require('caniuse-lite/data/features/pointer') + +f(prefixPointer, browsers => + prefix(['touch-action'], { + browsers, + feature: 'pointer' + }) +) + +// Text decoration +let prefixDecoration = require('caniuse-lite/data/features/text-decoration') + +f(prefixDecoration, { match: /x.*#[235]/ }, browsers => + prefix(['text-decoration-skip', 'text-decoration-skip-ink'], { + browsers, + feature: 'text-decoration' + }) +) + +let prefixDecorationShorthand = require('caniuse-lite/data/features/mdn-text-decoration-shorthand') + +f(prefixDecorationShorthand, browsers => + prefix(['text-decoration'], { + browsers, + feature: 'text-decoration' + }) +) + +let prefixDecorationColor = require('caniuse-lite/data/features/mdn-text-decoration-color') + +f(prefixDecorationColor, browsers => + prefix(['text-decoration-color'], { + browsers, + feature: 'text-decoration' + }) +) + +let prefixDecorationLine = require('caniuse-lite/data/features/mdn-text-decoration-line') + +f(prefixDecorationLine, browsers => + prefix(['text-decoration-line'], { + browsers, + feature: 'text-decoration' + }) +) + +let prefixDecorationStyle = require('caniuse-lite/data/features/mdn-text-decoration-style') + +f(prefixDecorationStyle, browsers => + prefix(['text-decoration-style'], { + browsers, + feature: 'text-decoration' + }) +) + +// Text Size Adjust +let prefixTextSizeAdjust = require('caniuse-lite/data/features/text-size-adjust') + +f(prefixTextSizeAdjust, browsers => + prefix(['text-size-adjust'], { + browsers, + feature: 'text-size-adjust' + }) +) + +// CSS Masks +let prefixCssMasks = require('caniuse-lite/data/features/css-masks') + +f(prefixCssMasks, browsers => { + prefix( + [ + 'mask-clip', + 'mask-composite', + 'mask-image', + 'mask-origin', + 'mask-repeat', + 'mask-border-repeat', + 'mask-border-source' + ], + { + browsers, + feature: 'css-masks' + } + ) + prefix( + [ + 'mask', + 'mask-position', + 'mask-position-x', + 'mask-position-y', + 'mask-size', + 'mask-border', + 'mask-border-outset', + 'mask-border-width', + 'mask-border-slice' + ], + { + browsers, + feature: 'css-masks' + } + ) +}) + +// CSS clip-path property +let prefixClipPath = require('caniuse-lite/data/features/css-clip-path') + +f(prefixClipPath, browsers => + prefix(['clip-path'], { + browsers, + feature: 'css-clip-path' + }) +) + +// Fragmented Borders and Backgrounds +let prefixBoxdecoration = require('caniuse-lite/data/features/css-boxdecorationbreak') + +f(prefixBoxdecoration, browsers => + prefix(['box-decoration-break'], { + browsers, + feature: 'css-boxdecorationbreak' + }) +) + +// CSS3 object-fit/object-position +let prefixObjectFit = require('caniuse-lite/data/features/object-fit') + +f(prefixObjectFit, browsers => + prefix(['object-fit', 'object-position'], { + browsers, + feature: 'object-fit' + }) +) + +// CSS Shapes +let prefixShapes = require('caniuse-lite/data/features/css-shapes') + +f(prefixShapes, browsers => + prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], { + browsers, + feature: 'css-shapes' + }) +) + +// CSS3 text-overflow +let prefixTextOverflow = require('caniuse-lite/data/features/text-overflow') + +f(prefixTextOverflow, browsers => + prefix(['text-overflow'], { + browsers, + feature: 'text-overflow' + }) +) + +// Viewport at-rule +let prefixDeviceadaptation = require('caniuse-lite/data/features/css-deviceadaptation') + +f(prefixDeviceadaptation, browsers => + prefix(['@viewport'], { + browsers, + feature: 'css-deviceadaptation' + }) +) + +// Resolution Media Queries +let prefixResolut = require('caniuse-lite/data/features/css-media-resolution') + +f(prefixResolut, { match: /( x($| )|a #2)/ }, browsers => + prefix(['@resolution'], { + browsers, + feature: 'css-media-resolution' + }) +) + +// CSS text-align-last +let prefixTextAlignLast = require('caniuse-lite/data/features/css-text-align-last') + +f(prefixTextAlignLast, browsers => + prefix(['text-align-last'], { + browsers, + feature: 'css-text-align-last' + }) +) + +// Crisp Edges Image Rendering Algorithm +let prefixCrispedges = require('caniuse-lite/data/features/css-crisp-edges') + +f(prefixCrispedges, { match: /y x|a x #1/ }, browsers => + prefix(['pixelated'], { + browsers, + feature: 'css-crisp-edges', + props: ['image-rendering'] + }) +) + +f(prefixCrispedges, { match: /a x #2/ }, browsers => + prefix(['image-rendering'], { + browsers, + feature: 'css-crisp-edges' + }) +) + +// Logical Properties +let prefixLogicalProps = require('caniuse-lite/data/features/css-logical-props') + +f(prefixLogicalProps, browsers => + prefix( + [ + 'border-inline-start', + 'border-inline-end', + 'margin-inline-start', + 'margin-inline-end', + 'padding-inline-start', + 'padding-inline-end' + ], + { + browsers, + feature: 'css-logical-props' + } + ) +) + +f(prefixLogicalProps, { match: /x\s#2/ }, browsers => + prefix( + [ + 'border-block-start', + 'border-block-end', + 'margin-block-start', + 'margin-block-end', + 'padding-block-start', + 'padding-block-end' + ], + { + browsers, + feature: 'css-logical-props' + } + ) +) + +// CSS appearance +let prefixAppearance = require('caniuse-lite/data/features/css-appearance') + +f(prefixAppearance, { match: /#2|x/ }, browsers => + prefix(['appearance'], { + browsers, + feature: 'css-appearance' + }) +) + +// CSS Scroll snap points +let prefixSnappoints = require('caniuse-lite/data/features/css-snappoints') + +f(prefixSnappoints, browsers => + prefix( + [ + 'scroll-snap-type', + 'scroll-snap-coordinate', + 'scroll-snap-destination', + 'scroll-snap-points-x', + 'scroll-snap-points-y' + ], + { + browsers, + feature: 'css-snappoints' + } + ) +) + +// CSS Regions +let prefixRegions = require('caniuse-lite/data/features/css-regions') + +f(prefixRegions, browsers => + prefix(['flow-into', 'flow-from', 'region-fragment'], { + browsers, + feature: 'css-regions' + }) +) + +// CSS image-set +let prefixImageSet = require('caniuse-lite/data/features/css-image-set') + +f(prefixImageSet, browsers => + prefix(['image-set'], { + browsers, + feature: 'css-image-set', + props: [ + 'background', + 'background-image', + 'border-image', + 'cursor', + 'mask', + 'mask-image', + 'list-style', + 'list-style-image', + 'content' + ] + }) +) + +// Writing Mode +let prefixWritingMode = require('caniuse-lite/data/features/css-writing-mode') + +f(prefixWritingMode, { match: /a|x/ }, browsers => + prefix(['writing-mode'], { + browsers, + feature: 'css-writing-mode' + }) +) + +// Cross-Fade Function +let prefixCrossFade = require('caniuse-lite/data/features/css-cross-fade') + +f(prefixCrossFade, browsers => + prefix(['cross-fade'], { + browsers, + feature: 'css-cross-fade', + props: [ + 'background', + 'background-image', + 'border-image', + 'mask', + 'list-style', + 'list-style-image', + 'content', + 'mask-image' + ] + }) +) + +// Read Only selector +let prefixReadOnly = require('caniuse-lite/data/features/css-read-only-write') + +f(prefixReadOnly, browsers => + prefix([':read-only', ':read-write'], { + browsers, + feature: 'css-read-only-write', + selector: true + }) +) + +// Text Emphasize +let prefixTextEmphasis = require('caniuse-lite/data/features/text-emphasis') + +f(prefixTextEmphasis, browsers => + prefix( + [ + 'text-emphasis', + 'text-emphasis-position', + 'text-emphasis-style', + 'text-emphasis-color' + ], + { + browsers, + feature: 'text-emphasis' + } + ) +) + +// CSS Grid Layout +let prefixGrid = require('caniuse-lite/data/features/css-grid') + +f(prefixGrid, browsers => { + prefix(['display-grid', 'inline-grid'], { + browsers, + feature: 'css-grid', + props: ['display'] + }) + prefix( + [ + 'grid-template-columns', + 'grid-template-rows', + 'grid-row-start', + 'grid-column-start', + 'grid-row-end', + 'grid-column-end', + 'grid-row', + 'grid-column', + 'grid-area', + 'grid-template', + 'grid-template-areas', + 'place-self' + ], + { + browsers, + feature: 'css-grid' + } + ) +}) + +f(prefixGrid, { match: /a x/ }, browsers => + prefix(['grid-column-align', 'grid-row-align'], { + browsers, + feature: 'css-grid' + }) +) + +// CSS text-spacing +let prefixTextSpacing = require('caniuse-lite/data/features/css-text-spacing') + +f(prefixTextSpacing, browsers => + prefix(['text-spacing'], { + browsers, + feature: 'css-text-spacing' + }) +) + +// :any-link selector +let prefixAnyLink = require('caniuse-lite/data/features/css-any-link') + +f(prefixAnyLink, browsers => + prefix([':any-link'], { + browsers, + feature: 'css-any-link', + selector: true + }) +) + +// unicode-bidi + +let bidiIsolate = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate') + +f(bidiIsolate, browsers => + prefix(['isolate'], { + browsers, + feature: 'css-unicode-bidi', + props: ['unicode-bidi'] + }) +) + +let bidiPlaintext = require('caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext') + +f(bidiPlaintext, browsers => + prefix(['plaintext'], { + browsers, + feature: 'css-unicode-bidi', + props: ['unicode-bidi'] + }) +) + +let bidiOverride = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override') + +f(bidiOverride, { match: /y x/ }, browsers => + prefix(['isolate-override'], { + browsers, + feature: 'css-unicode-bidi', + props: ['unicode-bidi'] + }) +) + +// overscroll-behavior selector +let prefixOverscroll = require('caniuse-lite/data/features/css-overscroll-behavior') + +f(prefixOverscroll, { match: /a #1/ }, browsers => + prefix(['overscroll-behavior'], { + browsers, + feature: 'css-overscroll-behavior' + }) +) + +// text-orientation +let prefixTextOrientation = require('caniuse-lite/data/features/css-text-orientation') + +f(prefixTextOrientation, browsers => + prefix(['text-orientation'], { + browsers, + feature: 'css-text-orientation' + }) +) + +// print-color-adjust +let prefixPrintAdjust = require('caniuse-lite/data/features/css-print-color-adjust') + +f(prefixPrintAdjust, browsers => + prefix(['print-color-adjust', 'color-adjust'], { + browsers, + feature: 'css-print-color-adjust' + }) +) diff --git a/node_modules/autoprefixer/lib/at-rule.js b/node_modules/autoprefixer/lib/at-rule.js new file mode 100644 index 0000000000000000000000000000000000000000..d36a2791ba31b664c7e47cafffe911825749697a --- /dev/null +++ b/node_modules/autoprefixer/lib/at-rule.js @@ -0,0 +1,35 @@ +let Prefixer = require('./prefixer') + +class AtRule extends Prefixer { + /** + * Clone and add prefixes for at-rule + */ + add(rule, prefix) { + let prefixed = prefix + rule.name + + let already = rule.parent.some( + i => i.name === prefixed && i.params === rule.params + ) + if (already) { + return undefined + } + + let cloned = this.clone(rule, { name: prefixed }) + return rule.parent.insertBefore(rule, cloned) + } + + /** + * Clone node with prefixes + */ + process(node) { + let parent = this.parentPrefix(node) + + for (let prefix of this.prefixes) { + if (!parent || parent === prefix) { + this.add(node, prefix) + } + } + } +} + +module.exports = AtRule diff --git a/node_modules/autoprefixer/lib/autoprefixer.d.ts b/node_modules/autoprefixer/lib/autoprefixer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6cad121f4e58c93546540b52951427ec4c49f1c0 --- /dev/null +++ b/node_modules/autoprefixer/lib/autoprefixer.d.ts @@ -0,0 +1,95 @@ +import { Stats } from 'browserslist' +import { Plugin } from 'postcss' + +declare function autoprefixer( + ...args: [...T, autoprefixer.Options] +): Plugin & autoprefixer.ExportedAPI + +declare function autoprefixer( + browsers: string[], + options?: autoprefixer.Options +): Plugin & autoprefixer.ExportedAPI + +declare function autoprefixer( + options?: autoprefixer.Options +): Plugin & autoprefixer.ExportedAPI + +declare namespace autoprefixer { + type GridValue = 'autoplace' | 'no-autoplace' + + interface Options { + /** environment for `Browserslist` */ + env?: string + + /** should Autoprefixer use Visual Cascade, if CSS is uncompressed */ + cascade?: boolean + + /** should Autoprefixer add prefixes. */ + add?: boolean + + /** should Autoprefixer [remove outdated] prefixes */ + remove?: boolean + + /** should Autoprefixer add prefixes for @supports parameters. */ + supports?: boolean + + /** should Autoprefixer add prefixes for flexbox properties */ + flexbox?: boolean | 'no-2009' + + /** should Autoprefixer add IE 10-11 prefixes for Grid Layout properties */ + grid?: boolean | GridValue + + /** custom usage statistics for > 10% in my stats browsers query */ + stats?: Stats + + /** + * list of queries for target browsers. + * Try to not use it. + * The best practice is to use `.browserslistrc` config or `browserslist` key in `package.json` + * to share target browsers with Babel, ESLint and Stylelint + */ + overrideBrowserslist?: string | string[] + + /** do not raise error on unknown browser version in `Browserslist` config. */ + ignoreUnknownVersions?: boolean + } + + interface ExportedAPI { + /** Autoprefixer data */ + data: { + browsers: { [browser: string]: object | undefined } + prefixes: { [prefixName: string]: object | undefined } + } + + /** Autoprefixer default browsers */ + defaults: string[] + + /** Inspect with default Autoprefixer */ + info(options?: { from?: string }): string + + options: Options + + browsers: string | string[] + } + + /** Autoprefixer data */ + let data: ExportedAPI['data'] + + /** Autoprefixer default browsers */ + let defaults: ExportedAPI['defaults'] + + /** Inspect with default Autoprefixer */ + let info: ExportedAPI['info'] + + let postcss: true +} + +declare global { + namespace NodeJS { + interface ProcessEnv { + AUTOPREFIXER_GRID?: autoprefixer.GridValue + } + } +} + +export = autoprefixer diff --git a/node_modules/autoprefixer/lib/autoprefixer.js b/node_modules/autoprefixer/lib/autoprefixer.js new file mode 100644 index 0000000000000000000000000000000000000000..069409f3f5adc8037f4e0f229d5428e425712710 --- /dev/null +++ b/node_modules/autoprefixer/lib/autoprefixer.js @@ -0,0 +1,164 @@ +let browserslist = require('browserslist') +let { agents } = require('caniuse-lite/dist/unpacker/agents') +let pico = require('picocolors') + +let dataPrefixes = require('../data/prefixes') +let Browsers = require('./browsers') +let getInfo = require('./info') +let Prefixes = require('./prefixes') + +let autoprefixerData = { browsers: agents, prefixes: dataPrefixes } + +const WARNING = + '\n' + + ' Replace Autoprefixer `browsers` option to Browserslist config.\n' + + ' Use `browserslist` key in `package.json` or `.browserslistrc` file.\n' + + '\n' + + ' Using `browsers` option can cause errors. Browserslist config can\n' + + ' be used for Babel, Autoprefixer, postcss-normalize and other tools.\n' + + '\n' + + ' If you really need to use option, rename it to `overrideBrowserslist`.\n' + + '\n' + + ' Learn more at:\n' + + ' https://github.com/browserslist/browserslist#readme\n' + + ' https://twitter.com/browserslist\n' + + '\n' + +function isPlainObject(obj) { + return Object.prototype.toString.apply(obj) === '[object Object]' +} + +let cache = new Map() + +function timeCapsule(result, prefixes) { + if (prefixes.browsers.selected.length === 0) { + return + } + if (prefixes.add.selectors.length > 0) { + return + } + if (Object.keys(prefixes.add).length > 2) { + return + } + /* c8 ignore next 11 */ + result.warn( + 'Autoprefixer target browsers do not need any prefixes.' + + 'You do not need Autoprefixer anymore.\n' + + 'Check your Browserslist config to be sure that your targets ' + + 'are set up correctly.\n' + + '\n' + + ' Learn more at:\n' + + ' https://github.com/postcss/autoprefixer#readme\n' + + ' https://github.com/browserslist/browserslist#readme\n' + + '\n' + ) +} + +module.exports = plugin + +function plugin(...reqs) { + let options + if (reqs.length === 1 && isPlainObject(reqs[0])) { + options = reqs[0] + reqs = undefined + } else if (reqs.length === 0 || (reqs.length === 1 && !reqs[0])) { + reqs = undefined + } else if (reqs.length <= 2 && (Array.isArray(reqs[0]) || !reqs[0])) { + options = reqs[1] + reqs = reqs[0] + } else if (typeof reqs[reqs.length - 1] === 'object') { + options = reqs.pop() + } + + if (!options) { + options = {} + } + + if (options.browser) { + throw new Error( + 'Change `browser` option to `overrideBrowserslist` in Autoprefixer' + ) + } else if (options.browserslist) { + throw new Error( + 'Change `browserslist` option to `overrideBrowserslist` in Autoprefixer' + ) + } + + if (options.overrideBrowserslist) { + reqs = options.overrideBrowserslist + } else if (options.browsers) { + if (typeof console !== 'undefined' && console.warn) { + console.warn( + pico.red(WARNING.replace(/`[^`]+`/g, i => pico.yellow(i.slice(1, -1)))) + ) + } + reqs = options.browsers + } + + let brwlstOpts = { + env: options.env, + ignoreUnknownVersions: options.ignoreUnknownVersions, + stats: options.stats + } + + function loadPrefixes(opts) { + let d = autoprefixerData + let browsers = new Browsers(d.browsers, reqs, opts, brwlstOpts) + let key = browsers.selected.join(', ') + JSON.stringify(options) + + if (!cache.has(key)) { + cache.set(key, new Prefixes(d.prefixes, browsers, options)) + } + + return cache.get(key) + } + + return { + browsers: reqs, + + info(opts) { + opts = opts || {} + opts.from = opts.from || process.cwd() + return getInfo(loadPrefixes(opts)) + }, + + options, + + postcssPlugin: 'autoprefixer', + prepare(result) { + let prefixes = loadPrefixes({ + env: options.env, + from: result.opts.from + }) + + return { + OnceExit(root) { + timeCapsule(result, prefixes) + if (options.remove !== false) { + prefixes.processor.remove(root, result) + } + if (options.add !== false) { + prefixes.processor.add(root, result) + } + } + } + } + } +} + +plugin.postcss = true + +/** + * Autoprefixer data + */ +plugin.data = autoprefixerData + +/** + * Autoprefixer default browsers + */ +plugin.defaults = browserslist.defaults + +/** + * Inspect with default Autoprefixer + */ +plugin.info = () => plugin().info() diff --git a/node_modules/autoprefixer/lib/brackets.js b/node_modules/autoprefixer/lib/brackets.js new file mode 100644 index 0000000000000000000000000000000000000000..755f9a276fbc5210ccca83b0b6096d386dbf619b --- /dev/null +++ b/node_modules/autoprefixer/lib/brackets.js @@ -0,0 +1,55 @@ +function last(array) { + return array[array.length - 1] +} + +let brackets = { + /** + * Parse string to nodes tree + */ + parse(str) { + let current = [''] + let stack = [current] + + for (let sym of str) { + if (sym === '(') { + current = [''] + last(stack).push(current) + stack.push(current) + continue + } + + if (sym === ')') { + if (stack.length > 1) { + stack.pop() + current = last(stack) + current.push('') + } else { + current[current.length - 1] += sym + } + continue + } + + current[current.length - 1] += sym + } + + return stack[0] + }, + + /** + * Generate output string by nodes tree + */ + stringify(ast) { + let result = '' + for (let i of ast) { + if (typeof i === 'object') { + result += `(${brackets.stringify(i)})` + continue + } + + result += i + } + return result + } +} + +module.exports = brackets diff --git a/node_modules/autoprefixer/lib/browsers.js b/node_modules/autoprefixer/lib/browsers.js new file mode 100644 index 0000000000000000000000000000000000000000..b268c84cd5238fc4edaa2931a0e27aff08422d55 --- /dev/null +++ b/node_modules/autoprefixer/lib/browsers.js @@ -0,0 +1,79 @@ +let browserslist = require('browserslist') +let { agents } = require('caniuse-lite/dist/unpacker/agents') + +let utils = require('./utils') + +class Browsers { + constructor(data, requirements, options, browserslistOpts) { + this.data = data + this.options = options || {} + this.browserslistOpts = browserslistOpts || {} + this.selected = this.parse(requirements) + } + + /** + * Return all prefixes for default browser data + */ + static prefixes() { + if (this.prefixesCache) { + return this.prefixesCache + } + + this.prefixesCache = [] + for (let name in agents) { + this.prefixesCache.push(`-${agents[name].prefix}-`) + } + + this.prefixesCache = utils + .uniq(this.prefixesCache) + .sort((a, b) => b.length - a.length) + + return this.prefixesCache + } + + /** + * Check is value contain any possible prefix + */ + static withPrefix(value) { + if (!this.prefixesRegexp) { + this.prefixesRegexp = new RegExp(this.prefixes().join('|')) + } + + return this.prefixesRegexp.test(value) + } + + /** + * Is browser is selected by requirements + */ + isSelected(browser) { + return this.selected.includes(browser) + } + + /** + * Return browsers selected by requirements + */ + parse(requirements) { + let opts = {} + for (let i in this.browserslistOpts) { + opts[i] = this.browserslistOpts[i] + } + opts.path = this.options.from + return browserslist(requirements, opts) + } + + /** + * Return prefix for selected browser + */ + prefix(browser) { + let [name, version] = browser.split(' ') + let data = this.data[name] + + let prefix = data.prefix_exceptions && data.prefix_exceptions[version] + if (!prefix) { + prefix = data.prefix + } + return `-${prefix}-` + } +} + +module.exports = Browsers diff --git a/node_modules/autoprefixer/lib/declaration.js b/node_modules/autoprefixer/lib/declaration.js new file mode 100644 index 0000000000000000000000000000000000000000..9adb99da342766c922585b390ccc6e4dfc6b157d --- /dev/null +++ b/node_modules/autoprefixer/lib/declaration.js @@ -0,0 +1,187 @@ +let Browsers = require('./browsers') +let Prefixer = require('./prefixer') +let utils = require('./utils') + +class Declaration extends Prefixer { + /** + * Clone and add prefixes for declaration + */ + add(decl, prefix, prefixes, result) { + let prefixed = this.prefixed(decl.prop, prefix) + if ( + this.isAlready(decl, prefixed) || + this.otherPrefixes(decl.value, prefix) + ) { + return undefined + } + return this.insert(decl, prefix, prefixes, result) + } + + /** + * Calculate indentation to create visual cascade + */ + calcBefore(prefixes, decl, prefix = '') { + let max = this.maxPrefixed(prefixes, decl) + let diff = max - utils.removeNote(prefix).length + + let before = decl.raw('before') + if (diff > 0) { + before += Array(diff).fill(' ').join('') + } + + return before + } + + /** + * Always true, because we already get prefixer by property name + */ + check(/* decl */) { + return true + } + + /** + * Clone and insert new declaration + */ + insert(decl, prefix, prefixes) { + let cloned = this.set(this.clone(decl), prefix) + if (!cloned) return undefined + + let already = decl.parent.some( + i => i.prop === cloned.prop && i.value === cloned.value + ) + if (already) { + return undefined + } + + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + return decl.parent.insertBefore(decl, cloned) + } + + /** + * Did this declaration has this prefix above + */ + isAlready(decl, prefixed) { + let already = this.all.group(decl).up(i => i.prop === prefixed) + if (!already) { + already = this.all.group(decl).down(i => i.prop === prefixed) + } + return already + } + + /** + * Return maximum length of possible prefixed property + */ + maxPrefixed(prefixes, decl) { + if (decl._autoprefixerMax) { + return decl._autoprefixerMax + } + + let max = 0 + for (let prefix of prefixes) { + prefix = utils.removeNote(prefix) + if (prefix.length > max) { + max = prefix.length + } + } + decl._autoprefixerMax = max + + return decl._autoprefixerMax + } + + /** + * Should we use visual cascade for prefixes + */ + needCascade(decl) { + if (!decl._autoprefixerCascade) { + decl._autoprefixerCascade = + this.all.options.cascade !== false && decl.raw('before').includes('\n') + } + return decl._autoprefixerCascade + } + + /** + * Return unprefixed version of property + */ + normalize(prop) { + return prop + } + + /** + * Return list of prefixed properties to clean old prefixes + */ + old(prop, prefix) { + return [this.prefixed(prop, prefix)] + } + + /** + * Check `value`, that it contain other prefixes, rather than `prefix` + */ + otherPrefixes(value, prefix) { + for (let other of Browsers.prefixes()) { + if (other === prefix) { + continue + } + if (value.includes(other)) { + return value.replace(/var\([^)]+\)/, '').includes(other) + } + } + return false + } + + /** + * Return prefixed version of property + */ + prefixed(prop, prefix) { + return prefix + prop + } + + /** + * Add spaces for visual cascade + */ + process(decl, result) { + if (!this.needCascade(decl)) { + super.process(decl, result) + return + } + + let prefixes = super.process(decl, result) + + if (!prefixes || !prefixes.length) { + return + } + + this.restoreBefore(decl) + decl.raws.before = this.calcBefore(prefixes, decl) + } + + /** + * Remove visual cascade + */ + restoreBefore(decl) { + let lines = decl.raw('before').split('\n') + let min = lines[lines.length - 1] + + this.all.group(decl).up(prefixed => { + let array = prefixed.raw('before').split('\n') + let last = array[array.length - 1] + if (last.length < min.length) { + min = last + } + }) + + lines[lines.length - 1] = min + decl.raws.before = lines.join('\n') + } + + /** + * Set prefix to declaration + */ + set(decl, prefix) { + decl.prop = this.prefixed(decl.prop, prefix) + return decl + } +} + +module.exports = Declaration diff --git a/node_modules/autoprefixer/lib/hacks/align-content.js b/node_modules/autoprefixer/lib/hacks/align-content.js new file mode 100644 index 0000000000000000000000000000000000000000..d55427426d4a44b94751c3bbe1b4255cdc0366de --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-content.js @@ -0,0 +1,49 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class AlignContent extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'align-content' + } + + /** + * Change property name for 2012 spec + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012) { + return prefix + 'flex-line-pack' + } + return super.prefixed(prop, prefix) + } + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2012) { + decl.value = AlignContent.oldValues[decl.value] || decl.value + return super.set(decl, prefix) + } + if (spec === 'final') { + return super.set(decl, prefix) + } + return undefined + } +} + +AlignContent.names = ['align-content', 'flex-line-pack'] + +AlignContent.oldValues = { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-around': 'distribute', + 'space-between': 'justify' +} + +module.exports = AlignContent diff --git a/node_modules/autoprefixer/lib/hacks/align-items.js b/node_modules/autoprefixer/lib/hacks/align-items.js new file mode 100644 index 0000000000000000000000000000000000000000..9c12e65bcc192e490071a167e0ea87454dd947bd --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-items.js @@ -0,0 +1,46 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class AlignItems extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'align-items' + } + + /** + * Change property name for 2009 and 2012 specs + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return prefix + 'box-align' + } + if (spec === 2012) { + return prefix + 'flex-align' + } + return super.prefixed(prop, prefix) + } + + /** + * Change value for 2009 and 2012 specs + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2009 || spec === 2012) { + decl.value = AlignItems.oldValues[decl.value] || decl.value + } + return super.set(decl, prefix) + } +} + +AlignItems.names = ['align-items', 'flex-align', 'box-align'] + +AlignItems.oldValues = { + 'flex-end': 'end', + 'flex-start': 'start' +} + +module.exports = AlignItems diff --git a/node_modules/autoprefixer/lib/hacks/align-self.js b/node_modules/autoprefixer/lib/hacks/align-self.js new file mode 100644 index 0000000000000000000000000000000000000000..4070567fe226ac7e77028f2ab7779d835277a883 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/align-self.js @@ -0,0 +1,56 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class AlignSelf extends Declaration { + check(decl) { + return ( + decl.parent && + !decl.parent.some(i => { + return i.prop && i.prop.startsWith('grid-') + }) + ) + } + + /** + * Return property name by final spec + */ + normalize() { + return 'align-self' + } + + /** + * Change property name for 2012 specs + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012) { + return prefix + 'flex-item-align' + } + return super.prefixed(prop, prefix) + } + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2012) { + decl.value = AlignSelf.oldValues[decl.value] || decl.value + return super.set(decl, prefix) + } + if (spec === 'final') { + return super.set(decl, prefix) + } + return undefined + } +} + +AlignSelf.names = ['align-self', 'flex-item-align'] + +AlignSelf.oldValues = { + 'flex-end': 'end', + 'flex-start': 'start' +} + +module.exports = AlignSelf diff --git a/node_modules/autoprefixer/lib/hacks/animation.js b/node_modules/autoprefixer/lib/hacks/animation.js new file mode 100644 index 0000000000000000000000000000000000000000..7ce949afc8205c3a9f073e23eeb004730c610425 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/animation.js @@ -0,0 +1,17 @@ +let Declaration = require('../declaration') + +class Animation extends Declaration { + /** + * Don’t add prefixes for modern values. + */ + check(decl) { + return !decl.value.split(/\s+/).some(i => { + let lower = i.toLowerCase() + return lower === 'reverse' || lower === 'alternate-reverse' + }) + } +} + +Animation.names = ['animation', 'animation-direction'] + +module.exports = Animation diff --git a/node_modules/autoprefixer/lib/hacks/appearance.js b/node_modules/autoprefixer/lib/hacks/appearance.js new file mode 100644 index 0000000000000000000000000000000000000000..34be3841f4f4173adc31055e64be075adc3ccd47 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/appearance.js @@ -0,0 +1,23 @@ +let Declaration = require('../declaration') +let utils = require('../utils') + +class Appearance extends Declaration { + constructor(name, prefixes, all) { + super(name, prefixes, all) + + if (this.prefixes) { + this.prefixes = utils.uniq( + this.prefixes.map(i => { + if (i === '-ms-') { + return '-webkit-' + } + return i + }) + ) + } + } +} + +Appearance.names = ['appearance'] + +module.exports = Appearance diff --git a/node_modules/autoprefixer/lib/hacks/autofill.js b/node_modules/autoprefixer/lib/hacks/autofill.js new file mode 100644 index 0000000000000000000000000000000000000000..a9c49cead444a78b20788f9a61944549f6877228 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/autofill.js @@ -0,0 +1,26 @@ +let Selector = require('../selector') +let utils = require('../utils') + +class Autofill extends Selector { + constructor(name, prefixes, all) { + super(name, prefixes, all) + + if (this.prefixes) { + this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) + } + } + + /** + * Return different selectors depend on prefix + */ + prefixed(prefix) { + if (prefix === '-webkit-') { + return ':-webkit-autofill' + } + return `:${prefix}autofill` + } +} + +Autofill.names = [':autofill'] + +module.exports = Autofill diff --git a/node_modules/autoprefixer/lib/hacks/backdrop-filter.js b/node_modules/autoprefixer/lib/hacks/backdrop-filter.js new file mode 100644 index 0000000000000000000000000000000000000000..f9b4b05bbd3beb9c586fc3efd2d4a88adb20170b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/backdrop-filter.js @@ -0,0 +1,20 @@ +let Declaration = require('../declaration') +let utils = require('../utils') + +class BackdropFilter extends Declaration { + constructor(name, prefixes, all) { + super(name, prefixes, all) + + if (this.prefixes) { + this.prefixes = utils.uniq( + this.prefixes.map(i => { + return i === '-ms-' ? '-webkit-' : i + }) + ) + } + } +} + +BackdropFilter.names = ['backdrop-filter'] + +module.exports = BackdropFilter diff --git a/node_modules/autoprefixer/lib/hacks/background-clip.js b/node_modules/autoprefixer/lib/hacks/background-clip.js new file mode 100644 index 0000000000000000000000000000000000000000..92c714c794d1bc2c8b55e17fc07f09fe98c91f26 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/background-clip.js @@ -0,0 +1,24 @@ +let Declaration = require('../declaration') +let utils = require('../utils') + +class BackgroundClip extends Declaration { + constructor(name, prefixes, all) { + super(name, prefixes, all) + + if (this.prefixes) { + this.prefixes = utils.uniq( + this.prefixes.map(i => { + return i === '-ms-' ? '-webkit-' : i + }) + ) + } + } + + check(decl) { + return decl.value.toLowerCase() === 'text' + } +} + +BackgroundClip.names = ['background-clip'] + +module.exports = BackgroundClip diff --git a/node_modules/autoprefixer/lib/hacks/background-size.js b/node_modules/autoprefixer/lib/hacks/background-size.js new file mode 100644 index 0000000000000000000000000000000000000000..1fba894544f67dcea5cd4a3320f6fd2511065fcf --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/background-size.js @@ -0,0 +1,23 @@ +let Declaration = require('../declaration') + +class BackgroundSize extends Declaration { + /** + * Duplication parameter for -webkit- browsers + */ + set(decl, prefix) { + let value = decl.value.toLowerCase() + if ( + prefix === '-webkit-' && + !value.includes(' ') && + value !== 'contain' && + value !== 'cover' + ) { + decl.value = decl.value + ' ' + decl.value + } + return super.set(decl, prefix) + } +} + +BackgroundSize.names = ['background-size'] + +module.exports = BackgroundSize diff --git a/node_modules/autoprefixer/lib/hacks/block-logical.js b/node_modules/autoprefixer/lib/hacks/block-logical.js new file mode 100644 index 0000000000000000000000000000000000000000..cb795f7a4914f90e3046765f0a5de85f295c8680 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/block-logical.js @@ -0,0 +1,40 @@ +let Declaration = require('../declaration') + +class BlockLogical extends Declaration { + /** + * Return property name by spec + */ + normalize(prop) { + if (prop.includes('-before')) { + return prop.replace('-before', '-block-start') + } + return prop.replace('-after', '-block-end') + } + + /** + * Use old syntax for -moz- and -webkit- + */ + prefixed(prop, prefix) { + if (prop.includes('-start')) { + return prefix + prop.replace('-block-start', '-before') + } + return prefix + prop.replace('-block-end', '-after') + } +} + +BlockLogical.names = [ + 'border-block-start', + 'border-block-end', + 'margin-block-start', + 'margin-block-end', + 'padding-block-start', + 'padding-block-end', + 'border-before', + 'border-after', + 'margin-before', + 'margin-after', + 'padding-before', + 'padding-after' +] + +module.exports = BlockLogical diff --git a/node_modules/autoprefixer/lib/hacks/border-image.js b/node_modules/autoprefixer/lib/hacks/border-image.js new file mode 100644 index 0000000000000000000000000000000000000000..f5cbd2ca50a5a0ef6214387b13d2184831a5b261 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/border-image.js @@ -0,0 +1,15 @@ +let Declaration = require('../declaration') + +class BorderImage extends Declaration { + /** + * Remove fill parameter for prefixed declarations + */ + set(decl, prefix) { + decl.value = decl.value.replace(/\s+fill(\s)/, '$1') + return super.set(decl, prefix) + } +} + +BorderImage.names = ['border-image'] + +module.exports = BorderImage diff --git a/node_modules/autoprefixer/lib/hacks/border-radius.js b/node_modules/autoprefixer/lib/hacks/border-radius.js new file mode 100644 index 0000000000000000000000000000000000000000..47ea835fa2d3754bf4315f19079dec4952aafb92 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/border-radius.js @@ -0,0 +1,40 @@ +let Declaration = require('../declaration') + +class BorderRadius extends Declaration { + /** + * Return unprefixed version of property + */ + normalize(prop) { + return BorderRadius.toNormal[prop] || prop + } + + /** + * Change syntax, when add Mozilla prefix + */ + prefixed(prop, prefix) { + if (prefix === '-moz-') { + return prefix + (BorderRadius.toMozilla[prop] || prop) + } + return super.prefixed(prop, prefix) + } +} + +BorderRadius.names = ['border-radius'] + +BorderRadius.toMozilla = {} +BorderRadius.toNormal = {} + +for (let ver of ['top', 'bottom']) { + for (let hor of ['left', 'right']) { + let normal = `border-${ver}-${hor}-radius` + let mozilla = `border-radius-${ver}${hor}` + + BorderRadius.names.push(normal) + BorderRadius.names.push(mozilla) + + BorderRadius.toMozilla[normal] = mozilla + BorderRadius.toNormal[mozilla] = normal + } +} + +module.exports = BorderRadius diff --git a/node_modules/autoprefixer/lib/hacks/break-props.js b/node_modules/autoprefixer/lib/hacks/break-props.js new file mode 100644 index 0000000000000000000000000000000000000000..b67b12f9c4c59088a18981e7b44961d3a4f19aaa --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/break-props.js @@ -0,0 +1,63 @@ +let Declaration = require('../declaration') + +class BreakProps extends Declaration { + /** + * Don’t prefix some values + */ + insert(decl, prefix, prefixes) { + if (decl.prop !== 'break-inside') { + return super.insert(decl, prefix, prefixes) + } + if (/region/i.test(decl.value) || /page/i.test(decl.value)) { + return undefined + } + return super.insert(decl, prefix, prefixes) + } + + /** + * Return property name by final spec + */ + normalize(prop) { + if (prop.includes('inside')) { + return 'break-inside' + } + if (prop.includes('before')) { + return 'break-before' + } + return 'break-after' + } + + /** + * Change name for -webkit- and -moz- prefix + */ + prefixed(prop, prefix) { + return `${prefix}column-${prop}` + } + + /** + * Change prefixed value for avoid-column and avoid-page + */ + set(decl, prefix) { + if ( + (decl.prop === 'break-inside' && decl.value === 'avoid-column') || + decl.value === 'avoid-page' + ) { + decl.value = 'avoid' + } + return super.set(decl, prefix) + } +} + +BreakProps.names = [ + 'break-inside', + 'page-break-inside', + 'column-break-inside', + 'break-before', + 'page-break-before', + 'column-break-before', + 'break-after', + 'page-break-after', + 'column-break-after' +] + +module.exports = BreakProps diff --git a/node_modules/autoprefixer/lib/hacks/cross-fade.js b/node_modules/autoprefixer/lib/hacks/cross-fade.js new file mode 100644 index 0000000000000000000000000000000000000000..caaa90d7eb33655bfe761b05ba9e52d6a479f05a --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/cross-fade.js @@ -0,0 +1,35 @@ +let list = require('postcss').list + +let Value = require('../value') + +class CrossFade extends Value { + replace(string, prefix) { + return list + .space(string) + .map(value => { + if (value.slice(0, +this.name.length + 1) !== this.name + '(') { + return value + } + + let close = value.lastIndexOf(')') + let after = value.slice(close + 1) + let args = value.slice(this.name.length + 1, close) + + if (prefix === '-webkit-') { + let match = args.match(/\d*.?\d+%?/) + if (match) { + args = args.slice(match[0].length).trim() + args += `, ${match[0]}` + } else { + args += ', 0.5' + } + } + return prefix + this.name + '(' + args + ')' + after + }) + .join(' ') + } +} + +CrossFade.names = ['cross-fade'] + +module.exports = CrossFade diff --git a/node_modules/autoprefixer/lib/hacks/display-flex.js b/node_modules/autoprefixer/lib/hacks/display-flex.js new file mode 100644 index 0000000000000000000000000000000000000000..663172c2764c97c8ba8021f26d0f9b906ac249ea --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/display-flex.js @@ -0,0 +1,65 @@ +let OldValue = require('../old-value') +let Value = require('../value') +let flexSpec = require('./flex-spec') + +class DisplayFlex extends Value { + constructor(name, prefixes) { + super(name, prefixes) + if (name === 'display-flex') { + this.name = 'flex' + } + } + + /** + * Faster check for flex value + */ + check(decl) { + return decl.prop === 'display' && decl.value === this.name + } + + /** + * Change value for old specs + */ + old(prefix) { + let prefixed = this.prefixed(prefix) + if (!prefixed) return undefined + return new OldValue(this.name, prefixed) + } + + /** + * Return value by spec + */ + prefixed(prefix) { + let spec, value + ;[spec, prefix] = flexSpec(prefix) + + if (spec === 2009) { + if (this.name === 'flex') { + value = 'box' + } else { + value = 'inline-box' + } + } else if (spec === 2012) { + if (this.name === 'flex') { + value = 'flexbox' + } else { + value = 'inline-flexbox' + } + } else if (spec === 'final') { + value = this.name + } + + return prefix + value + } + + /** + * Add prefix to value depend on flebox spec version + */ + replace(string, prefix) { + return this.prefixed(prefix) + } +} + +DisplayFlex.names = ['display-flex', 'inline-flex'] + +module.exports = DisplayFlex diff --git a/node_modules/autoprefixer/lib/hacks/display-grid.js b/node_modules/autoprefixer/lib/hacks/display-grid.js new file mode 100644 index 0000000000000000000000000000000000000000..290ec8b01fbd20f08657eccce5002fd197311b74 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/display-grid.js @@ -0,0 +1,21 @@ +let Value = require('../value') + +class DisplayGrid extends Value { + constructor(name, prefixes) { + super(name, prefixes) + if (name === 'display-grid') { + this.name = 'grid' + } + } + + /** + * Faster check for flex value + */ + check(decl) { + return decl.prop === 'display' && decl.value === this.name + } +} + +DisplayGrid.names = ['display-grid', 'inline-grid'] + +module.exports = DisplayGrid diff --git a/node_modules/autoprefixer/lib/hacks/file-selector-button.js b/node_modules/autoprefixer/lib/hacks/file-selector-button.js new file mode 100644 index 0000000000000000000000000000000000000000..18ebcead2b90eeedc72c51cb8836a5006c604cd7 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/file-selector-button.js @@ -0,0 +1,26 @@ +let Selector = require('../selector') +let utils = require('../utils') + +class FileSelectorButton extends Selector { + constructor(name, prefixes, all) { + super(name, prefixes, all) + + if (this.prefixes) { + this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-')) + } + } + + /** + * Return different selectors depend on prefix + */ + prefixed(prefix) { + if (prefix === '-webkit-') { + return '::-webkit-file-upload-button' + } + return `::${prefix}file-selector-button` + } +} + +FileSelectorButton.names = ['::file-selector-button'] + +module.exports = FileSelectorButton diff --git a/node_modules/autoprefixer/lib/hacks/filter-value.js b/node_modules/autoprefixer/lib/hacks/filter-value.js new file mode 100644 index 0000000000000000000000000000000000000000..98e5f612282da6170f2aee28eb2d480980de806d --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/filter-value.js @@ -0,0 +1,14 @@ +let Value = require('../value') + +class FilterValue extends Value { + constructor(name, prefixes) { + super(name, prefixes) + if (name === 'filter-function') { + this.name = 'filter' + } + } +} + +FilterValue.names = ['filter', 'filter-function'] + +module.exports = FilterValue diff --git a/node_modules/autoprefixer/lib/hacks/filter.js b/node_modules/autoprefixer/lib/hacks/filter.js new file mode 100644 index 0000000000000000000000000000000000000000..7ec6fbee88600438c7bd9f5c2e6dc98c2e27fd85 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/filter.js @@ -0,0 +1,19 @@ +let Declaration = require('../declaration') + +class Filter extends Declaration { + /** + * Check is it Internet Explorer filter + */ + check(decl) { + let v = decl.value + return ( + !v.toLowerCase().includes('alpha(') && + !v.includes('DXImageTransform.Microsoft') && + !v.includes('data:image/svg+xml') + ) + } +} + +Filter.names = ['filter'] + +module.exports = Filter diff --git a/node_modules/autoprefixer/lib/hacks/flex-basis.js b/node_modules/autoprefixer/lib/hacks/flex-basis.js new file mode 100644 index 0000000000000000000000000000000000000000..3e913ee91603f03833a8eafc182602a602463590 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-basis.js @@ -0,0 +1,39 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class FlexBasis extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'flex-basis' + } + + /** + * Return flex property for 2012 spec + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012) { + return prefix + 'flex-preferred-size' + } + return super.prefixed(prop, prefix) + } + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + set(decl, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012 || spec === 'final') { + return super.set(decl, prefix) + } + return undefined + } +} + +FlexBasis.names = ['flex-basis', 'flex-preferred-size'] + +module.exports = FlexBasis diff --git a/node_modules/autoprefixer/lib/hacks/flex-direction.js b/node_modules/autoprefixer/lib/hacks/flex-direction.js new file mode 100644 index 0000000000000000000000000000000000000000..e3928f9caf2c527e364ba25769fce1e54d64f58b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-direction.js @@ -0,0 +1,72 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class FlexDirection extends Declaration { + /** + * Use two properties for 2009 spec + */ + insert(decl, prefix, prefixes) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec !== 2009) { + return super.insert(decl, prefix, prefixes) + } + let already = decl.parent.some( + i => + i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction' + ) + if (already) { + return undefined + } + + let v = decl.value + let dir, orient + if (v === 'inherit' || v === 'initial' || v === 'unset') { + orient = v + dir = v + } else { + orient = v.includes('row') ? 'horizontal' : 'vertical' + dir = v.includes('reverse') ? 'reverse' : 'normal' + } + + let cloned = this.clone(decl) + cloned.prop = prefix + 'box-orient' + cloned.value = orient + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + decl.parent.insertBefore(decl, cloned) + + cloned = this.clone(decl) + cloned.prop = prefix + 'box-direction' + cloned.value = dir + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + return decl.parent.insertBefore(decl, cloned) + } + + /** + * Return property name by final spec + */ + normalize() { + return 'flex-direction' + } + + /** + * Clean two properties for 2009 spec + */ + old(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return [prefix + 'box-orient', prefix + 'box-direction'] + } else { + return super.old(prop, prefix) + } + } +} + +FlexDirection.names = ['flex-direction', 'box-direction', 'box-orient'] + +module.exports = FlexDirection diff --git a/node_modules/autoprefixer/lib/hacks/flex-flow.js b/node_modules/autoprefixer/lib/hacks/flex-flow.js new file mode 100644 index 0000000000000000000000000000000000000000..4257ebda02731f3a582d66a7f03ce1feb4c08b79 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-flow.js @@ -0,0 +1,53 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class FlexFlow extends Declaration { + /** + * Use two properties for 2009 spec + */ + insert(decl, prefix, prefixes) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec !== 2009) { + return super.insert(decl, prefix, prefixes) + } + let values = decl.value + .split(/\s+/) + .filter(i => i !== 'wrap' && i !== 'nowrap' && 'wrap-reverse') + if (values.length === 0) { + return undefined + } + + let already = decl.parent.some( + i => + i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction' + ) + if (already) { + return undefined + } + + let value = values[0] + let orient = value.includes('row') ? 'horizontal' : 'vertical' + let dir = value.includes('reverse') ? 'reverse' : 'normal' + + let cloned = this.clone(decl) + cloned.prop = prefix + 'box-orient' + cloned.value = orient + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + decl.parent.insertBefore(decl, cloned) + + cloned = this.clone(decl) + cloned.prop = prefix + 'box-direction' + cloned.value = dir + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + return decl.parent.insertBefore(decl, cloned) + } +} + +FlexFlow.names = ['flex-flow', 'box-direction', 'box-orient'] + +module.exports = FlexFlow diff --git a/node_modules/autoprefixer/lib/hacks/flex-grow.js b/node_modules/autoprefixer/lib/hacks/flex-grow.js new file mode 100644 index 0000000000000000000000000000000000000000..b2faa71460d99918ba802fc458f479a43e1ca42b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-grow.js @@ -0,0 +1,30 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class Flex extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'flex' + } + + /** + * Return flex property for 2009 and 2012 specs + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return prefix + 'box-flex' + } + if (spec === 2012) { + return prefix + 'flex-positive' + } + return super.prefixed(prop, prefix) + } +} + +Flex.names = ['flex-grow', 'flex-positive'] + +module.exports = Flex diff --git a/node_modules/autoprefixer/lib/hacks/flex-shrink.js b/node_modules/autoprefixer/lib/hacks/flex-shrink.js new file mode 100644 index 0000000000000000000000000000000000000000..1cc73da5b7517224a68c28c4befd752bdcb53694 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-shrink.js @@ -0,0 +1,39 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class FlexShrink extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'flex-shrink' + } + + /** + * Return flex property for 2012 spec + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012) { + return prefix + 'flex-negative' + } + return super.prefixed(prop, prefix) + } + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + set(decl, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2012 || spec === 'final') { + return super.set(decl, prefix) + } + return undefined + } +} + +FlexShrink.names = ['flex-shrink', 'flex-negative'] + +module.exports = FlexShrink diff --git a/node_modules/autoprefixer/lib/hacks/flex-spec.js b/node_modules/autoprefixer/lib/hacks/flex-spec.js new file mode 100644 index 0000000000000000000000000000000000000000..a077d66066dedb1499ef5c3a4b854e9fb9a58162 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-spec.js @@ -0,0 +1,19 @@ +/** + * Return flexbox spec versions by prefix + */ +module.exports = function (prefix) { + let spec + if (prefix === '-webkit- 2009' || prefix === '-moz-') { + spec = 2009 + } else if (prefix === '-ms-') { + spec = 2012 + } else if (prefix === '-webkit-') { + spec = 'final' + } + + if (prefix === '-webkit- 2009') { + prefix = '-webkit-' + } + + return [spec, prefix] +} diff --git a/node_modules/autoprefixer/lib/hacks/flex-wrap.js b/node_modules/autoprefixer/lib/hacks/flex-wrap.js new file mode 100644 index 0000000000000000000000000000000000000000..489154d7d948fada28513a300990c87b9abde947 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex-wrap.js @@ -0,0 +1,19 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class FlexWrap extends Declaration { + /** + * Don't add prefix for 2009 spec + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec !== 2009) { + return super.set(decl, prefix) + } + return undefined + } +} + +FlexWrap.names = ['flex-wrap'] + +module.exports = FlexWrap diff --git a/node_modules/autoprefixer/lib/hacks/flex.js b/node_modules/autoprefixer/lib/hacks/flex.js new file mode 100644 index 0000000000000000000000000000000000000000..146a394a823e3ba4e58ba19fd80c8e6c395322b7 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/flex.js @@ -0,0 +1,54 @@ +let list = require('postcss').list + +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class Flex extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'flex' + } + + /** + * Change property name for 2009 spec + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return prefix + 'box-flex' + } + return super.prefixed(prop, prefix) + } + + /** + * Spec 2009 supports only first argument + * Spec 2012 disallows unitless basis + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2009) { + decl.value = list.space(decl.value)[0] + decl.value = Flex.oldValues[decl.value] || decl.value + return super.set(decl, prefix) + } + if (spec === 2012) { + let components = list.space(decl.value) + if (components.length === 3 && components[2] === '0') { + decl.value = components.slice(0, 2).concat('0px').join(' ') + } + } + return super.set(decl, prefix) + } +} + +Flex.names = ['flex', 'box-flex'] + +Flex.oldValues = { + auto: '1', + none: '0' +} + +module.exports = Flex diff --git a/node_modules/autoprefixer/lib/hacks/fullscreen.js b/node_modules/autoprefixer/lib/hacks/fullscreen.js new file mode 100644 index 0000000000000000000000000000000000000000..5a7439045420af2dc952f4c77ccee976467c7e25 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/fullscreen.js @@ -0,0 +1,20 @@ +let Selector = require('../selector') + +class Fullscreen extends Selector { + /** + * Return different selectors depend on prefix + */ + prefixed(prefix) { + if (prefix === '-webkit-') { + return ':-webkit-full-screen' + } + if (prefix === '-moz-') { + return ':-moz-full-screen' + } + return `:${prefix}fullscreen` + } +} + +Fullscreen.names = [':fullscreen'] + +module.exports = Fullscreen diff --git a/node_modules/autoprefixer/lib/hacks/gradient.js b/node_modules/autoprefixer/lib/hacks/gradient.js new file mode 100644 index 0000000000000000000000000000000000000000..127efeefa5415f697c706b7e3a2805d880ba9b63 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/gradient.js @@ -0,0 +1,460 @@ +let parser = require('postcss-value-parser') + +let OldValue = require('../old-value') +let utils = require('../utils') +let Value = require('../value') + +const IS_DIRECTION = /top|left|right|bottom/gi + +class Gradient extends Value { + /** + * Do not add non-webkit prefixes for list-style and object + */ + add(decl, prefix) { + let p = decl.prop + if (p.includes('mask')) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return super.add(decl, prefix) + } + } else if ( + p === 'list-style' || + p === 'list-style-image' || + p === 'content' + ) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return super.add(decl, prefix) + } + } else { + return super.add(decl, prefix) + } + return undefined + } + + /** + * Get div token from exists parameters + */ + cloneDiv(params) { + for (let i of params) { + if (i.type === 'div' && i.value === ',') { + return i + } + } + return { after: ' ', type: 'div', value: ',' } + } + + /** + * Change colors syntax to old webkit + */ + colorStops(params) { + let result = [] + for (let i = 0; i < params.length; i++) { + let pos + let param = params[i] + let item + if (i === 0) { + continue + } + + if (param.length === 0) { + continue + } + + let color = parser.stringify(param[0]) + if (param[1] && param[1].type === 'word') { + pos = param[1].value + } else if (param[2] && param[2].type === 'word') { + pos = param[2].value + } + + let stop + if (i === 1 && (!pos || pos === '0%')) { + stop = `from(${color})` + } else if (i === params.length - 1 && (!pos || pos === '100%')) { + stop = `to(${color})` + } else if (pos) { + stop = `color-stop(${pos}, ${color})` + } else { + stop = `color-stop(${color})` + } + + let div = param[param.length - 1] + params[i] = [{ type: 'word', value: stop }] + if (div && div.type === 'div' && div.value === ',') { + item = params[i].push(div) + } + result.push(item) + } + return result + } + + /** + * Change new direction to old + */ + convertDirection(params) { + if (params.length > 0) { + if (params[0].value === 'to') { + this.fixDirection(params) + } else if (params[0].value.includes('deg')) { + this.fixAngle(params) + } else if (this.isRadial(params)) { + this.fixRadial(params) + } + } + return params + } + + /** + * Add 90 degrees + */ + fixAngle(params) { + let first = params[0].value + first = parseFloat(first) + first = Math.abs(450 - first) % 360 + first = this.roundFloat(first, 3) + params[0].value = `${first}deg` + } + + /** + * Replace `to top left` to `bottom right` + */ + fixDirection(params) { + params.splice(0, 2) + + for (let param of params) { + if (param.type === 'div') { + break + } + if (param.type === 'word') { + param.value = this.revertDirection(param.value) + } + } + } + + /** + * Fix radial direction syntax + */ + fixRadial(params) { + let first = [] + let second = [] + let a, b, c, i, next + + for (i = 0; i < params.length - 2; i++) { + a = params[i] + b = params[i + 1] + c = params[i + 2] + if (a.type === 'space' && b.value === 'at' && c.type === 'space') { + next = i + 3 + break + } else { + first.push(a) + } + } + + let div + for (i = next; i < params.length; i++) { + if (params[i].type === 'div') { + div = params[i] + break + } else { + second.push(params[i]) + } + } + + params.splice(0, i, ...second, div, ...first) + } + + /** + * Look for at word + */ + isRadial(params) { + let state = 'before' + for (let param of params) { + if (state === 'before' && param.type === 'space') { + state = 'at' + } else if (state === 'at' && param.value === 'at') { + state = 'after' + } else if (state === 'after' && param.type === 'space') { + return true + } else if (param.type === 'div') { + break + } else { + state = 'before' + } + } + return false + } + + /** + * Replace old direction to new + */ + newDirection(params) { + if (!params[0]) { + return params + } + if (params[0].value === 'to') { + return params + } + IS_DIRECTION.lastIndex = 0 // reset search index of global regexp + if (!IS_DIRECTION.test(params[0].value)) { + return params + } + + params.unshift( + { + type: 'word', + value: 'to' + }, + { + type: 'space', + value: ' ' + } + ) + + for (let i = 2; i < params.length; i++) { + if (params[i].type === 'div') { + break + } + if (params[i].type === 'word') { + params[i].value = this.revertDirection(params[i].value) + } + } + + return params + } + + /** + * Normalize angle + */ + normalize(nodes, gradientName) { + if (!nodes[0]) return nodes + + if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 400) + } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI) + } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 1) + } else if (nodes[0].value.includes('deg')) { + let num = parseFloat(nodes[0].value) + num = ((num % 360) + 360) % 360 + nodes[0].value = `${num}deg` + } + + if ( + gradientName === 'linear-gradient' || + gradientName === 'repeating-linear-gradient' + ) { + let direction = nodes[0].value + + // Unitless zero for `` values are allowed in CSS gradients and transforms. + // Spec: https://github.com/w3c/csswg-drafts/commit/602789171429b2231223ab1e5acf8f7f11652eb3 + if (direction === '0deg' || direction === '0') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'top') + } else if (direction === '90deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'right') + } else if (direction === '180deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') // default value + } else if (direction === '270deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'left') + } + } + + return nodes + } + + /** + * Convert angle unit to deg + */ + normalizeUnit(str, full) { + let num = parseFloat(str) + let deg = (num / full) * 360 + return `${deg}deg` + } + + /** + * Remove old WebKit gradient too + */ + old(prefix) { + if (prefix === '-webkit-') { + let type + if (this.name === 'linear-gradient') { + type = 'linear' + } else if (this.name === 'repeating-linear-gradient') { + type = 'repeating-linear' + } else if (this.name === 'repeating-radial-gradient') { + type = 'repeating-radial' + } else { + type = 'radial' + } + let string = '-gradient' + let regexp = utils.regexp( + `-webkit-(${type}-gradient|gradient\\(\\s*${type})`, + false + ) + + return new OldValue(this.name, prefix + this.name, string, regexp) + } else { + return super.old(prefix) + } + } + + /** + * Change direction syntax to old webkit + */ + oldDirection(params) { + let div = this.cloneDiv(params[0]) + + if (!params[0][0] || params[0][0].value !== 'to') { + return params.unshift([ + { type: 'word', value: Gradient.oldDirections.bottom }, + div + ]) + } else { + let words = [] + for (let node of params[0].slice(2)) { + if (node.type === 'word') { + words.push(node.value.toLowerCase()) + } + } + + words = words.join(' ') + let old = Gradient.oldDirections[words] || words + + params[0] = [{ type: 'word', value: old }, div] + return params[0] + } + } + + /** + * Convert to old webkit syntax + */ + oldWebkit(node) { + let { nodes } = node + let string = parser.stringify(node.nodes) + + if (this.name !== 'linear-gradient') { + return false + } + if (nodes.length === 0) { + return false + } + if (nodes[0] && nodes[0].value.includes('deg')) { + return false + } + if ( + string.includes('px') || + string.includes('-corner') || + string.includes('-side') + ) { + return false + } + if (string.includes('var(')) { + return false + } + + let params = [[]] + for (let i of nodes) { + params[params.length - 1].push(i) + if (i.type === 'div' && i.value === ',') { + params.push([]) + } + } + + this.oldDirection(params) + this.colorStops(params) + + node.nodes = [] + for (let param of params) { + node.nodes.push(...param) + } + + node.nodes.unshift( + { type: 'word', value: 'linear' }, + this.cloneDiv(node.nodes) + ) + node.value = '-webkit-gradient' + + return true + } + + /** + * Change degrees for webkit prefix + */ + replace(string, prefix) { + let ast = parser(string) + for (let node of ast.nodes) { + let gradientName = this.name // gradient name + if (node.type === 'function' && node.value === gradientName) { + node.nodes = this.newDirection(node.nodes) + node.nodes = this.normalize(node.nodes, gradientName) + if (prefix === '-webkit- old') { + let changes = this.oldWebkit(node) + if (!changes) { + return false + } + } else { + node.nodes = this.convertDirection(node.nodes) + node.value = prefix + node.value + } + } + } + return ast.toString() + } + + /** + * Replace first token + */ + replaceFirst(params, ...words) { + let prefix = words.map(i => { + if (i === ' ') { + return { type: 'space', value: i } + } + return { type: 'word', value: i } + }) + return prefix.concat(params.slice(1)) + } + + revertDirection(word) { + return Gradient.directions[word.toLowerCase()] || word + } + + /** + * Round float and save digits under dot + */ + roundFloat(float, digits) { + return parseFloat(float.toFixed(digits)) + } +} + +Gradient.names = [ + 'linear-gradient', + 'repeating-linear-gradient', + 'radial-gradient', + 'repeating-radial-gradient' +] + +Gradient.directions = { + bottom: 'top', + left: 'right', + right: 'left', + top: 'bottom' // default value +} + +// Direction to replace +Gradient.oldDirections = { + 'bottom': 'left top, left bottom', + 'bottom left': 'right top, left bottom', + 'bottom right': 'left top, right bottom', + 'left': 'right top, left top', + + 'left bottom': 'right top, left bottom', + 'left top': 'right bottom, left top', + 'right': 'left top, right top', + 'right bottom': 'left top, right bottom', + 'right top': 'left bottom, right top', + 'top': 'left bottom, left top', + 'top left': 'right bottom, left top', + 'top right': 'left bottom, right top' +} + +module.exports = Gradient diff --git a/node_modules/autoprefixer/lib/hacks/grid-area.js b/node_modules/autoprefixer/lib/hacks/grid-area.js new file mode 100644 index 0000000000000000000000000000000000000000..0a2d86c480814d0ddc22cf816a537ad017076c7c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-area.js @@ -0,0 +1,34 @@ +let Declaration = require('../declaration') +let utils = require('./grid-utils') + +class GridArea extends Declaration { + /** + * Translate grid-area to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let values = utils.parse(decl) + + let [rowStart, rowSpan] = utils.translate(values, 0, 2) + let [columnStart, columnSpan] = utils.translate(values, 1, 3) + + ;[ + ['grid-row', rowStart], + ['grid-row-span', rowSpan], + ['grid-column', columnStart], + ['grid-column-span', columnSpan] + ].forEach(([prop, value]) => { + utils.insertDecl(decl, prop, value) + }) + + utils.warnTemplateSelectorNotFound(decl, result) + utils.warnIfGridRowColumnExists(decl, result) + + return undefined + } +} + +GridArea.names = ['grid-area'] + +module.exports = GridArea diff --git a/node_modules/autoprefixer/lib/hacks/grid-column-align.js b/node_modules/autoprefixer/lib/hacks/grid-column-align.js new file mode 100644 index 0000000000000000000000000000000000000000..91f10f0f7b14f899a8780e4964200d7c48f7b2d9 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-column-align.js @@ -0,0 +1,28 @@ +let Declaration = require('../declaration') + +class GridColumnAlign extends Declaration { + /** + * Do not prefix flexbox values + */ + check(decl) { + return !decl.value.includes('flex-') && decl.value !== 'baseline' + } + + /** + * Change IE property back + */ + normalize() { + return 'justify-self' + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + return prefix + 'grid-column-align' + } +} + +GridColumnAlign.names = ['grid-column-align'] + +module.exports = GridColumnAlign diff --git a/node_modules/autoprefixer/lib/hacks/grid-end.js b/node_modules/autoprefixer/lib/hacks/grid-end.js new file mode 100644 index 0000000000000000000000000000000000000000..63f6a4225615f6ae9412bc6a8c3f9bb2f1d1fd58 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-end.js @@ -0,0 +1,52 @@ +let Declaration = require('../declaration') +let { isPureNumber } = require('../utils') + +class GridEnd extends Declaration { + /** + * Change repeating syntax for IE + */ + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let clonedDecl = this.clone(decl) + + let startProp = decl.prop.replace(/end$/, 'start') + let spanProp = prefix + decl.prop.replace(/end$/, 'span') + + if (decl.parent.some(i => i.prop === spanProp)) { + return undefined + } + + clonedDecl.prop = spanProp + + if (decl.value.includes('span')) { + clonedDecl.value = decl.value.replace(/span\s/i, '') + } else { + let startDecl + decl.parent.walkDecls(startProp, d => { + startDecl = d + }) + if (startDecl) { + if (isPureNumber(startDecl.value)) { + let value = Number(decl.value) - Number(startDecl.value) + '' + clonedDecl.value = value + } else { + return undefined + } + } else { + decl.warn( + result, + `Can not prefix ${decl.prop} (${startProp} is not found)` + ) + } + } + + decl.cloneBefore(clonedDecl) + + return undefined + } +} + +GridEnd.names = ['grid-row-end', 'grid-column-end'] + +module.exports = GridEnd diff --git a/node_modules/autoprefixer/lib/hacks/grid-row-align.js b/node_modules/autoprefixer/lib/hacks/grid-row-align.js new file mode 100644 index 0000000000000000000000000000000000000000..cba8aeed24069e347eecb66565869f704e093054 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-row-align.js @@ -0,0 +1,28 @@ +let Declaration = require('../declaration') + +class GridRowAlign extends Declaration { + /** + * Do not prefix flexbox values + */ + check(decl) { + return !decl.value.includes('flex-') && decl.value !== 'baseline' + } + + /** + * Change IE property back + */ + normalize() { + return 'align-self' + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + return prefix + 'grid-row-align' + } +} + +GridRowAlign.names = ['grid-row-align'] + +module.exports = GridRowAlign diff --git a/node_modules/autoprefixer/lib/hacks/grid-row-column.js b/node_modules/autoprefixer/lib/hacks/grid-row-column.js new file mode 100644 index 0000000000000000000000000000000000000000..2199f7834829ca8cc5212ee846e528bbbbbcd688 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-row-column.js @@ -0,0 +1,33 @@ +let Declaration = require('../declaration') +let utils = require('./grid-utils') + +class GridRowColumn extends Declaration { + /** + * Translate grid-row / grid-column to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let values = utils.parse(decl) + let [start, span] = utils.translate(values, 0, 1) + + let hasStartValueSpan = values[0] && values[0].includes('span') + + if (hasStartValueSpan) { + span = values[0].join('').replace(/\D/g, '') + } + + ;[ + [decl.prop, start], + [`${decl.prop}-span`, span] + ].forEach(([prop, value]) => { + utils.insertDecl(decl, prop, value) + }) + + return undefined + } +} + +GridRowColumn.names = ['grid-row', 'grid-column'] + +module.exports = GridRowColumn diff --git a/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js b/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js new file mode 100644 index 0000000000000000000000000000000000000000..f873f35e7d5780dab14ca491179fb64b874d3e7a --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js @@ -0,0 +1,125 @@ +let Declaration = require('../declaration') +let Processor = require('../processor') +let { + autoplaceGridItems, + getGridGap, + inheritGridGap, + prefixTrackProp, + prefixTrackValue +} = require('./grid-utils') + +class GridRowsColumns extends Declaration { + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let { parent, prop, value } = decl + let isRowProp = prop.includes('rows') + let isColumnProp = prop.includes('columns') + + let hasGridTemplate = parent.some( + i => i.prop === 'grid-template' || i.prop === 'grid-template-areas' + ) + + /** + * Not to prefix rows declaration if grid-template(-areas) is present + */ + if (hasGridTemplate && isRowProp) { + return false + } + + let processor = new Processor({ options: {} }) + let status = processor.gridStatus(parent, result) + let gap = getGridGap(decl) + gap = inheritGridGap(decl, gap) || gap + + let gapValue = isRowProp ? gap.row : gap.column + + if ((status === 'no-autoplace' || status === true) && !hasGridTemplate) { + gapValue = null + } + + let prefixValue = prefixTrackValue({ + gap: gapValue, + value + }) + + /** + * Insert prefixes + */ + decl.cloneBefore({ + prop: prefixTrackProp({ prefix, prop }), + value: prefixValue + }) + + let autoflow = parent.nodes.find(i => i.prop === 'grid-auto-flow') + let autoflowValue = 'row' + + if (autoflow && !processor.disabled(autoflow, result)) { + autoflowValue = autoflow.value.trim() + } + if (status === 'autoplace') { + /** + * Show warning if grid-template-rows decl is not found + */ + let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') + + if (!rowDecl && hasGridTemplate) { + return undefined + } else if (!rowDecl && !hasGridTemplate) { + decl.warn( + result, + 'Autoplacement does not work without grid-template-rows property' + ) + return undefined + } + + /** + * Show warning if grid-template-columns decl is not found + */ + let columnDecl = parent.nodes.find(i => { + return i.prop === 'grid-template-columns' + }) + if (!columnDecl && !hasGridTemplate) { + decl.warn( + result, + 'Autoplacement does not work without grid-template-columns property' + ) + } + + /** + * Autoplace grid items + */ + if (isColumnProp && !hasGridTemplate) { + autoplaceGridItems(decl, result, gap, autoflowValue) + } + } + + return undefined + } + + /** + * Change IE property back + */ + normalize(prop) { + return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1') + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + if (prefix === '-ms-') { + return prefixTrackProp({ prefix, prop }) + } + return super.prefixed(prop, prefix) + } +} + +GridRowsColumns.names = [ + 'grid-template-rows', + 'grid-template-columns', + 'grid-rows', + 'grid-columns' +] + +module.exports = GridRowsColumns diff --git a/node_modules/autoprefixer/lib/hacks/grid-start.js b/node_modules/autoprefixer/lib/hacks/grid-start.js new file mode 100644 index 0000000000000000000000000000000000000000..32cebc10dfb4480bf11ae7b8d745ed1ed3885864 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-start.js @@ -0,0 +1,33 @@ +let Declaration = require('../declaration') + +class GridStart extends Declaration { + /** + * Do not add prefix for unsupported value in IE + */ + check(decl) { + let value = decl.value + return !value.includes('/') && !value.includes('span') + } + + /** + * Return a final spec property + */ + normalize(prop) { + return prop.replace('-start', '') + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + let result = super.prefixed(prop, prefix) + if (prefix === '-ms-') { + result = result.replace('-start', '') + } + return result + } +} + +GridStart.names = ['grid-row-start', 'grid-column-start'] + +module.exports = GridStart diff --git a/node_modules/autoprefixer/lib/hacks/grid-template-areas.js b/node_modules/autoprefixer/lib/hacks/grid-template-areas.js new file mode 100644 index 0000000000000000000000000000000000000000..ffc9673fffac2f083b8e32466ab2b85ee8930bec --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-template-areas.js @@ -0,0 +1,84 @@ +let Declaration = require('../declaration') +let { + getGridGap, + inheritGridGap, + parseGridAreas, + prefixTrackProp, + prefixTrackValue, + warnGridGap, + warnMissedAreas +} = require('./grid-utils') + +function getGridRows(tpl) { + return tpl + .trim() + .slice(1, -1) + .split(/["']\s*["']?/g) +} + +class GridTemplateAreas extends Declaration { + /** + * Translate grid-template-areas to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let hasColumns = false + let hasRows = false + let parent = decl.parent + let gap = getGridGap(decl) + gap = inheritGridGap(decl, gap) || gap + + // remove already prefixed rows + // to prevent doubling prefixes + parent.walkDecls(/-ms-grid-rows/, i => i.remove()) + + // add empty tracks to rows + parent.walkDecls(/grid-template-(rows|columns)/, trackDecl => { + if (trackDecl.prop === 'grid-template-rows') { + hasRows = true + let { prop, value } = trackDecl + trackDecl.cloneBefore({ + prop: prefixTrackProp({ prefix, prop }), + value: prefixTrackValue({ gap: gap.row, value }) + }) + } else { + hasColumns = true + } + }) + + let gridRows = getGridRows(decl.value) + + if (hasColumns && !hasRows && gap.row && gridRows.length > 1) { + decl.cloneBefore({ + prop: '-ms-grid-rows', + raws: {}, + value: prefixTrackValue({ + gap: gap.row, + value: `repeat(${gridRows.length}, auto)` + }) + }) + } + + // warnings + warnGridGap({ + decl, + gap, + hasColumns, + result + }) + + let areas = parseGridAreas({ + gap, + rows: gridRows + }) + + warnMissedAreas(areas, decl, result) + + return decl + } +} + +GridTemplateAreas.names = ['grid-template-areas'] + +module.exports = GridTemplateAreas diff --git a/node_modules/autoprefixer/lib/hacks/grid-template.js b/node_modules/autoprefixer/lib/hacks/grid-template.js new file mode 100644 index 0000000000000000000000000000000000000000..4e286376c0681de1e52f565fc42e5fcea8581f58 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-template.js @@ -0,0 +1,69 @@ +let Declaration = require('../declaration') +let { + getGridGap, + inheritGridGap, + parseTemplate, + warnGridGap, + warnMissedAreas +} = require('./grid-utils') + +class GridTemplate extends Declaration { + /** + * Translate grid-template to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + if (decl.parent.some(i => i.prop === '-ms-grid-rows')) { + return undefined + } + + let gap = getGridGap(decl) + + /** + * we must insert inherited gap values in some cases: + * if we are inside media query && if we have no grid-gap value + */ + let inheritedGap = inheritGridGap(decl, gap) + + let { areas, columns, rows } = parseTemplate({ + decl, + gap: inheritedGap || gap + }) + + let hasAreas = Object.keys(areas).length > 0 + let hasRows = Boolean(rows) + let hasColumns = Boolean(columns) + + warnGridGap({ + decl, + gap, + hasColumns, + result + }) + + warnMissedAreas(areas, decl, result) + + if ((hasRows && hasColumns) || hasAreas) { + decl.cloneBefore({ + prop: '-ms-grid-rows', + raws: {}, + value: rows + }) + } + + if (hasColumns) { + decl.cloneBefore({ + prop: '-ms-grid-columns', + raws: {}, + value: columns + }) + } + + return decl + } +} + +GridTemplate.names = ['grid-template'] + +module.exports = GridTemplate diff --git a/node_modules/autoprefixer/lib/hacks/grid-utils.js b/node_modules/autoprefixer/lib/hacks/grid-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..2d0b162856a807faca340c9351a45e0abbd6e1bc --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-utils.js @@ -0,0 +1,1174 @@ +let parser = require('postcss-value-parser') +let list = require('postcss').list + +let uniq = require('../utils').uniq +let escapeRegexp = require('../utils').escapeRegexp +let splitSelector = require('../utils').splitSelector + +function convert(value) { + if ( + value && + value.length === 2 && + value[0] === 'span' && + parseInt(value[1], 10) > 0 + ) { + return [false, parseInt(value[1], 10)] + } + + if (value && value.length === 1 && parseInt(value[0], 10) > 0) { + return [parseInt(value[0], 10), false] + } + + return [false, false] +} + +exports.translate = translate + +function translate(values, startIndex, endIndex) { + let startValue = values[startIndex] + let endValue = values[endIndex] + + if (!startValue) { + return [false, false] + } + + let [start, spanStart] = convert(startValue) + let [end, spanEnd] = convert(endValue) + + if (start && !endValue) { + return [start, false] + } + + if (spanStart && end) { + return [end - spanStart, spanStart] + } + + if (start && spanEnd) { + return [start, spanEnd] + } + + if (start && end) { + return [start, end - start] + } + + return [false, false] +} + +exports.parse = parse + +function parse(decl) { + let node = parser(decl.value) + + let values = [] + let current = 0 + values[current] = [] + + for (let i of node.nodes) { + if (i.type === 'div') { + current += 1 + values[current] = [] + } else if (i.type === 'word') { + values[current].push(i.value) + } + } + + return values +} + +exports.insertDecl = insertDecl + +function insertDecl(decl, prop, value) { + if (value && !decl.parent.some(i => i.prop === `-ms-${prop}`)) { + decl.cloneBefore({ + prop: `-ms-${prop}`, + value: value.toString() + }) + } +} + +// Track transforms + +exports.prefixTrackProp = prefixTrackProp + +function prefixTrackProp({ prefix, prop }) { + return prefix + prop.replace('template-', '') +} + +function transformRepeat({ nodes }, { gap }) { + let { count, size } = nodes.reduce( + (result, node) => { + if (node.type === 'div' && node.value === ',') { + result.key = 'size' + } else { + result[result.key].push(parser.stringify(node)) + } + return result + }, + { + count: [], + key: 'count', + size: [] + } + ) + + // insert gap values + if (gap) { + size = size.filter(i => i.trim()) + let val = [] + for (let i = 1; i <= count; i++) { + size.forEach((item, index) => { + if (index > 0 || i > 1) { + val.push(gap) + } + val.push(item) + }) + } + + return val.join(' ') + } + + return `(${size.join('')})[${count.join('')}]` +} + +exports.prefixTrackValue = prefixTrackValue + +function prefixTrackValue({ gap, value }) { + let result = parser(value).nodes.reduce((nodes, node) => { + if (node.type === 'function' && node.value === 'repeat') { + nodes.push({ + type: 'word', + value: transformRepeat(node, { gap }) + }) + return nodes + } + if (gap && node.type === 'space') { + nodes.push( + { + type: 'space', + value: ' ' + }, + { + type: 'word', + value: gap + }, + node + ) + return nodes + } + nodes.push(node) + return nodes + }, []) + + return parser.stringify(result) +} + +// Parse grid-template-areas + +const DOTS = /^\.+$/ + +function track(start, end) { + return { end, span: end - start, start } +} + +function getColumns(line) { + return line.trim().split(/\s+/g) +} + +exports.parseGridAreas = parseGridAreas + +function parseGridAreas({ gap, rows }) { + return rows.reduce((areas, line, rowIndex) => { + if (gap.row) rowIndex *= 2 + + if (line.trim() === '') return areas + + getColumns(line).forEach((area, columnIndex) => { + if (DOTS.test(area)) return + + if (gap.column) columnIndex *= 2 + + if (typeof areas[area] === 'undefined') { + areas[area] = { + column: track(columnIndex + 1, columnIndex + 2), + row: track(rowIndex + 1, rowIndex + 2) + } + } else { + let { column, row } = areas[area] + + column.start = Math.min(column.start, columnIndex + 1) + column.end = Math.max(column.end, columnIndex + 2) + column.span = column.end - column.start + + row.start = Math.min(row.start, rowIndex + 1) + row.end = Math.max(row.end, rowIndex + 2) + row.span = row.end - row.start + } + }) + + return areas + }, {}) +} + +// Parse grid-template + +function testTrack(node) { + return node.type === 'word' && /^\[.+]$/.test(node.value) +} + +function verifyRowSize(result) { + if (result.areas.length > result.rows.length) { + result.rows.push('auto') + } + return result +} + +exports.parseTemplate = parseTemplate + +function parseTemplate({ decl, gap }) { + let gridTemplate = parser(decl.value).nodes.reduce( + (result, node) => { + let { type, value } = node + + if (testTrack(node) || type === 'space') return result + + // area + if (type === 'string') { + result = verifyRowSize(result) + result.areas.push(value) + } + + // values and function + if (type === 'word' || type === 'function') { + result[result.key].push(parser.stringify(node)) + } + + // divider(/) + if (type === 'div' && value === '/') { + result.key = 'columns' + result = verifyRowSize(result) + } + + return result + }, + { + areas: [], + columns: [], + key: 'rows', + rows: [] + } + ) + + return { + areas: parseGridAreas({ + gap, + rows: gridTemplate.areas + }), + columns: prefixTrackValue({ + gap: gap.column, + value: gridTemplate.columns.join(' ') + }), + rows: prefixTrackValue({ + gap: gap.row, + value: gridTemplate.rows.join(' ') + }) + } +} + +// Insert parsed grid areas + +/** + * Get an array of -ms- prefixed props and values + * @param {Object} [area] area object with column and row data + * @param {Boolean} [addRowSpan] should we add grid-column-row value? + * @param {Boolean} [addColumnSpan] should we add grid-column-span value? + * @return {Array} + */ +function getMSDecls(area, addRowSpan = false, addColumnSpan = false) { + let result = [ + { + prop: '-ms-grid-row', + value: String(area.row.start) + } + ] + if (area.row.span > 1 || addRowSpan) { + result.push({ + prop: '-ms-grid-row-span', + value: String(area.row.span) + }) + } + result.push({ + prop: '-ms-grid-column', + value: String(area.column.start) + }) + if (area.column.span > 1 || addColumnSpan) { + result.push({ + prop: '-ms-grid-column-span', + value: String(area.column.span) + }) + } + return result +} + +function getParentMedia(parent) { + if (parent.type === 'atrule' && parent.name === 'media') { + return parent + } + if (!parent.parent) { + return false + } + return getParentMedia(parent.parent) +} + +/** + * change selectors for rules with duplicate grid-areas. + * @param {Array} rules + * @param {Array} templateSelectors + * @return {Array} rules with changed selectors + */ +function changeDuplicateAreaSelectors(ruleSelectors, templateSelectors) { + ruleSelectors = ruleSelectors.map(selector => { + let selectorBySpace = list.space(selector) + let selectorByComma = list.comma(selector) + + if (selectorBySpace.length > selectorByComma.length) { + selector = selectorBySpace.slice(-1).join('') + } + return selector + }) + + return ruleSelectors.map(ruleSelector => { + let newSelector = templateSelectors.map((tplSelector, index) => { + let space = index === 0 ? '' : ' ' + return `${space}${tplSelector} > ${ruleSelector}` + }) + + return newSelector + }) +} + +/** + * check if selector of rules are equal + * @param {Rule} ruleA + * @param {Rule} ruleB + * @return {Boolean} + */ +function selectorsEqual(ruleA, ruleB) { + return ruleA.selectors.some(sel => { + return ruleB.selectors.includes(sel) + }) +} + +function selectorStartsWith(base, selector) { + if (!selector.startsWith(base)) { + return false + } + + let next = selector[base.length] + return !next || /[\s.#[:>+~]/.test(next) +} + +function selectorMayOverlap(previous, current) { + let base = previous.replace(/\s*\*\s*/g, ' ').replace(/\s+/g, ' ').trim() + let selector = current.replace(/\s+/g, ' ').trim() + + return !base || selectorStartsWith(base, selector) +} + +function selectorsMayOverlap(previous, current) { + return previous.some(previousSelector => { + return current.some(currentSelector => { + return selectorMayOverlap(previousSelector, currentSelector) + }) + }) +} + +/** + * Parse data from all grid-template(-areas) declarations + * @param {Root} css css root + * @return {Object} parsed data + */ +function parseGridTemplatesData(css) { + let parsed = [] + + // we walk through every grid-template(-areas) declaration and store + // data with the same area names inside the item + css.walkDecls(/grid-template(-areas)?$/, d => { + let rule = d.parent + let media = getParentMedia(rule) + let gap = getGridGap(d) + let inheritedGap = inheritGridGap(d, gap) + let { areas } = parseTemplate({ decl: d, gap: inheritedGap || gap }) + let areaNames = Object.keys(areas) + + // skip node if it doesn't have areas + if (areaNames.length === 0) { + return true + } + + // check parsed array for item that include the same area names + // return index of that item + let index = parsed.reduce((acc, { allAreas }, idx) => { + let hasAreas = allAreas && areaNames.some(area => allAreas.includes(area)) + return hasAreas ? idx : acc + }, null) + + if (index !== null) { + // index is found, add the grid-template data to that item + let { allAreas, rules } = parsed[index] + + // check if rule has no duplicate area names + let hasNoDuplicates = rules.some(r => { + return r.hasDuplicates === false && selectorsEqual(r, rule) + }) + + let duplicatesFound = false + + // check need to gather all duplicate area names + let duplicateAreaNames = rules.reduce((acc, r) => { + if (!r.params && selectorsEqual(r, rule)) { + duplicatesFound = true + return r.duplicateAreaNames + } + if (!duplicatesFound) { + areaNames.forEach(name => { + if (r.areas[name]) { + acc.push(name) + } + }) + } + return uniq(acc) + }, []) + + // update grid-row/column-span values for areas with duplicate + // area names. @see #1084 and #1146 + rules.forEach(r => { + areaNames.forEach(name => { + let area = r.areas[name] + if (area && area.row.span !== areas[name].row.span) { + areas[name].row.updateSpan = true + } + + if (area && area.column.span !== areas[name].column.span) { + areas[name].column.updateSpan = true + } + }) + }) + + parsed[index].allAreas = uniq([...allAreas, ...areaNames]) + parsed[index].rules.push({ + areas, + duplicateAreaNames, + hasDuplicates: !hasNoDuplicates, + node: rule, + params: media.params, + selectors: rule.selectors + }) + } else { + // index is NOT found, push the new item to the parsed array + parsed.push({ + allAreas: areaNames, + areasCount: 0, + rules: [ + { + areas, + duplicateAreaNames: [], + duplicateRules: [], + hasDuplicates: false, + node: rule, + params: media.params, + selectors: rule.selectors + } + ] + }) + } + + return undefined + }) + + return parsed +} + +/** + * insert prefixed grid-area declarations + * @param {Root} css css root + * @param {Function} isDisabled check if the rule is disabled + * @return {void} + */ +exports.insertAreas = insertAreas + +function insertAreas(css, isDisabled) { + // parse grid-template declarations + let gridTemplatesData = parseGridTemplatesData(css) + + // return undefined if no declarations found + if (gridTemplatesData.length === 0) { + return undefined + } + + // we need to store the rules that we will insert later + let rulesToInsert = {} + let previousGridAreas = [] + + css.walkDecls('grid-area', gridArea => { + let gridAreaRule = gridArea.parent + let hasPrefixedRow = gridAreaRule.first.prop === '-ms-grid-row' + let gridAreaMedia = getParentMedia(gridAreaRule) + + if (isDisabled(gridArea)) { + return undefined + } + + let gridAreaRuleIndex = css.index(gridAreaMedia || gridAreaRule) + + let value = gridArea.value + // found the data that matches grid-area identifier + let data = gridTemplatesData.filter(d => d.allAreas.includes(value))[0] + + if (!data) { + return true + } + + let lastArea = data.allAreas[data.allAreas.length - 1] + let selectorBySpace = list.space(gridAreaRule.selector) + let selectorByComma = list.comma(gridAreaRule.selector) + let selectorIsComplex = + selectorBySpace.length > 1 && + selectorBySpace.length > selectorByComma.length + + // prevent doubling of prefixes + if (hasPrefixedRow) { + return false + } + + function shouldResetSpan(rule, area, dimension) { + return previousGridAreas.some(previous => { + if (previous.data !== data) { + return false + } + if (!selectorsMayOverlap(previous.selectors, gridAreaRule.selectors)) { + return false + } + + let previousArea = rule.areas[previous.value] + return previousArea && previousArea[dimension].span > area[dimension].span + }) + } + + // create the empty object with the key as the last area name + // e.g if we have templates with "a b c" values, "c" will be the last area + if (!rulesToInsert[lastArea]) { + rulesToInsert[lastArea] = {} + } + + let lastRuleIsSet = false + + // walk through every grid-template rule data + for (let rule of data.rules) { + let area = rule.areas[value] + let hasDuplicateName = rule.duplicateAreaNames.includes(value) + + // if we can't find the area name, update lastRule and continue + if (!area) { + let lastRule = rulesToInsert[lastArea].lastRule + let lastRuleIndex + if (lastRule) { + lastRuleIndex = css.index(lastRule) + } else { + /* c8 ignore next 2 */ + lastRuleIndex = -1 + } + + if (gridAreaRuleIndex > lastRuleIndex) { + rulesToInsert[lastArea].lastRule = gridAreaMedia || gridAreaRule + } + continue + } + + // for grid-templates inside media rule we need to create empty + // array to push prefixed grid-area rules later + if (rule.params && !rulesToInsert[lastArea][rule.params]) { + rulesToInsert[lastArea][rule.params] = [] + } + + if ((!rule.hasDuplicates || !hasDuplicateName) && !rule.params) { + // grid-template has no duplicates and not inside media rule + let addRowSpan = shouldResetSpan(rule, area, 'row') + let addColumnSpan = shouldResetSpan(rule, area, 'column') + + getMSDecls(area, addRowSpan, addColumnSpan) + .reverse() + .forEach(i => + gridAreaRule.prepend( + Object.assign(i, { + raws: { + between: gridArea.raws.between + } + }) + ) + ) + + rulesToInsert[lastArea].lastRule = gridAreaRule + lastRuleIsSet = true + } else if (rule.hasDuplicates && !rule.params && !selectorIsComplex) { + // grid-template has duplicates and not inside media rule + let cloned = gridAreaRule.clone() + cloned.removeAll() + let addRowSpan = area.row.updateSpan || shouldResetSpan(rule, area, 'row') + let addColumnSpan = + area.column.updateSpan || shouldResetSpan(rule, area, 'column') + + getMSDecls(area, addRowSpan, addColumnSpan) + .reverse() + .forEach(i => + cloned.prepend( + Object.assign(i, { + raws: { + between: gridArea.raws.between + } + }) + ) + ) + + cloned.selectors = changeDuplicateAreaSelectors( + cloned.selectors, + rule.selectors + ) + + if (rulesToInsert[lastArea].lastRule) { + rulesToInsert[lastArea].lastRule.after(cloned) + } + rulesToInsert[lastArea].lastRule = cloned + lastRuleIsSet = true + } else if ( + rule.hasDuplicates && + !rule.params && + selectorIsComplex && + gridAreaRule.selector.includes(rule.selectors[0]) + ) { + // grid-template has duplicates and not inside media rule + // and the selector is complex + gridAreaRule.walkDecls(/-ms-grid-(row|column)/, d => d.remove()) + let addRowSpan = area.row.updateSpan || shouldResetSpan(rule, area, 'row') + let addColumnSpan = + area.column.updateSpan || shouldResetSpan(rule, area, 'column') + + getMSDecls(area, addRowSpan, addColumnSpan) + .reverse() + .forEach(i => + gridAreaRule.prepend( + Object.assign(i, { + raws: { + between: gridArea.raws.between + } + }) + ) + ) + } else if (rule.params) { + // grid-template is inside media rule + // if we're inside media rule, we need to store prefixed rules + // inside rulesToInsert object to be able to preserve the order of media + // rules and merge them easily + let cloned = gridAreaRule.clone() + cloned.removeAll() + let addRowSpan = area.row.updateSpan || shouldResetSpan(rule, area, 'row') + let addColumnSpan = + area.column.updateSpan || shouldResetSpan(rule, area, 'column') + + getMSDecls(area, addRowSpan, addColumnSpan) + .reverse() + .forEach(i => + cloned.prepend( + Object.assign(i, { + raws: { + between: gridArea.raws.between + } + }) + ) + ) + + if (rule.hasDuplicates && hasDuplicateName) { + cloned.selectors = changeDuplicateAreaSelectors( + cloned.selectors, + rule.selectors + ) + } + + cloned.raws = rule.node.raws + + if (css.index(rule.node.parent) > gridAreaRuleIndex) { + // append the prefixed rules right inside media rule + // with grid-template + rule.node.parent.append(cloned) + } else { + // store the rule to insert later + rulesToInsert[lastArea][rule.params].push(cloned) + } + + // set new rule as last rule ONLY if we didn't set lastRule for + // this grid-area before + if (!lastRuleIsSet) { + rulesToInsert[lastArea].lastRule = gridAreaMedia || gridAreaRule + } + } + } + + previousGridAreas.push({ + data, + selectors: gridAreaRule.selectors, + value + }) + + return undefined + }) + + // append stored rules inside the media rules + Object.keys(rulesToInsert).forEach(area => { + let data = rulesToInsert[area] + let lastRule = data.lastRule + Object.keys(data) + .reverse() + .filter(p => p !== 'lastRule') + .forEach(params => { + if (data[params].length > 0 && lastRule) { + lastRule.after({ name: 'media', params }) + lastRule.next().append(data[params]) + } + }) + }) + + return undefined +} + +/** + * Warn user if grid area identifiers are not found + * @param {Object} areas + * @param {Declaration} decl + * @param {Result} result + * @return {void} + */ +exports.warnMissedAreas = warnMissedAreas + +function warnMissedAreas(areas, decl, result) { + let missed = Object.keys(areas) + + decl.root().walkDecls('grid-area', gridArea => { + missed = missed.filter(e => e !== gridArea.value) + }) + + if (missed.length > 0) { + decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')) + } + + return undefined +} + +/** + * compare selectors with grid-area rule and grid-template rule + * show warning if grid-template selector is not found + * (this function used for grid-area rule) + * @param {Declaration} decl + * @param {Result} result + * @return {void} + */ +exports.warnTemplateSelectorNotFound = warnTemplateSelectorNotFound + +function warnTemplateSelectorNotFound(decl, result) { + let rule = decl.parent + let root = decl.root() + let duplicatesFound = false + + // slice selector array. Remove the last part (for comparison) + let slicedSelectorArr = list + .space(rule.selector) + .filter(str => str !== '>') + .slice(0, -1) + + // we need to compare only if selector is complex. + // e.g '.grid-cell' is simple, but '.parent > .grid-cell' is complex + if (slicedSelectorArr.length > 0) { + let gridTemplateFound = false + let foundAreaSelector = null + + root.walkDecls(/grid-template(-areas)?$/, d => { + let parent = d.parent + let templateSelectors = parent.selectors + + let { areas } = parseTemplate({ decl: d, gap: getGridGap(d) }) + let hasArea = areas[decl.value] + + // find the the matching selectors + for (let tplSelector of templateSelectors) { + if (gridTemplateFound) { + break + } + let tplSelectorArr = list.space(tplSelector).filter(str => str !== '>') + + gridTemplateFound = tplSelectorArr.every( + (item, idx) => item === slicedSelectorArr[idx] + ) + } + + if (gridTemplateFound || !hasArea) { + return true + } + + if (!foundAreaSelector) { + foundAreaSelector = parent.selector + } + + // if we found the duplicate area with different selector + if (foundAreaSelector && foundAreaSelector !== parent.selector) { + duplicatesFound = true + } + + return undefined + }) + + // warn user if we didn't find template + if (!gridTemplateFound && duplicatesFound) { + decl.warn( + result, + 'Autoprefixer cannot find a grid-template ' + + `containing the duplicate grid-area "${decl.value}" ` + + `with full selector matching: ${slicedSelectorArr.join(' ')}` + ) + } + } +} + +/** + * warn user if both grid-area and grid-(row|column) + * declarations are present in the same rule + * @param {Declaration} decl + * @param {Result} result + * @return {void} + */ +exports.warnIfGridRowColumnExists = warnIfGridRowColumnExists + +function warnIfGridRowColumnExists(decl, result) { + let rule = decl.parent + let decls = [] + rule.walkDecls(/^grid-(row|column)/, d => { + if ( + !d.prop.endsWith('-end') && + !d.value.startsWith('span') && + !d.prop.endsWith('-gap') + ) { + decls.push(d) + } + }) + if (decls.length > 0) { + decls.forEach(d => { + d.warn( + result, + 'You already have a grid-area declaration present in the rule. ' + + `You should use either grid-area or ${d.prop}, not both` + ) + }) + } + + return undefined +} + +// Gap utils + +exports.getGridGap = getGridGap + +function getGridGap(decl) { + let gap = {} + + // try to find gap + let testGap = /^(grid-)?((row|column)-)?gap$/ + decl.parent.walkDecls(testGap, ({ prop, value }) => { + if (/^(grid-)?gap$/.test(prop)) { + let [row, , column] = parser(value).nodes + + gap.row = row && parser.stringify(row) + gap.column = column ? parser.stringify(column) : gap.row + } + if (/^(grid-)?row-gap$/.test(prop)) gap.row = value + if (/^(grid-)?column-gap$/.test(prop)) gap.column = value + }) + + return gap +} + +/** + * parse media parameters (for example 'min-width: 500px') + * @param {String} params parameter to parse + * @return {} + */ +function parseMediaParams(params) { + if (!params) { + return [] + } + let parsed = parser(params) + let prop + let value + + parsed.walk(node => { + if (node.type === 'word' && /min|max/g.test(node.value)) { + prop = node.value + } else if (node.value.includes('px')) { + value = parseInt(node.value.replace(/\D/g, '')) + } + }) + + return [prop, value] +} + +/** + * Compare the selectors and decide if we + * need to inherit gap from compared selector or not. + * @type {String} selA + * @type {String} selB + * @return {Boolean} + */ +function shouldInheritGap(selA, selB) { + let result + + // get arrays of selector split in 3-deep array + let splitSelectorArrA = splitSelector(selA) + let splitSelectorArrB = splitSelector(selB) + + if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) { + // abort if selectorA has lower descendant specificity then selectorB + // (e.g '.grid' and '.hello .world .grid') + return false + } else if (splitSelectorArrA[0].length > splitSelectorArrB[0].length) { + // if selectorA has higher descendant specificity then selectorB + // (e.g '.foo .bar .grid' and '.grid') + + let idx = splitSelectorArrA[0].reduce((res, [item], index) => { + let firstSelectorPart = splitSelectorArrB[0][0][0] + if (item === firstSelectorPart) { + return index + } + return false + }, false) + + if (idx) { + result = splitSelectorArrB[0].every((arr, index) => { + return arr.every( + (part, innerIndex) => + // because selectorA has more space elements, we need to slice + // selectorA array by 'idx' number to compare them + splitSelectorArrA[0].slice(idx)[index][innerIndex] === part + ) + }) + } + } else { + // if selectorA has the same descendant specificity as selectorB + // this condition covers cases such as: '.grid.foo.bar' and '.grid' + result = splitSelectorArrB.some(byCommaArr => { + return byCommaArr.every((bySpaceArr, index) => { + return bySpaceArr.every( + (part, innerIndex) => splitSelectorArrA[0][index][innerIndex] === part + ) + }) + }) + } + + return result +} +/** + * inherit grid gap values from the closest rule above + * with the same selector + * @param {Declaration} decl + * @param {Object} gap gap values + * @return {Object | Boolean} return gap values or false (if not found) + */ +exports.inheritGridGap = inheritGridGap + +function inheritGridGap(decl, gap) { + let rule = decl.parent + let mediaRule = getParentMedia(rule) + let root = rule.root() + + // get an array of selector split in 3-deep array + let splitSelectorArr = splitSelector(rule.selector) + + // abort if the rule already has gaps + if (Object.keys(gap).length > 0) { + return false + } + + // e.g ['min-width'] + let [prop] = parseMediaParams(mediaRule.params) + + let lastBySpace = splitSelectorArr[0] + + // get escaped value from the selector + // if we have '.grid-2.foo.bar' selector, will be '\.grid\-2' + let escaped = escapeRegexp(lastBySpace[lastBySpace.length - 1][0]) + + let regexp = new RegExp(`(${escaped}$)|(${escaped}[,.])`) + + // find the closest rule with the same selector + let closestRuleGap + root.walkRules(regexp, r => { + let gridGap + + // abort if are checking the same rule + if (rule.toString() === r.toString()) { + return false + } + + // find grid-gap values + r.walkDecls('grid-gap', d => (gridGap = getGridGap(d))) + + // skip rule without gaps + if (!gridGap || Object.keys(gridGap).length === 0) { + return true + } + + // skip rules that should not be inherited from + if (!shouldInheritGap(rule.selector, r.selector)) { + return true + } + + let media = getParentMedia(r) + if (media) { + // if we are inside media, we need to check that media props match + // e.g ('min-width' === 'min-width') + let propToCompare = parseMediaParams(media.params)[0] + if (propToCompare === prop) { + closestRuleGap = gridGap + return true + } + } else { + closestRuleGap = gridGap + return true + } + + return undefined + }) + + // if we find the closest gap object + if (closestRuleGap && Object.keys(closestRuleGap).length > 0) { + return closestRuleGap + } + return false +} + +exports.warnGridGap = warnGridGap + +function warnGridGap({ decl, gap, hasColumns, result }) { + let hasBothGaps = gap.row && gap.column + if (!hasColumns && (hasBothGaps || (gap.column && !gap.row))) { + delete gap.column + decl.warn( + result, + 'Can not implement grid-gap without grid-template-columns' + ) + } +} + +/** + * normalize the grid-template-rows/columns values + * @param {String} str grid-template-rows/columns value + * @return {Array} normalized array with values + * @example + * let normalized = normalizeRowColumn('1fr repeat(2, 20px 50px) 1fr') + * normalized // <= ['1fr', '20px', '50px', '20px', '50px', '1fr'] + */ +function normalizeRowColumn(str) { + let normalized = parser(str).nodes.reduce((result, node) => { + if (node.type === 'function' && node.value === 'repeat') { + let key = 'count' + + let [count, value] = node.nodes.reduce( + (acc, n) => { + if (n.type === 'word' && key === 'count') { + acc[0] = Math.abs(parseInt(n.value)) + return acc + } + if (n.type === 'div' && n.value === ',') { + key = 'value' + return acc + } + if (key === 'value') { + acc[1] += parser.stringify(n) + } + return acc + }, + [0, ''] + ) + + if (count) { + for (let i = 0; i < count; i++) { + result.push(value) + } + } + + return result + } + if (node.type === 'space') { + return result + } + result.push(parser.stringify(node)) + return result + }, []) + + return normalized +} + +exports.autoplaceGridItems = autoplaceGridItems + +/** + * Autoplace grid items + * @param {Declaration} decl + * @param {Result} result + * @param {Object} gap gap values + * @param {String} autoflowValue grid-auto-flow value + * @return {void} + * @see https://github.com/postcss/autoprefixer/issues/1148 + */ +function autoplaceGridItems(decl, result, gap, autoflowValue = 'row') { + let { parent } = decl + + let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows') + let rows = normalizeRowColumn(rowDecl.value) + let columns = normalizeRowColumn(decl.value) + + // Build array of area names with dummy values. If we have 3 columns and + // 2 rows, filledRows will be equal to ['1 2 3', '4 5 6'] + let filledRows = rows.map((_, rowIndex) => { + return Array.from( + { length: columns.length }, + (v, k) => k + rowIndex * columns.length + 1 + ).join(' ') + }) + + let areas = parseGridAreas({ gap, rows: filledRows }) + let keys = Object.keys(areas) + let items = keys.map(i => areas[i]) + + // Change the order of cells if grid-auto-flow value is 'column' + if (autoflowValue.includes('column')) { + items = items.sort((a, b) => a.column.start - b.column.start) + } + + // Insert new rules + items.reverse().forEach((item, index) => { + let { column, row } = item + let nodeSelector = parent.selectors + .map(sel => sel + ` > *:nth-child(${keys.length - index})`) + .join(', ') + + // create new rule + let node = parent.clone().removeAll() + + // change rule selector + node.selector = nodeSelector + + // insert prefixed row/column values + node.append({ prop: '-ms-grid-row', value: row.start }) + node.append({ prop: '-ms-grid-column', value: column.start }) + + // insert rule + parent.after(node) + }) + + return undefined +} diff --git a/node_modules/autoprefixer/lib/hacks/image-rendering.js b/node_modules/autoprefixer/lib/hacks/image-rendering.js new file mode 100644 index 0000000000000000000000000000000000000000..38b571bc0825ca00e612ed6cc0e4752434638468 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/image-rendering.js @@ -0,0 +1,48 @@ +let Declaration = require('../declaration') + +class ImageRendering extends Declaration { + /** + * Add hack only for crisp-edges + */ + check(decl) { + return decl.value === 'pixelated' + } + + /** + * Return property name by spec + */ + normalize() { + return 'image-rendering' + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + if (prefix === '-ms-') { + return '-ms-interpolation-mode' + } + return super.prefixed(prop, prefix) + } + + /** + * Warn on old value + */ + process(node, result) { + return super.process(node, result) + } + + /** + * Change property and value for IE + */ + set(decl, prefix) { + if (prefix !== '-ms-') return super.set(decl, prefix) + decl.prop = '-ms-interpolation-mode' + decl.value = 'nearest-neighbor' + return decl + } +} + +ImageRendering.names = ['image-rendering', 'interpolation-mode'] + +module.exports = ImageRendering diff --git a/node_modules/autoprefixer/lib/hacks/image-set.js b/node_modules/autoprefixer/lib/hacks/image-set.js new file mode 100644 index 0000000000000000000000000000000000000000..fecd0889fff0c817f7aeaa151c6a3221366ef9e7 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/image-set.js @@ -0,0 +1,18 @@ +let Value = require('../value') + +class ImageSet extends Value { + /** + * Use non-standard name for WebKit and Firefox + */ + replace(string, prefix) { + let fixed = super.replace(string, prefix) + if (prefix === '-webkit-') { + fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2') + } + return fixed + } +} + +ImageSet.names = ['image-set'] + +module.exports = ImageSet diff --git a/node_modules/autoprefixer/lib/hacks/inline-logical.js b/node_modules/autoprefixer/lib/hacks/inline-logical.js new file mode 100644 index 0000000000000000000000000000000000000000..31dc9687639c15f8f728a820cbd9dd12a4da94c0 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/inline-logical.js @@ -0,0 +1,34 @@ +let Declaration = require('../declaration') + +class InlineLogical extends Declaration { + /** + * Return property name by spec + */ + normalize(prop) { + return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2') + } + + /** + * Use old syntax for -moz- and -webkit- + */ + prefixed(prop, prefix) { + return prefix + prop.replace('-inline', '') + } +} + +InlineLogical.names = [ + 'border-inline-start', + 'border-inline-end', + 'margin-inline-start', + 'margin-inline-end', + 'padding-inline-start', + 'padding-inline-end', + 'border-start', + 'border-end', + 'margin-start', + 'margin-end', + 'padding-start', + 'padding-end' +] + +module.exports = InlineLogical diff --git a/node_modules/autoprefixer/lib/hacks/intrinsic.js b/node_modules/autoprefixer/lib/hacks/intrinsic.js new file mode 100644 index 0000000000000000000000000000000000000000..a709095012c498f82bb5c5bedbbe3d918a59af60 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/intrinsic.js @@ -0,0 +1,70 @@ +let OldValue = require('../old-value') +let Value = require('../value') + +function regexp(name) { + return new RegExp(`(^|[\\s,(])(${name}($|[\\s),]))`, 'gi') +} + +class Intrinsic extends Value { + constructor(name, prefixes, all) { + super(name, prefixes, all) + if (this.isStretch() && prefixes.includes('-moz-')) { + // Generate -moz-available before -webkit-fill-available + // since -webkit-fill-available is closer to spec and FF supports both + this.prefixes = ['-moz-'].concat(prefixes.filter(i => i !== '-moz-')) + } + } + + add(decl, prefix) { + if (decl.prop.includes('grid') && prefix !== '-webkit-') { + return undefined + } + return super.add(decl, prefix) + } + + isStretch() { + return ( + this.name === 'stretch' || + this.name === 'fill' || + this.name === 'fill-available' + ) + } + + old(prefix) { + let prefixed = prefix + this.name + if (this.isStretch()) { + if (prefix === '-moz-') { + prefixed = '-moz-available' + } else if (prefix === '-webkit-') { + prefixed = '-webkit-fill-available' + } + } + return new OldValue(this.name, prefixed, prefixed, regexp(prefixed)) + } + + regexp() { + if (!this.regexpCache) this.regexpCache = regexp(this.name) + return this.regexpCache + } + + replace(string, prefix) { + if (prefix === '-moz-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-moz-available$3') + } + if (prefix === '-webkit-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-webkit-fill-available$3') + } + return super.replace(string, prefix) + } +} + +Intrinsic.names = [ + 'max-content', + 'min-content', + 'fit-content', + 'fill', + 'fill-available', + 'stretch' +] + +module.exports = Intrinsic diff --git a/node_modules/autoprefixer/lib/hacks/justify-content.js b/node_modules/autoprefixer/lib/hacks/justify-content.js new file mode 100644 index 0000000000000000000000000000000000000000..fd954baa93a0be120e3015016bd60f7e674bb5e3 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/justify-content.js @@ -0,0 +1,54 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class JustifyContent extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'justify-content' + } + + /** + * Change property name for 2009 and 2012 specs + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return prefix + 'box-pack' + } + if (spec === 2012) { + return prefix + 'flex-pack' + } + return super.prefixed(prop, prefix) + } + + /** + * Change value for 2009 and 2012 specs + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2009 || spec === 2012) { + let value = JustifyContent.oldValues[decl.value] || decl.value + decl.value = value + if (spec !== 2009 || value !== 'distribute') { + return super.set(decl, prefix) + } + } else if (spec === 'final') { + return super.set(decl, prefix) + } + return undefined + } +} + +JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack'] + +JustifyContent.oldValues = { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-around': 'distribute', + 'space-between': 'justify' +} + +module.exports = JustifyContent diff --git a/node_modules/autoprefixer/lib/hacks/mask-border.js b/node_modules/autoprefixer/lib/hacks/mask-border.js new file mode 100644 index 0000000000000000000000000000000000000000..d5efde23ec146d7ddfb9e00cff01b4000cd7844b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/mask-border.js @@ -0,0 +1,38 @@ +let Declaration = require('../declaration') + +class MaskBorder extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return this.name.replace('box-image', 'border') + } + + /** + * Return flex property for 2012 spec + */ + prefixed(prop, prefix) { + let result = super.prefixed(prop, prefix) + if (prefix === '-webkit-') { + result = result.replace('border', 'box-image') + } + return result + } +} + +MaskBorder.names = [ + 'mask-border', + 'mask-border-source', + 'mask-border-slice', + 'mask-border-width', + 'mask-border-outset', + 'mask-border-repeat', + 'mask-box-image', + 'mask-box-image-source', + 'mask-box-image-slice', + 'mask-box-image-width', + 'mask-box-image-outset', + 'mask-box-image-repeat' +] + +module.exports = MaskBorder diff --git a/node_modules/autoprefixer/lib/hacks/mask-composite.js b/node_modules/autoprefixer/lib/hacks/mask-composite.js new file mode 100644 index 0000000000000000000000000000000000000000..a30df13c2d87ee68fad06d5f996d469f6701ee73 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/mask-composite.js @@ -0,0 +1,88 @@ +let Declaration = require('../declaration') + +class MaskComposite extends Declaration { + /** + * Prefix mask-composite for webkit + */ + insert(decl, prefix, prefixes) { + let isCompositeProp = decl.prop === 'mask-composite' + + let compositeValues + + if (isCompositeProp) { + compositeValues = decl.value.split(',') + } else { + compositeValues = decl.value.match(MaskComposite.regexp) || [] + } + + compositeValues = compositeValues.map(el => el.trim()).filter(el => el) + let hasCompositeValues = compositeValues.length + + let compositeDecl + + if (hasCompositeValues) { + compositeDecl = this.clone(decl) + compositeDecl.value = compositeValues + .map(value => MaskComposite.oldValues[value] || value) + .join(', ') + + if (compositeValues.includes('intersect')) { + compositeDecl.value += ', xor' + } + + compositeDecl.prop = prefix + 'mask-composite' + } + + if (isCompositeProp) { + if (!hasCompositeValues) { + return undefined + } + + if (this.needCascade(decl)) { + compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix) + } + + return decl.parent.insertBefore(decl, compositeDecl) + } + + let cloned = this.clone(decl) + cloned.prop = prefix + cloned.prop + + if (hasCompositeValues) { + cloned.value = cloned.value.replace(MaskComposite.regexp, '') + } + + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + + decl.parent.insertBefore(decl, cloned) + + if (!hasCompositeValues) { + return decl + } + + if (this.needCascade(decl)) { + compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix) + } + return decl.parent.insertBefore(decl, compositeDecl) + } +} + +MaskComposite.names = ['mask', 'mask-composite'] + +MaskComposite.oldValues = { + add: 'source-over', + exclude: 'xor', + intersect: 'source-in', + subtract: 'source-out' +} + +MaskComposite.regexp = new RegExp( + `\\s+(${Object.keys(MaskComposite.oldValues).join( + '|' + )})\\b(?!\\))\\s*(?=[,])`, + 'ig' +) + +module.exports = MaskComposite diff --git a/node_modules/autoprefixer/lib/hacks/order.js b/node_modules/autoprefixer/lib/hacks/order.js new file mode 100644 index 0000000000000000000000000000000000000000..d507afee8628f250d3df0b21a57ee2f9ef3f4165 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/order.js @@ -0,0 +1,42 @@ +let Declaration = require('../declaration') +let flexSpec = require('./flex-spec') + +class Order extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'order' + } + + /** + * Change property name for 2009 and 2012 specs + */ + prefixed(prop, prefix) { + let spec + ;[spec, prefix] = flexSpec(prefix) + if (spec === 2009) { + return prefix + 'box-ordinal-group' + } + if (spec === 2012) { + return prefix + 'flex-order' + } + return super.prefixed(prop, prefix) + } + + /** + * Fix value for 2009 spec + */ + set(decl, prefix) { + let spec = flexSpec(prefix)[0] + if (spec === 2009 && /\d/.test(decl.value)) { + decl.value = (parseInt(decl.value) + 1).toString() + return super.set(decl, prefix) + } + return super.set(decl, prefix) + } +} + +Order.names = ['order', 'flex-order', 'box-ordinal-group'] + +module.exports = Order diff --git a/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js b/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js new file mode 100644 index 0000000000000000000000000000000000000000..03bd7d45e0674e8d640907ab081493a829f241f8 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/overscroll-behavior.js @@ -0,0 +1,33 @@ +let Declaration = require('../declaration') + +class OverscrollBehavior extends Declaration { + /** + * Return property name by spec + */ + normalize() { + return 'overscroll-behavior' + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + return prefix + 'scroll-chaining' + } + + /** + * Change value for IE + */ + set(decl, prefix) { + if (decl.value === 'auto') { + decl.value = 'chained' + } else if (decl.value === 'none' || decl.value === 'contain') { + decl.value = 'none' + } + return super.set(decl, prefix) + } +} + +OverscrollBehavior.names = ['overscroll-behavior', 'scroll-chaining'] + +module.exports = OverscrollBehavior diff --git a/node_modules/autoprefixer/lib/hacks/pixelated.js b/node_modules/autoprefixer/lib/hacks/pixelated.js new file mode 100644 index 0000000000000000000000000000000000000000..6084826dddaa0c410d2fe93ed3d6bc6427e97d54 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/pixelated.js @@ -0,0 +1,34 @@ +let OldValue = require('../old-value') +let Value = require('../value') + +class Pixelated extends Value { + /** + * Different name for WebKit and Firefox + */ + old(prefix) { + if (prefix === '-webkit-') { + return new OldValue(this.name, '-webkit-optimize-contrast') + } + if (prefix === '-moz-') { + return new OldValue(this.name, '-moz-crisp-edges') + } + return super.old(prefix) + } + + /** + * Use non-standard name for WebKit and Firefox + */ + replace(string, prefix) { + if (prefix === '-webkit-') { + return string.replace(this.regexp(), '$1-webkit-optimize-contrast') + } + if (prefix === '-moz-') { + return string.replace(this.regexp(), '$1-moz-crisp-edges') + } + return super.replace(string, prefix) + } +} + +Pixelated.names = ['pixelated'] + +module.exports = Pixelated diff --git a/node_modules/autoprefixer/lib/hacks/place-self.js b/node_modules/autoprefixer/lib/hacks/place-self.js new file mode 100644 index 0000000000000000000000000000000000000000..e0ce3e8ce94ded1a812f4864c81b5101214016af --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/place-self.js @@ -0,0 +1,32 @@ +let Declaration = require('../declaration') +let utils = require('./grid-utils') + +class PlaceSelf extends Declaration { + /** + * Translate place-self to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + // prevent doubling of prefixes + if (decl.parent.some(i => i.prop === '-ms-grid-row-align')) { + return undefined + } + + let [[first, second]] = utils.parse(decl) + + if (second) { + utils.insertDecl(decl, 'grid-row-align', first) + utils.insertDecl(decl, 'grid-column-align', second) + } else { + utils.insertDecl(decl, 'grid-row-align', first) + utils.insertDecl(decl, 'grid-column-align', first) + } + + return undefined + } +} + +PlaceSelf.names = ['place-self'] + +module.exports = PlaceSelf diff --git a/node_modules/autoprefixer/lib/hacks/placeholder-shown.js b/node_modules/autoprefixer/lib/hacks/placeholder-shown.js new file mode 100644 index 0000000000000000000000000000000000000000..c29525ee24c8d40ab3ed1fb976454cc6599a6036 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/placeholder-shown.js @@ -0,0 +1,19 @@ +let Selector = require('../selector') + +class PlaceholderShown extends Selector { + /** + * Return different selectors depend on prefix + */ + prefixed(prefix) { + if (prefix === '-moz-') { + return ':-moz-placeholder' + } else if (prefix === '-ms-') { + return ':-ms-input-placeholder' + } + return `:${prefix}placeholder-shown` + } +} + +PlaceholderShown.names = [':placeholder-shown'] + +module.exports = PlaceholderShown diff --git a/node_modules/autoprefixer/lib/hacks/placeholder.js b/node_modules/autoprefixer/lib/hacks/placeholder.js new file mode 100644 index 0000000000000000000000000000000000000000..45730a5106e12f9dd5f95fdc40c38689a7069d09 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/placeholder.js @@ -0,0 +1,33 @@ +let Selector = require('../selector') + +class Placeholder extends Selector { + /** + * Add old mozilla to possible prefixes + */ + possible() { + return super.possible().concat(['-moz- old', '-ms- old']) + } + + /** + * Return different selectors depend on prefix + */ + prefixed(prefix) { + if (prefix === '-webkit-') { + return '::-webkit-input-placeholder' + } + if (prefix === '-ms-') { + return '::-ms-input-placeholder' + } + if (prefix === '-ms- old') { + return ':-ms-input-placeholder' + } + if (prefix === '-moz- old') { + return ':-moz-placeholder' + } + return `::${prefix}placeholder` + } +} + +Placeholder.names = ['::placeholder'] + +module.exports = Placeholder diff --git a/node_modules/autoprefixer/lib/hacks/print-color-adjust.js b/node_modules/autoprefixer/lib/hacks/print-color-adjust.js new file mode 100644 index 0000000000000000000000000000000000000000..6526a8e31593ec5c43a6e440c0da77a2296174f2 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/print-color-adjust.js @@ -0,0 +1,25 @@ +let Declaration = require('../declaration') + +class PrintColorAdjust extends Declaration { + /** + * Return property name by spec + */ + normalize() { + return 'print-color-adjust' + } + + /** + * Change property name for WebKit-based browsers + */ + prefixed(prop, prefix) { + if (prefix === '-moz-') { + return 'color-adjust' + } else { + return prefix + 'print-color-adjust' + } + } +} + +PrintColorAdjust.names = ['print-color-adjust', 'color-adjust'] + +module.exports = PrintColorAdjust diff --git a/node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js b/node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js new file mode 100644 index 0000000000000000000000000000000000000000..25dc4dbe42d4c6e07a55a9c8e059ecf64911ac6b --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/text-decoration-skip-ink.js @@ -0,0 +1,23 @@ +let Declaration = require('../declaration') + +class TextDecorationSkipInk extends Declaration { + /** + * Change prefix for ink value + */ + set(decl, prefix) { + if (decl.prop === 'text-decoration-skip-ink' && decl.value === 'auto') { + decl.prop = prefix + 'text-decoration-skip' + decl.value = 'ink' + return decl + } else { + return super.set(decl, prefix) + } + } +} + +TextDecorationSkipInk.names = [ + 'text-decoration-skip-ink', + 'text-decoration-skip' +] + +module.exports = TextDecorationSkipInk diff --git a/node_modules/autoprefixer/lib/hacks/text-decoration.js b/node_modules/autoprefixer/lib/hacks/text-decoration.js new file mode 100644 index 0000000000000000000000000000000000000000..148d98a1906ba4975f81e32bd058b6d06db300bd --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/text-decoration.js @@ -0,0 +1,25 @@ +let Declaration = require('../declaration') + +const BASIC = [ + 'none', + 'underline', + 'overline', + 'line-through', + 'blink', + 'inherit', + 'initial', + 'unset' +] + +class TextDecoration extends Declaration { + /** + * Do not add prefixes for basic values. + */ + check(decl) { + return decl.value.split(/\s+/).some(i => !BASIC.includes(i)) + } +} + +TextDecoration.names = ['text-decoration'] + +module.exports = TextDecoration diff --git a/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js b/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js new file mode 100644 index 0000000000000000000000000000000000000000..0d04f8bba7bab47ca5374ff68641d07e3a2fc450 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js @@ -0,0 +1,14 @@ +let Declaration = require('../declaration') + +class TextEmphasisPosition extends Declaration { + set(decl, prefix) { + if (prefix === '-webkit-') { + decl.value = decl.value.replace(/\s*(right|left)\s*/i, '') + } + return super.set(decl, prefix) + } +} + +TextEmphasisPosition.names = ['text-emphasis-position'] + +module.exports = TextEmphasisPosition diff --git a/node_modules/autoprefixer/lib/hacks/transform-decl.js b/node_modules/autoprefixer/lib/hacks/transform-decl.js new file mode 100644 index 0000000000000000000000000000000000000000..cecd06d8906cb873b115c3ed453dfa8d2f8fa167 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/transform-decl.js @@ -0,0 +1,79 @@ +let Declaration = require('../declaration') + +class TransformDecl extends Declaration { + /** + * Is transform contain 3D commands + */ + contain3d(decl) { + if (decl.prop === 'transform-origin') { + return false + } + + for (let func of TransformDecl.functions3d) { + if (decl.value.includes(`${func}(`)) { + return true + } + } + + return false + } + + /** + * Don't add prefix for IE in keyframes + */ + insert(decl, prefix, prefixes) { + if (prefix === '-ms-') { + if (!this.contain3d(decl) && !this.keyframeParents(decl)) { + return super.insert(decl, prefix, prefixes) + } + } else if (prefix === '-o-') { + if (!this.contain3d(decl)) { + return super.insert(decl, prefix, prefixes) + } + } else { + return super.insert(decl, prefix, prefixes) + } + return undefined + } + + /** + * Recursively check all parents for @keyframes + */ + keyframeParents(decl) { + let { parent } = decl + while (parent) { + if (parent.type === 'atrule' && parent.name === 'keyframes') { + return true + } + ;({ parent } = parent) + } + return false + } + + /** + * Replace rotateZ to rotate for IE 9 + */ + set(decl, prefix) { + decl = super.set(decl, prefix) + if (prefix === '-ms-') { + decl.value = decl.value.replace(/rotatez/gi, 'rotate') + } + return decl + } +} + +TransformDecl.names = ['transform', 'transform-origin'] + +TransformDecl.functions3d = [ + 'matrix3d', + 'translate3d', + 'translateZ', + 'scale3d', + 'scaleZ', + 'rotate3d', + 'rotateX', + 'rotateY', + 'perspective' +] + +module.exports = TransformDecl diff --git a/node_modules/autoprefixer/lib/hacks/user-select.js b/node_modules/autoprefixer/lib/hacks/user-select.js new file mode 100644 index 0000000000000000000000000000000000000000..f73831d2ae815430ddcf54eca3ae28f399b8969f --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/user-select.js @@ -0,0 +1,33 @@ +let Declaration = require('../declaration') + +class UserSelect extends Declaration { + /** + * Avoid prefixing all in IE + */ + insert(decl, prefix, prefixes) { + if (decl.value === 'all' && prefix === '-ms-') { + return undefined + } else if ( + decl.value === 'contain' && + (prefix === '-moz-' || prefix === '-webkit-') + ) { + return undefined + } else { + return super.insert(decl, prefix, prefixes) + } + } + + /** + * Change prefixed value for IE + */ + set(decl, prefix) { + if (prefix === '-ms-' && decl.value === 'contain') { + decl.value = 'element' + } + return super.set(decl, prefix) + } +} + +UserSelect.names = ['user-select'] + +module.exports = UserSelect diff --git a/node_modules/autoprefixer/lib/hacks/writing-mode.js b/node_modules/autoprefixer/lib/hacks/writing-mode.js new file mode 100644 index 0000000000000000000000000000000000000000..71c8eeb1b5d2f205c899ff75634b7e9d4d8f4946 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/writing-mode.js @@ -0,0 +1,42 @@ +let Declaration = require('../declaration') + +class WritingMode extends Declaration { + insert(decl, prefix, prefixes) { + if (prefix === '-ms-') { + let cloned = this.set(this.clone(decl), prefix) + + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + let direction = 'ltr' + + decl.parent.nodes.forEach(i => { + if (i.prop === 'direction') { + if (i.value === 'rtl' || i.value === 'ltr') direction = i.value + } + }) + + cloned.value = WritingMode.msValues[direction][decl.value] || decl.value + return decl.parent.insertBefore(decl, cloned) + } + + return super.insert(decl, prefix, prefixes) + } +} + +WritingMode.names = ['writing-mode'] + +WritingMode.msValues = { + ltr: { + 'horizontal-tb': 'lr-tb', + 'vertical-lr': 'tb-lr', + 'vertical-rl': 'tb-rl' + }, + rtl: { + 'horizontal-tb': 'rl-tb', + 'vertical-lr': 'bt-lr', + 'vertical-rl': 'bt-rl' + } +} + +module.exports = WritingMode diff --git a/node_modules/autoprefixer/lib/info.js b/node_modules/autoprefixer/lib/info.js new file mode 100644 index 0000000000000000000000000000000000000000..a313486196496825f2b9085087bc4dd18174e99a --- /dev/null +++ b/node_modules/autoprefixer/lib/info.js @@ -0,0 +1,123 @@ +let browserslist = require('browserslist') + +function capitalize(str) { + return str.slice(0, 1).toUpperCase() + str.slice(1) +} + +const NAMES = { + and_chr: 'Chrome for Android', + and_ff: 'Firefox for Android', + and_qq: 'QQ Browser', + and_uc: 'UC for Android', + baidu: 'Baidu Browser', + ie: 'IE', + ie_mob: 'IE Mobile', + ios_saf: 'iOS Safari', + kaios: 'KaiOS Browser', + op_mini: 'Opera Mini', + op_mob: 'Opera Mobile', + samsung: 'Samsung Internet' +} + +function prefix(name, prefixes, note) { + let out = ` ${name}` + if (note) out += ' *' + out += ': ' + out += prefixes.map(i => i.replace(/^-(.*)-$/g, '$1')).join(', ') + out += '\n' + return out +} + +module.exports = function (prefixes) { + if (prefixes.browsers.selected.length === 0) { + return 'No browsers selected' + } + + let versions = {} + for (let browser of prefixes.browsers.selected) { + let parts = browser.split(' ') + let name = parts[0] + let version = parts[1] + + name = NAMES[name] || capitalize(name) + if (versions[name]) { + versions[name].push(version) + } else { + versions[name] = [version] + } + } + + let out = 'Browsers:\n' + for (let browser in versions) { + let list = versions[browser] + list = list.sort((a, b) => parseFloat(b) - parseFloat(a)) + out += ` ${browser}: ${list.join(', ')}\n` + } + + let coverage = browserslist.coverage(prefixes.browsers.selected) + let round = Math.round(coverage * 100) / 100.0 + out += `\nThese browsers account for ${round}% of all users globally\n` + + let atrules = [] + for (let name in prefixes.add) { + let data = prefixes.add[name] + if (name[0] === '@' && data.prefixes) { + atrules.push(prefix(name, data.prefixes)) + } + } + if (atrules.length > 0) { + out += `\nAt-Rules:\n${atrules.sort().join('')}` + } + + let selectors = [] + for (let selector of prefixes.add.selectors) { + if (selector.prefixes) { + selectors.push(prefix(selector.name, selector.prefixes)) + } + } + if (selectors.length > 0) { + out += `\nSelectors:\n${selectors.sort().join('')}` + } + + let values = [] + let props = [] + let hadGrid = false + for (let name in prefixes.add) { + let data = prefixes.add[name] + if (name[0] !== '@' && data.prefixes) { + let grid = name.indexOf('grid-') === 0 + if (grid) hadGrid = true + props.push(prefix(name, data.prefixes, grid)) + } + + if (!Array.isArray(data.values)) { + continue + } + for (let value of data.values) { + let grid = value.name.includes('grid') + if (grid) hadGrid = true + let string = prefix(value.name, value.prefixes, grid) + if (!values.includes(string)) { + values.push(string) + } + } + } + + if (props.length > 0) { + out += `\nProperties:\n${props.sort().join('')}` + } + if (values.length > 0) { + out += `\nValues:\n${values.sort().join('')}` + } + if (hadGrid) { + out += '\n* - Prefixes will be added only on grid: true option.\n' + } + + if (!atrules.length && !selectors.length && !props.length && !values.length) { + out += + "\nAwesome! Your browsers don't require any vendor prefixes." + + '\nNow you can remove Autoprefixer from build steps.' + } + + return out +} diff --git a/node_modules/autoprefixer/lib/old-selector.js b/node_modules/autoprefixer/lib/old-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..ca98d07a5121bd27849fd57665474b1db247c693 --- /dev/null +++ b/node_modules/autoprefixer/lib/old-selector.js @@ -0,0 +1,67 @@ +class OldSelector { + constructor(selector, prefix) { + this.prefix = prefix + this.prefixed = selector.prefixed(this.prefix) + this.regexp = selector.regexp(this.prefix) + + this.prefixeds = selector + .possible() + .map(x => [selector.prefixed(x), selector.regexp(x)]) + + this.unprefixed = selector.name + this.nameRegexp = selector.regexp() + } + + /** + * Does rule contain an unnecessary prefixed selector + */ + check(rule) { + if (!rule.selector.includes(this.prefixed)) { + return false + } + if (!rule.selector.match(this.regexp)) { + return false + } + if (this.isHack(rule)) { + return false + } + return true + } + + /** + * Is rule a hack without unprefixed version bottom + */ + isHack(rule) { + let index = rule.parent.index(rule) + 1 + let rules = rule.parent.nodes + + while (index < rules.length) { + let before = rules[index].selector + if (!before) { + return true + } + + if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) { + return false + } + + let some = false + for (let [string, regexp] of this.prefixeds) { + if (before.includes(string) && before.match(regexp)) { + some = true + break + } + } + + if (!some) { + return true + } + + index += 1 + } + + return true + } +} + +module.exports = OldSelector diff --git a/node_modules/autoprefixer/lib/old-value.js b/node_modules/autoprefixer/lib/old-value.js new file mode 100644 index 0000000000000000000000000000000000000000..63a2643864e4f6304de24f77624cbdff24974cf9 --- /dev/null +++ b/node_modules/autoprefixer/lib/old-value.js @@ -0,0 +1,22 @@ +let utils = require('./utils') + +class OldValue { + constructor(unprefixed, prefixed, string, regexp) { + this.unprefixed = unprefixed + this.prefixed = prefixed + this.string = string || prefixed + this.regexp = regexp || utils.regexp(prefixed) + } + + /** + * Check, that value contain old value + */ + check(value) { + if (value.includes(this.string)) { + return !!value.match(this.regexp) + } + return false + } +} + +module.exports = OldValue diff --git a/node_modules/autoprefixer/lib/prefixer.js b/node_modules/autoprefixer/lib/prefixer.js new file mode 100644 index 0000000000000000000000000000000000000000..ba9e4c1328da2dd19bfcab86cd5cda73e0f5f4ac --- /dev/null +++ b/node_modules/autoprefixer/lib/prefixer.js @@ -0,0 +1,144 @@ +let Browsers = require('./browsers') +let utils = require('./utils') +let vendor = require('./vendor') + +/** + * Recursively clone objects + */ +function clone(obj, parent) { + let cloned = new obj.constructor() + + for (let i of Object.keys(obj || {})) { + let value = obj[i] + if (i === 'parent' && typeof value === 'object') { + if (parent) { + cloned[i] = parent + } + } else if (i === 'source' || i === null) { + cloned[i] = value + } else if (Array.isArray(value)) { + cloned[i] = value.map(x => clone(x, cloned)) + } else if ( + i !== '_autoprefixerPrefix' && + i !== '_autoprefixerValues' && + i !== 'proxyCache' + ) { + if (typeof value === 'object' && value !== null) { + value = clone(value, cloned) + } + cloned[i] = value + } + } + + return cloned +} + +class Prefixer { + constructor(name, prefixes, all) { + this.prefixes = prefixes + this.name = name + this.all = all + } + + /** + * Clone node and clean autprefixer custom caches + */ + static clone(node, overrides) { + let cloned = clone(node) + for (let name in overrides) { + cloned[name] = overrides[name] + } + return cloned + } + + /** + * Add hack to selected names + */ + static hack(klass) { + if (!this.hacks) { + this.hacks = {} + } + return klass.names.map(name => { + this.hacks[name] = klass + return this.hacks[name] + }) + } + + /** + * Load hacks for some names + */ + static load(name, prefixes, all) { + let Klass = this.hacks && this.hacks[name] + if (Klass) { + return new Klass(name, prefixes, all) + } else { + return new this(name, prefixes, all) + } + } + + /** + * Shortcut for Prefixer.clone + */ + clone(node, overrides) { + return Prefixer.clone(node, overrides) + } + + /** + * Find prefix in node parents + */ + parentPrefix(node) { + let prefix + + if (typeof node._autoprefixerPrefix !== 'undefined') { + prefix = node._autoprefixerPrefix + } else if (node.type === 'decl' && node.prop[0] === '-') { + prefix = vendor.prefix(node.prop) + } else if (node.type === 'root') { + prefix = false + } else if ( + node.type === 'rule' && + node.selector.includes(':-') && + /:(-\w+-)/.test(node.selector) + ) { + prefix = node.selector.match(/:(-\w+-)/)[1] + } else if (node.type === 'atrule' && node.name[0] === '-') { + prefix = vendor.prefix(node.name) + } else { + prefix = this.parentPrefix(node.parent) + } + + if (!Browsers.prefixes().includes(prefix)) { + prefix = false + } + + node._autoprefixerPrefix = prefix + + return node._autoprefixerPrefix + } + + /** + * Clone node with prefixes + */ + process(node, result) { + if (!this.check(node)) { + return undefined + } + + let parent = this.parentPrefix(node) + + let prefixes = this.prefixes.filter( + prefix => !parent || parent === utils.removeNote(prefix) + ) + + let added = [] + for (let prefix of prefixes) { + if (this.add(node, prefix, added.concat([prefix]), result)) { + added.push(prefix) + } + } + + return added + } +} + +module.exports = Prefixer diff --git a/node_modules/autoprefixer/lib/prefixes.js b/node_modules/autoprefixer/lib/prefixes.js new file mode 100644 index 0000000000000000000000000000000000000000..a314dba54e9444c0e35b5ad151da5ba40749b493 --- /dev/null +++ b/node_modules/autoprefixer/lib/prefixes.js @@ -0,0 +1,428 @@ +let AtRule = require('./at-rule') +let Browsers = require('./browsers') +let Declaration = require('./declaration') +let hackAlignContent = require('./hacks/align-content') +let hackAlignItems = require('./hacks/align-items') +let hackAlignSelf = require('./hacks/align-self') +let hackAnimation = require('./hacks/animation') +let hackAppearance = require('./hacks/appearance') +let hackAutofill = require('./hacks/autofill') +let hackBackdropFilter = require('./hacks/backdrop-filter') +let hackBackgroundClip = require('./hacks/background-clip') +let hackBackgroundSize = require('./hacks/background-size') +let hackBlockLogical = require('./hacks/block-logical') +let hackBorderImage = require('./hacks/border-image') +let hackBorderRadius = require('./hacks/border-radius') +let hackBreakProps = require('./hacks/break-props') +let hackCrossFade = require('./hacks/cross-fade') +let hackDisplayFlex = require('./hacks/display-flex') +let hackDisplayGrid = require('./hacks/display-grid') +let hackFileSelectorButton = require('./hacks/file-selector-button') +let hackFilter = require('./hacks/filter') +let hackFilterValue = require('./hacks/filter-value') +let hackFlex = require('./hacks/flex') +let hackFlexBasis = require('./hacks/flex-basis') +let hackFlexDirection = require('./hacks/flex-direction') +let hackFlexFlow = require('./hacks/flex-flow') +let hackFlexGrow = require('./hacks/flex-grow') +let hackFlexShrink = require('./hacks/flex-shrink') +let hackFlexWrap = require('./hacks/flex-wrap') +let hackFullscreen = require('./hacks/fullscreen') +let hackGradient = require('./hacks/gradient') +let hackGridArea = require('./hacks/grid-area') +let hackGridColumnAlign = require('./hacks/grid-column-align') +let hackGridEnd = require('./hacks/grid-end') +let hackGridRowAlign = require('./hacks/grid-row-align') +let hackGridRowColumn = require('./hacks/grid-row-column') +let hackGridRowsColumns = require('./hacks/grid-rows-columns') +let hackGridStart = require('./hacks/grid-start') +let hackGridTemplate = require('./hacks/grid-template') +let hackGridTemplateAreas = require('./hacks/grid-template-areas') +let hackImageRendering = require('./hacks/image-rendering') +let hackImageSet = require('./hacks/image-set') +let hackInlineLogical = require('./hacks/inline-logical') +let hackIntrinsic = require('./hacks/intrinsic') +let hackJustifyContent = require('./hacks/justify-content') +let hackMaskBorder = require('./hacks/mask-border') +let hackMaskComposite = require('./hacks/mask-composite') +let hackOrder = require('./hacks/order') +let hackOverscrollBehavior = require('./hacks/overscroll-behavior') +let hackPixelated = require('./hacks/pixelated') +let hackPlaceSelf = require('./hacks/place-self') +let hackPlaceholder = require('./hacks/placeholder') +let hackPlaceholderShown = require('./hacks/placeholder-shown') +let hackPrintColorAdjust = require('./hacks/print-color-adjust') +let hackTextDecoration = require('./hacks/text-decoration') +let hackTextDecorationSkipInk = require('./hacks/text-decoration-skip-ink') +let hackTextEmphasisPosition = require('./hacks/text-emphasis-position') +let hackTransformDecl = require('./hacks/transform-decl') +let hackUserSelect = require('./hacks/user-select') +let hackWritingMode = require('./hacks/writing-mode') +let Processor = require('./processor') +let Resolution = require('./resolution') +let Selector = require('./selector') +let Supports = require('./supports') +let Transition = require('./transition') +let utils = require('./utils') +let Value = require('./value') +let vendor = require('./vendor') + +Selector.hack(hackAutofill) +Selector.hack(hackFullscreen) +Selector.hack(hackPlaceholder) +Selector.hack(hackPlaceholderShown) +Selector.hack(hackFileSelectorButton) +Declaration.hack(hackFlex) +Declaration.hack(hackOrder) +Declaration.hack(hackFilter) +Declaration.hack(hackGridEnd) +Declaration.hack(hackAnimation) +Declaration.hack(hackFlexFlow) +Declaration.hack(hackFlexGrow) +Declaration.hack(hackFlexWrap) +Declaration.hack(hackGridArea) +Declaration.hack(hackPlaceSelf) +Declaration.hack(hackGridStart) +Declaration.hack(hackAlignSelf) +Declaration.hack(hackAppearance) +Declaration.hack(hackFlexBasis) +Declaration.hack(hackMaskBorder) +Declaration.hack(hackMaskComposite) +Declaration.hack(hackAlignItems) +Declaration.hack(hackUserSelect) +Declaration.hack(hackFlexShrink) +Declaration.hack(hackBreakProps) +Declaration.hack(hackWritingMode) +Declaration.hack(hackBorderImage) +Declaration.hack(hackAlignContent) +Declaration.hack(hackBorderRadius) +Declaration.hack(hackBlockLogical) +Declaration.hack(hackGridTemplate) +Declaration.hack(hackInlineLogical) +Declaration.hack(hackGridRowAlign) +Declaration.hack(hackTransformDecl) +Declaration.hack(hackFlexDirection) +Declaration.hack(hackImageRendering) +Declaration.hack(hackBackdropFilter) +Declaration.hack(hackBackgroundClip) +Declaration.hack(hackTextDecoration) +Declaration.hack(hackJustifyContent) +Declaration.hack(hackBackgroundSize) +Declaration.hack(hackGridRowColumn) +Declaration.hack(hackGridRowsColumns) +Declaration.hack(hackGridColumnAlign) +Declaration.hack(hackOverscrollBehavior) +Declaration.hack(hackGridTemplateAreas) +Declaration.hack(hackPrintColorAdjust) +Declaration.hack(hackTextEmphasisPosition) +Declaration.hack(hackTextDecorationSkipInk) +Value.hack(hackGradient) +Value.hack(hackIntrinsic) +Value.hack(hackPixelated) +Value.hack(hackImageSet) +Value.hack(hackCrossFade) +Value.hack(hackDisplayFlex) +Value.hack(hackDisplayGrid) +Value.hack(hackFilterValue) + +let declsCache = new Map() + +class Prefixes { + constructor(data, browsers, options = {}) { + this.data = data + this.browsers = browsers + this.options = options + ;[this.add, this.remove] = this.preprocess(this.select(this.data)) + this.transition = new Transition(this) + this.processor = new Processor(this) + } + + /** + * Return clone instance to remove all prefixes + */ + cleaner() { + if (this.cleanerCache) { + return this.cleanerCache + } + + if (this.browsers.selected.length) { + let empty = new Browsers(this.browsers.data, []) + this.cleanerCache = new Prefixes(this.data, empty, this.options) + } else { + return this + } + + return this.cleanerCache + } + + /** + * Declaration loader with caching + */ + decl(prop) { + if (!declsCache.has(prop)) { + declsCache.set(prop, Declaration.load(prop)) + } + + return declsCache.get(prop) + } + + /** + * Group declaration by unprefixed property to check them + */ + group(decl) { + let rule = decl.parent + let index = rule.index(decl) + let { length } = rule.nodes + let unprefixed = this.unprefixed(decl.prop) + + let checker = (step, callback) => { + index += step + while (index >= 0 && index < length) { + let other = rule.nodes[index] + if (other.type === 'decl') { + if (step === -1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break + } + } + + if (this.unprefixed(other.prop) !== unprefixed) { + break + } else if (callback(other) === true) { + return true + } + + if (step === 1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break + } + } + } + + index += step + } + return false + } + + return { + down(callback) { + return checker(1, callback) + }, + up(callback) { + return checker(-1, callback) + } + } + } + + /** + * Normalize prefix for remover + */ + normalize(prop) { + return this.decl(prop).normalize(prop) + } + + /** + * Return prefixed version of property + */ + prefixed(prop, prefix) { + prop = vendor.unprefixed(prop) + return this.decl(prop).prefixed(prop, prefix) + } + + /** + * Cache prefixes data to fast CSS processing + */ + preprocess(selected) { + let add = { + '@supports': new Supports(Prefixes, this), + 'selectors': [] + } + for (let name in selected.add) { + let prefixes = selected.add[name] + if (name === '@keyframes' || name === '@viewport') { + add[name] = new AtRule(name, prefixes, this) + } else if (name === '@resolution') { + add[name] = new Resolution(name, prefixes, this) + } else if (this.data[name].selector) { + add.selectors.push(Selector.load(name, prefixes, this)) + } else { + let props = this.data[name].props + + if (props) { + let value = Value.load(name, prefixes, this) + for (let prop of props) { + if (!add[prop]) { + add[prop] = { values: [] } + } + add[prop].values.push(value) + } + } else { + let values = (add[name] && add[name].values) || [] + add[name] = Declaration.load(name, prefixes, this) + add[name].values = values + } + } + } + + let remove = { selectors: [] } + for (let name in selected.remove) { + let prefixes = selected.remove[name] + if (this.data[name].selector) { + let selector = Selector.load(name, prefixes) + for (let prefix of prefixes) { + remove.selectors.push(selector.old(prefix)) + } + } else if (name === '@keyframes' || name === '@viewport') { + for (let prefix of prefixes) { + let prefixed = `@${prefix}${name.slice(1)}` + remove[prefixed] = { remove: true } + } + } else if (name === '@resolution') { + remove[name] = new Resolution(name, prefixes, this) + } else { + let props = this.data[name].props + if (props) { + let value = Value.load(name, [], this) + for (let prefix of prefixes) { + let old = value.old(prefix) + if (old) { + for (let prop of props) { + if (!remove[prop]) { + remove[prop] = {} + } + if (!remove[prop].values) { + remove[prop].values = [] + } + remove[prop].values.push(old) + } + } + } + } else { + for (let p of prefixes) { + let olds = this.decl(name).old(name, p) + if (name === 'align-self') { + let a = add[name] && add[name].prefixes + if (a) { + if (p === '-webkit- 2009' && a.includes('-webkit-')) { + continue + } else if (p === '-webkit-' && a.includes('-webkit- 2009')) { + continue + } + } + } + for (let prefixed of olds) { + if (!remove[prefixed]) { + remove[prefixed] = {} + } + remove[prefixed].remove = true + } + } + } + } + } + + return [add, remove] + } + + /** + * Select prefixes from data, which is necessary for selected browsers + */ + select(list) { + let selected = { add: {}, remove: {} } + + for (let name in list) { + let data = list[name] + let add = data.browsers.map(i => { + let params = i.split(' ') + return { + browser: `${params[0]} ${params[1]}`, + note: params[2] + } + }) + + let notes = add + .filter(i => i.note) + .map(i => `${this.browsers.prefix(i.browser)} ${i.note}`) + notes = utils.uniq(notes) + + add = add + .filter(i => this.browsers.isSelected(i.browser)) + .map(i => { + let prefix = this.browsers.prefix(i.browser) + if (i.note) { + return `${prefix} ${i.note}` + } else { + return prefix + } + }) + add = this.sort(utils.uniq(add)) + + if (this.options.flexbox === 'no-2009') { + add = add.filter(i => !i.includes('2009')) + } + + let all = data.browsers.map(i => this.browsers.prefix(i)) + if (data.mistakes) { + all = all.concat(data.mistakes) + } + all = all.concat(notes) + all = utils.uniq(all) + + if (add.length) { + selected.add[name] = add + if (add.length < all.length) { + selected.remove[name] = all.filter(i => !add.includes(i)) + } + } else { + selected.remove[name] = all + } + } + + return selected + } + + /** + * Sort vendor prefixes + */ + sort(prefixes) { + return prefixes.sort((a, b) => { + let aLength = utils.removeNote(a).length + let bLength = utils.removeNote(b).length + + if (aLength === bLength) { + return b.length - a.length + } else { + return bLength - aLength + } + }) + } + + /** + * Return unprefixed version of property + */ + unprefixed(prop) { + let value = this.normalize(vendor.unprefixed(prop)) + if (value === 'flex-direction') { + value = 'flex-flow' + } + return value + } + + /** + * Return values, which must be prefixed in selected property + */ + values(type, prop) { + let data = this[type] + + let global = data['*'] && data['*'].values + let values = data[prop] && data[prop].values + + if (global && values) { + return utils.uniq(global.concat(values)) + } else { + return global || values || [] + } + } +} + +module.exports = Prefixes diff --git a/node_modules/autoprefixer/lib/processor.js b/node_modules/autoprefixer/lib/processor.js new file mode 100644 index 0000000000000000000000000000000000000000..e884ffbaec989654634e962a3e0a69b388ae9ef9 --- /dev/null +++ b/node_modules/autoprefixer/lib/processor.js @@ -0,0 +1,710 @@ +let parser = require('postcss-value-parser') + +let Value = require('./value') +let insertAreas = require('./hacks/grid-utils').insertAreas + +const OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i +const OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i +const IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i +const GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i + +const SIZES = [ + 'width', + 'height', + 'min-width', + 'max-width', + 'min-height', + 'max-height', + 'inline-size', + 'min-inline-size', + 'max-inline-size', + 'block-size', + 'min-block-size', + 'max-block-size' +] + +function hasGridTemplate(decl) { + return decl.parent.some( + i => i.prop === 'grid-template' || i.prop === 'grid-template-areas' + ) +} + +function hasRowsAndColumns(decl) { + let hasRows = decl.parent.some(i => i.prop === 'grid-template-rows') + let hasColumns = decl.parent.some(i => i.prop === 'grid-template-columns') + return hasRows && hasColumns +} + +function insideGrid(decl) { + return decl.parent.nodes.some(node => { + if (node.type !== 'decl') return false + let displayGrid = + node.prop === 'display' && /(inline-)?grid/.test(node.value) + let gridTemplate = node.prop.startsWith('grid-template') + let gridGap = /^grid-([A-z]+-)?gap/.test(node.prop) + return displayGrid || gridTemplate || gridGap + }) +} + +class Processor { + constructor(prefixes) { + this.prefixes = prefixes + } + + /** + * Add necessary prefixes + */ + add(css, result) { + // At-rules + let resolution = this.prefixes.add['@resolution'] + let keyframes = this.prefixes.add['@keyframes'] + let viewport = this.prefixes.add['@viewport'] + let supports = this.prefixes.add['@supports'] + + css.walkAtRules(rule => { + if (rule.name === 'keyframes') { + if (!this.disabled(rule, result)) { + return keyframes && keyframes.process(rule) + } + } else if (rule.name === 'viewport') { + if (!this.disabled(rule, result)) { + return viewport && viewport.process(rule) + } + } else if (rule.name === 'supports') { + if ( + this.prefixes.options.supports !== false && + !this.disabled(rule, result) + ) { + return supports.process(rule) + } + } else if (rule.name === 'media' && rule.params.includes('-resolution')) { + if (!this.disabled(rule, result)) { + return resolution && resolution.process(rule) + } + } + + return undefined + }) + + // Selectors + css.walkRules(rule => { + if (this.disabled(rule, result)) return undefined + + return this.prefixes.add.selectors.map(selector => { + return selector.process(rule, result) + }) + }) + + let gridPrefixes = + this.gridStatus(css, result) && + this.prefixes.add['grid-area'] && + this.prefixes.add['grid-area'].prefixes + + css.walkDecls(decl => { + if (this.disabledDecl(decl, result)) return undefined + + let parent = decl.parent + let prop = decl.prop + let value = decl.value + + if (prop === 'color-adjust') { + if (parent.every(i => i.prop !== 'print-color-adjust')) { + result.warn( + 'Replace color-adjust to print-color-adjust. ' + + 'The color-adjust shorthand is currently deprecated.', + { node: decl } + ) + } + } else if (prop === 'grid-row-span') { + result.warn( + 'grid-row-span is not part of final Grid Layout. Use grid-row.', + { node: decl } + ) + return undefined + } else if (prop === 'grid-column-span') { + result.warn( + 'grid-column-span is not part of final Grid Layout. Use grid-column.', + { node: decl } + ) + return undefined + } else if (prop === 'display' && value === 'box') { + result.warn( + 'You should write display: flex by final spec ' + + 'instead of display: box', + { node: decl } + ) + return undefined + } else if (prop === 'text-emphasis-position') { + if (value === 'under' || value === 'over') { + result.warn( + 'You should use 2 values for text-emphasis-position ' + + 'For example, `under left` instead of just `under`.', + { node: decl } + ) + } + } else if (prop === 'text-decoration-skip' && value === 'ink') { + result.warn( + 'Replace text-decoration-skip: ink to ' + + 'text-decoration-skip-ink: auto, because spec had been changed', + { node: decl } + ) + } else { + if (gridPrefixes && this.gridStatus(decl, result)) { + if (decl.value === 'subgrid') { + result.warn('IE does not support subgrid', { node: decl }) + } + if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) { + let fixed = prop.replace('-items', '-self') + result.warn( + `IE does not support ${prop} on grid containers. ` + + `Try using ${fixed} on child elements instead: ` + + `${decl.parent.selector} > * { ${fixed}: ${decl.value} }`, + { node: decl } + ) + } else if ( + /^(align|justify|place)-content$/.test(prop) && + insideGrid(decl) + ) { + result.warn(`IE does not support ${decl.prop} on grid containers`, { + node: decl + }) + } else if (prop === 'display' && decl.value === 'contents') { + result.warn( + 'Please do not use display: contents; ' + + 'if you have grid setting enabled', + { node: decl } + ) + return undefined + } else if (decl.prop === 'grid-gap') { + let status = this.gridStatus(decl, result) + if ( + status === 'autoplace' && + !hasRowsAndColumns(decl) && + !hasGridTemplate(decl) + ) { + result.warn( + 'grid-gap only works if grid-template(-areas) is being ' + + 'used or both rows and columns have been declared ' + + 'and cells have not been manually ' + + 'placed inside the explicit grid', + { node: decl } + ) + } else if ( + (status === true || status === 'no-autoplace') && + !hasGridTemplate(decl) + ) { + result.warn( + 'grid-gap only works if grid-template(-areas) is being used', + { node: decl } + ) + } + } else if (prop === 'grid-auto-columns') { + result.warn('grid-auto-columns is not supported by IE', { + node: decl + }) + return undefined + } else if (prop === 'grid-auto-rows') { + result.warn('grid-auto-rows is not supported by IE', { node: decl }) + return undefined + } else if (prop === 'grid-auto-flow') { + let hasRows = parent.some(i => i.prop === 'grid-template-rows') + let hasCols = parent.some(i => i.prop === 'grid-template-columns') + + if (hasGridTemplate(decl)) { + result.warn('grid-auto-flow is not supported by IE', { + node: decl + }) + } else if (value.includes('dense')) { + result.warn('grid-auto-flow: dense is not supported by IE', { + node: decl + }) + } else if (!hasRows && !hasCols) { + result.warn( + 'grid-auto-flow works only if grid-template-rows and ' + + 'grid-template-columns are present in the same rule', + { node: decl } + ) + } + return undefined + } else if (value.includes('auto-fit')) { + result.warn('auto-fit value is not supported by IE', { + node: decl, + word: 'auto-fit' + }) + return undefined + } else if (value.includes('auto-fill')) { + result.warn('auto-fill value is not supported by IE', { + node: decl, + word: 'auto-fill' + }) + return undefined + } else if (prop.startsWith('grid-template') && value.includes('[')) { + result.warn( + 'Autoprefixer currently does not support line names. ' + + 'Try using grid-template-areas instead.', + { node: decl, word: '[' } + ) + } + } + if (value.includes('radial-gradient')) { + if (OLD_RADIAL.test(decl.value)) { + result.warn( + 'Gradient has outdated direction syntax. ' + + 'New syntax is like `closest-side at 0 0` ' + + 'instead of `0 0, closest-side`.', + { node: decl } + ) + } else { + let ast = parser(value) + + for (let i of ast.nodes) { + if (i.type === 'function' && i.value === 'radial-gradient') { + for (let word of i.nodes) { + if (word.type === 'word') { + if (word.value === 'cover') { + result.warn( + 'Gradient has outdated direction syntax. ' + + 'Replace `cover` to `farthest-corner`.', + { node: decl } + ) + } else if (word.value === 'contain') { + result.warn( + 'Gradient has outdated direction syntax. ' + + 'Replace `contain` to `closest-side`.', + { node: decl } + ) + } + } + } + } + } + } + } + if (value.includes('linear-gradient')) { + if (OLD_LINEAR.test(value)) { + result.warn( + 'Gradient has outdated direction syntax. ' + + 'New syntax is like `to left` instead of `right`.', + { node: decl } + ) + } + } + } + + if (SIZES.includes(decl.prop)) { + if (!decl.value.includes('-fill-available')) { + if (decl.value.includes('fill-available')) { + result.warn( + 'Replace fill-available to stretch, ' + + 'because spec had been changed', + { node: decl } + ) + } else if (decl.value.includes('fill')) { + let ast = parser(value) + if (ast.nodes.some(i => i.type === 'word' && i.value === 'fill')) { + result.warn( + 'Replace fill to stretch, because spec had been changed', + { node: decl } + ) + } + } + } + } + + let prefixer + + if (decl.prop === 'transition' || decl.prop === 'transition-property') { + // Transition + return this.prefixes.transition.add(decl, result) + } else if (decl.prop === 'align-self') { + // align-self flexbox or grid + let display = this.displayType(decl) + if (display !== 'grid' && this.prefixes.options.flexbox !== false) { + prefixer = this.prefixes.add['align-self'] + if (prefixer && prefixer.prefixes) { + prefixer.process(decl) + } + } + if (this.gridStatus(decl, result) !== false) { + prefixer = this.prefixes.add['grid-row-align'] + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result) + } + } + } else if (decl.prop === 'justify-self') { + // justify-self flexbox or grid + if (this.gridStatus(decl, result) !== false) { + prefixer = this.prefixes.add['grid-column-align'] + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result) + } + } + } else if (decl.prop === 'place-self') { + prefixer = this.prefixes.add['place-self'] + if ( + prefixer && + prefixer.prefixes && + this.gridStatus(decl, result) !== false + ) { + return prefixer.process(decl, result) + } + } else { + // Properties + prefixer = this.prefixes.add[decl.prop] + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result) + } + } + + return undefined + }) + + // Insert grid-area prefixes. We need to be able to store the different + // rules as a data and hack API is not enough for this + if (this.gridStatus(css, result)) { + insertAreas(css, this.disabled) + } + + // Values + return css.walkDecls(decl => { + if (this.disabledValue(decl, result)) return + + let unprefixed = this.prefixes.unprefixed(decl.prop) + let list = this.prefixes.values('add', unprefixed) + if (Array.isArray(list)) { + for (let value of list) { + if (value.process) value.process(decl, result) + } + } + Value.save(this.prefixes, decl) + }) + } + + /** + * Check for control comment and global options + */ + disabled(node, result) { + if (!node) return false + + if (node._autoprefixerDisabled !== undefined) { + return node._autoprefixerDisabled + } + + if (node.parent) { + let p = node.prev() + if (p && p.type === 'comment' && IGNORE_NEXT.test(p.text)) { + node._autoprefixerDisabled = true + node._autoprefixerSelfDisabled = true + return true + } + } + + let value = null + if (node.nodes) { + let status + node.each(i => { + if (i.type !== 'comment') return + if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) { + if (typeof status !== 'undefined') { + result.warn( + 'Second Autoprefixer control comment ' + + 'was ignored. Autoprefixer applies control ' + + 'comment to whole block, not to next rules.', + { node: i } + ) + } else { + status = /on/i.test(i.text) + } + } + }) + + if (status !== undefined) { + value = !status + } + } + if (!node.nodes || value === null) { + if (node.parent) { + let isParentDisabled = this.disabled(node.parent, result) + if (node.parent._autoprefixerSelfDisabled === true) { + value = false + } else { + value = isParentDisabled + } + } else { + value = false + } + } + node._autoprefixerDisabled = value + return value + } + + /** + * Check for grid/flexbox options. + */ + disabledDecl(node, result) { + if (node.type === 'decl' && this.gridStatus(node, result) === false) { + if (node.prop.includes('grid') || node.prop === 'justify-items') { + return true + } + } + if (node.type === 'decl' && this.prefixes.options.flexbox === false) { + let other = ['order', 'justify-content', 'align-items', 'align-content'] + if (node.prop.includes('flex') || other.includes(node.prop)) { + return true + } + } + + return this.disabled(node, result) + } + + /** + * Check for grid/flexbox options. + */ + disabledValue(node, result) { + if (this.gridStatus(node, result) === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.includes('grid')) { + return true + } + } + if (this.prefixes.options.flexbox === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.includes('flex')) { + return true + } + } + if (node.type === 'decl' && node.prop === 'content') { + return true + } + + return this.disabled(node, result) + } + + /** + * Is it flebox or grid rule + */ + displayType(decl) { + for (let i of decl.parent.nodes) { + if (i.prop !== 'display') { + continue + } + + if (i.value.includes('flex')) { + return 'flex' + } + + if (i.value.includes('grid')) { + return 'grid' + } + } + + return false + } + + /** + * Set grid option via control comment + */ + gridStatus(node, result) { + if (!node) return false + + if (node._autoprefixerGridStatus !== undefined) { + return node._autoprefixerGridStatus + } + + let value = null + if (node.nodes) { + let status + node.each(i => { + if (i.type !== 'comment') return + if (GRID_REGEX.test(i.text)) { + let hasAutoplace = /:\s*autoplace/i.test(i.text) + let noAutoplace = /no-autoplace/i.test(i.text) + if (typeof status !== 'undefined') { + result.warn( + 'Second Autoprefixer grid control comment was ' + + 'ignored. Autoprefixer applies control comments to the whole ' + + 'block, not to the next rules.', + { node: i } + ) + } else if (hasAutoplace) { + status = 'autoplace' + } else if (noAutoplace) { + status = true + } else { + status = /on/i.test(i.text) + } + } + }) + + if (status !== undefined) { + value = status + } + } + + if (node.type === 'atrule' && node.name === 'supports') { + let params = node.params + if (params.includes('grid') && params.includes('auto')) { + value = false + } + } + + if (!node.nodes || value === null) { + if (node.parent) { + let isParentGrid = this.gridStatus(node.parent, result) + if (node.parent._autoprefixerSelfDisabled === true) { + value = false + } else { + value = isParentGrid + } + } else if (typeof this.prefixes.options.grid !== 'undefined') { + value = this.prefixes.options.grid + } else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') { + if (process.env.AUTOPREFIXER_GRID === 'autoplace') { + value = 'autoplace' + } else { + value = true + } + } else { + value = false + } + } + + node._autoprefixerGridStatus = value + return value + } + + /** + * Normalize spaces in cascade declaration group + */ + reduceSpaces(decl) { + let stop = false + this.prefixes.group(decl).up(() => { + stop = true + return true + }) + if (stop) { + return + } + + let parts = decl.raw('before').split('\n') + let prevMin = parts[parts.length - 1].length + /** @type {number|false} */ + let diff = false + + this.prefixes.group(decl).down(other => { + parts = other.raw('before').split('\n') + let last = parts.length - 1 + + if (parts[last].length > prevMin) { + if (diff === false) { + diff = parts[last].length - prevMin + } + + parts[last] = parts[last].slice(0, -diff) + other.raws.before = parts.join('\n') + } + }) + } + + /** + * Remove unnecessary pefixes + */ + remove(css, result) { + // At-rules + let resolution = this.prefixes.remove['@resolution'] + + css.walkAtRules((rule, i) => { + if (this.prefixes.remove[`@${rule.name}`]) { + if (!this.disabled(rule, result)) { + rule.parent.removeChild(i) + } + } else if ( + rule.name === 'media' && + rule.params.includes('-resolution') && + resolution + ) { + resolution.clean(rule) + } + }) + + // Selectors + css.walkRules((rule, i) => { + if (this.disabled(rule, result)) return + + for (let checker of this.prefixes.remove.selectors) { + if (checker.check(rule)) { + rule.parent.removeChild(i) + return + } + } + }) + + return css.walkDecls((decl, i) => { + if (this.disabled(decl, result)) return + + let rule = decl.parent + let unprefixed = this.prefixes.unprefixed(decl.prop) + + // Transition + if (decl.prop === 'transition' || decl.prop === 'transition-property') { + this.prefixes.transition.remove(decl) + } + + // Properties + if ( + this.prefixes.remove[decl.prop] && + this.prefixes.remove[decl.prop].remove + ) { + let notHack = this.prefixes.group(decl).down(other => { + return this.prefixes.normalize(other.prop) === unprefixed + }) + + if (unprefixed === 'flex-flow') { + notHack = true + } + + if (decl.prop === '-webkit-box-orient') { + let hacks = { 'flex-direction': true, 'flex-flow': true } + if (!decl.parent.some(j => hacks[j.prop])) return + } + + if (notHack && !this.withHackValue(decl)) { + if (decl.raw('before').includes('\n')) { + this.reduceSpaces(decl) + } + rule.removeChild(i) + return + } + } + + // Values + for (let checker of this.prefixes.values('remove', unprefixed)) { + if (!checker.check) continue + if (!checker.check(decl.value)) continue + + unprefixed = checker.unprefixed + let notHack = this.prefixes.group(decl).down(other => { + return other.value.includes(unprefixed) + }) + + if (notHack) { + rule.removeChild(i) + return + } + } + }) + } + + /** + * Some rare old values, which is not in standard + */ + withHackValue(decl) { + return ( + (decl.prop === '-webkit-background-clip' && decl.value === 'text') || + // Do not remove -webkit-box-orient when -webkit-line-clamp is present. + // https://github.com/postcss/autoprefixer/issues/1510 + (decl.prop === '-webkit-box-orient' && + decl.parent.some(d => d.prop === '-webkit-line-clamp')) + ) + } +} + +module.exports = Processor diff --git a/node_modules/autoprefixer/lib/resolution.js b/node_modules/autoprefixer/lib/resolution.js new file mode 100644 index 0000000000000000000000000000000000000000..d0b7cd0d9014a226b5c7681d18e5977d1a528f63 --- /dev/null +++ b/node_modules/autoprefixer/lib/resolution.js @@ -0,0 +1,99 @@ +let FractionJs = require('fraction.js') + +let Prefixer = require('./prefixer') +let utils = require('./utils') + +const REGEXP = + /(min|max)-resolution\s*:\s*(?:\d+(?:\.\d+)?|\.\d+)(dppx|dpcm|dpi|x)/gi +const SPLIT = + /(min|max)-resolution(\s*:\s*)(\d+(?:\.\d+)?|\.\d+)(dppx|dpcm|dpi|x)/i + +class Resolution extends Prefixer { + /** + * Remove prefixed queries + */ + clean(rule) { + if (!this.bad) { + this.bad = [] + for (let prefix of this.prefixes) { + this.bad.push(this.prefixName(prefix, 'min')) + this.bad.push(this.prefixName(prefix, 'max')) + } + } + + rule.params = utils.editList(rule.params, queries => { + return queries.filter(query => this.bad.every(i => !query.includes(i))) + }) + } + + /** + * Return prefixed query name + */ + prefixName(prefix, name) { + if (prefix === '-moz-') { + return name + '--moz-device-pixel-ratio' + } else { + return prefix + name + '-device-pixel-ratio' + } + } + + /** + * Return prefixed query + */ + prefixQuery(prefix, name, colon, value, units) { + value = new FractionJs(value) + + // 1dpcm = 2.54dpi + // 1dppx = 96dpi + if (units === 'dpi') { + value = value.div(96) + } else if (units === 'dpcm') { + value = value.mul(2.54).div(96) + } + value = value.simplify() + + if (prefix === '-o-') { + value = value.n + '/' + value.d + } + return this.prefixName(prefix, name) + colon + value + } + + /** + * Add prefixed queries + */ + process(rule) { + let parent = this.parentPrefix(rule) + let prefixes = parent ? [parent] : this.prefixes + + rule.params = utils.editList(rule.params, (origin, prefixed) => { + for (let query of origin) { + if ( + !query.includes('min-resolution') && + !query.includes('max-resolution') + ) { + prefixed.push(query) + continue + } + + for (let prefix of prefixes) { + let processed = query.replace(REGEXP, str => { + let parts = str.match(SPLIT) + return this.prefixQuery( + prefix, + parts[1], + parts[2], + parts[3], + parts[4] + ) + }) + prefixed.push(processed) + } + prefixed.push(query) + } + + return utils.uniq(prefixed) + }) + } +} + +module.exports = Resolution diff --git a/node_modules/autoprefixer/lib/selector.js b/node_modules/autoprefixer/lib/selector.js new file mode 100644 index 0000000000000000000000000000000000000000..efc7ed26de8ee96f9d1f58317014d0fe6888b802 --- /dev/null +++ b/node_modules/autoprefixer/lib/selector.js @@ -0,0 +1,152 @@ +let { list } = require('postcss') + +let Browsers = require('./browsers') +let OldSelector = require('./old-selector') +let Prefixer = require('./prefixer') +let utils = require('./utils') + +class Selector extends Prefixer { + constructor(name, prefixes, all) { + super(name, prefixes, all) + this.regexpCache = new Map() + } + + /** + * Clone and add prefixes for at-rule + */ + add(rule, prefix) { + let prefixeds = this.prefixeds(rule) + + if (this.already(rule, prefixeds, prefix)) { + return + } + + let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] }) + rule.parent.insertBefore(rule, cloned) + } + + /** + * Is rule already prefixed before + */ + already(rule, prefixeds, prefix) { + let index = rule.parent.index(rule) - 1 + + while (index >= 0) { + let before = rule.parent.nodes[index] + + if (before.type !== 'rule') { + return false + } + + let beforeSelector = list.comma(before.selector).join(', ') + + let some = false + for (let key in prefixeds[this.name]) { + let prefixed = prefixeds[this.name][key] + if (beforeSelector === prefixed) { + if (prefix === key) { + return true + } else { + some = true + break + } + } + } + if (!some) { + return false + } + + index -= 1 + } + + return false + } + + /** + * Is rule selectors need to be prefixed + */ + check(rule) { + if (rule.selector.includes(this.name)) { + return !!rule.selector.match(this.regexp()) + } + + return false + } + + /** + * Return function to fast find prefixed selector + */ + old(prefix) { + return new OldSelector(this, prefix) + } + + /** + * All possible prefixes + */ + possible() { + return Browsers.prefixes() + } + + /** + * Return prefixed version of selector + */ + prefixed(prefix) { + return this.name.replace(/^(\W*)/, `$1${prefix}`) + } + + /** + * Return all possible selector prefixes + */ + prefixeds(rule) { + if (rule._autoprefixerPrefixeds) { + if (rule._autoprefixerPrefixeds[this.name]) { + return rule._autoprefixerPrefixeds + } + } else { + rule._autoprefixerPrefixeds = {} + } + + let prefixeds = {} + if (rule.selector.includes(',')) { + let ruleParts = list.comma(rule.selector) + let toProcess = ruleParts.filter(el => el.includes(this.name)) + + for (let prefix of this.possible()) { + prefixeds[prefix] = toProcess + .map(el => this.replace(el, prefix)) + .join(', ') + } + } else { + for (let prefix of this.possible()) { + prefixeds[prefix] = this.replace(rule.selector, prefix) + } + } + + rule._autoprefixerPrefixeds[this.name] = prefixeds + return rule._autoprefixerPrefixeds + } + + /** + * Lazy loadRegExp for name + */ + regexp(prefix) { + if (!this.regexpCache.has(prefix)) { + let name = prefix ? this.prefixed(prefix) : this.name + this.regexpCache.set( + prefix, + new RegExp(`(^|[^:"'=])${utils.escapeRegexp(name)}`, 'gi') + ) + } + + return this.regexpCache.get(prefix) + } + + /** + * Replace selectors by prefixed one + */ + replace(selector, prefix) { + return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`) + } +} + +module.exports = Selector diff --git a/node_modules/autoprefixer/lib/supports.js b/node_modules/autoprefixer/lib/supports.js new file mode 100644 index 0000000000000000000000000000000000000000..90668bff309b3013a36b197c93ee5e97cfe30c3e --- /dev/null +++ b/node_modules/autoprefixer/lib/supports.js @@ -0,0 +1,303 @@ +let featureQueries = require('caniuse-lite/data/features/css-featurequeries.js') +let feature = require('caniuse-lite/dist/unpacker/feature') +let { parse } = require('postcss') + +let brackets = require('./brackets') +let Browsers = require('./browsers') +let utils = require('./utils') +let Value = require('./value') + +let data = feature(featureQueries) + +let supported = [] +for (let browser in data.stats) { + let versions = data.stats[browser] + for (let version in versions) { + let support = versions[version] + if (/y/.test(support)) { + supported.push(browser + ' ' + version) + } + } +} + +class Supports { + constructor(Prefixes, all) { + this.Prefixes = Prefixes + this.all = all + } + + /** + * Add prefixes + */ + add(nodes, all) { + return nodes.map(i => { + if (this.isProp(i)) { + let prefixed = this.prefixed(i[0]) + if (prefixed.length > 1) { + return this.convert(prefixed) + } + + return i + } + + if (typeof i === 'object') { + return this.add(i, all) + } + + return i + }) + } + + /** + * Clean brackets with one child + */ + cleanBrackets(nodes) { + return nodes.map(i => { + if (typeof i !== 'object') { + return i + } + + if (i.length === 1 && typeof i[0] === 'object') { + return this.cleanBrackets(i[0]) + } + + return this.cleanBrackets(i) + }) + } + + /** + * Add " or " between properties and convert it to brackets format + */ + convert(progress) { + let result = [''] + for (let i of progress) { + result.push([`${i.prop}: ${i.value}`]) + result.push(' or ') + } + result[result.length - 1] = '' + return result + } + + /** + * Check global options + */ + disabled(node) { + if (!this.all.options.grid) { + if (node.prop === 'display' && node.value.includes('grid')) { + return true + } + if (node.prop.includes('grid') || node.prop === 'justify-items') { + return true + } + } + + if (this.all.options.flexbox === false) { + if (node.prop === 'display' && node.value.includes('flex')) { + return true + } + let other = ['order', 'justify-content', 'align-items', 'align-content'] + if (node.prop.includes('flex') || other.includes(node.prop)) { + return true + } + } + + return false + } + + /** + * Return true if prefixed property has no unprefixed + */ + isHack(all, unprefixed) { + let check = new RegExp(`(\\(|\\s)${utils.escapeRegexp(unprefixed)}:`) + return !check.test(all) + } + + /** + * Return true if brackets node is "not" word + */ + isNot(node) { + return typeof node === 'string' && /not\s*/i.test(node) + } + + /** + * Return true if brackets node is "or" word + */ + isOr(node) { + return typeof node === 'string' && /\s*or\s*/i.test(node) + } + + /** + * Return true if brackets node is (prop: value) + */ + isProp(node) { + return ( + typeof node === 'object' && + node.length === 1 && + typeof node[0] === 'string' + ) + } + + /** + * Compress value functions into a string nodes + */ + normalize(nodes) { + if (typeof nodes !== 'object') { + return nodes + } + + nodes = nodes.filter(i => i !== '') + + if (typeof nodes[0] === 'string') { + let firstNode = nodes[0].trim() + + if ( + firstNode.includes(':') || + firstNode === 'selector' || + firstNode === 'not selector' + ) { + return [brackets.stringify(nodes)] + } + } + return nodes.map(i => this.normalize(i)) + } + + /** + * Parse string into declaration property and value + */ + parse(str) { + let parts = str.split(':') + let prop = parts[0] + let value = parts[1] + if (!value) value = '' + return [prop.trim(), value.trim()] + } + + /** + * Return array of Declaration with all necessary prefixes + */ + prefixed(str) { + let rule = this.virtual(str) + if (this.disabled(rule.first)) { + return rule.nodes + } + + let result = { warn: () => null } + + let prefixer = this.prefixer().add[rule.first.prop] + prefixer && prefixer.process && prefixer.process(rule.first, result) + + for (let decl of rule.nodes) { + for (let value of this.prefixer().values('add', rule.first.prop)) { + value.process(decl) + } + Value.save(this.all, decl) + } + + return rule.nodes + } + + /** + * Return prefixer only with @supports supported browsers + */ + prefixer() { + if (this.prefixerCache) { + return this.prefixerCache + } + + let filtered = this.all.browsers.selected.filter(i => { + return supported.includes(i) + }) + + let browsers = new Browsers( + this.all.browsers.data, + filtered, + this.all.options, + this.all.browsers.browserslistOpts + ) + this.prefixerCache = new this.Prefixes( + this.all.data, + browsers, + this.all.options + ) + return this.prefixerCache + } + + /** + * Add prefixed declaration + */ + process(rule) { + let ast = brackets.parse(rule.params) + ast = this.normalize(ast) + ast = this.remove(ast, rule.params) + ast = this.add(ast, rule.params) + ast = this.cleanBrackets(ast) + rule.params = brackets.stringify(ast) + } + + /** + * Remove all unnecessary prefixes + */ + remove(nodes, all) { + let i = 0 + while (i < nodes.length) { + if ( + !this.isNot(nodes[i - 1]) && + this.isProp(nodes[i]) && + this.isOr(nodes[i + 1]) + ) { + if (this.toRemove(nodes[i][0], all)) { + nodes.splice(i, 2) + continue + } + + i += 2 + continue + } + + if (typeof nodes[i] === 'object') { + nodes[i] = this.remove(nodes[i], all) + } + + i += 1 + } + return nodes + } + + /** + * Return true if we need to remove node + */ + toRemove(str, all) { + let [prop, value] = this.parse(str) + let unprefixed = this.all.unprefixed(prop) + + let cleaner = this.all.cleaner() + + if ( + cleaner.remove[prop] && + cleaner.remove[prop].remove && + !this.isHack(all, unprefixed) + ) { + return true + } + + for (let checker of cleaner.values('remove', unprefixed)) { + if (checker.check(value)) { + return true + } + } + + return false + } + + /** + * Create virtual rule to process it by prefixer + */ + virtual(str) { + let [prop, value] = this.parse(str) + let rule = parse('a{}').first + rule.append({ prop, raws: { before: '' }, value }) + return rule + } +} + +module.exports = Supports diff --git a/node_modules/autoprefixer/lib/transition.js b/node_modules/autoprefixer/lib/transition.js new file mode 100644 index 0000000000000000000000000000000000000000..1c9b3430b6746c292edb10ab83c3a1967056b7a2 --- /dev/null +++ b/node_modules/autoprefixer/lib/transition.js @@ -0,0 +1,329 @@ +let { list } = require('postcss') +let parser = require('postcss-value-parser') + +let Browsers = require('./browsers') +let vendor = require('./vendor') + +class Transition { + constructor(prefixes) { + this.props = ['transition', 'transition-property'] + this.prefixes = prefixes + } + + /** + * Process transition and add prefixes for all necessary properties + */ + add(decl, result) { + let prefix, prop + let add = this.prefixes.add[decl.prop] + let vendorPrefixes = this.ruleVendorPrefixes(decl) + let declPrefixes = vendorPrefixes || (add && add.prefixes) || [] + + let params = this.parse(decl.value) + let names = params.map(i => this.findProp(i)) + let added = [] + + if (names.some(i => i[0] === '-')) { + return + } + + for (let param of params) { + prop = this.findProp(param) + if (prop[0] === '-') continue + + let prefixer = this.prefixes.add[prop] + if (!prefixer || !prefixer.prefixes) continue + + for (prefix of prefixer.prefixes) { + if (vendorPrefixes && !vendorPrefixes.some(p => prefix.includes(p))) { + continue + } + + let prefixed = this.prefixes.prefixed(prop, prefix) + if (prefixed !== '-ms-transform' && !names.includes(prefixed)) { + if (!this.disabled(prop, prefix)) { + added.push(this.clone(prop, prefixed, param)) + } + } + } + } + + params = params.concat(added) + let value = this.stringify(params) + + let webkitClean = this.stringify( + this.cleanFromUnprefixed(params, '-webkit-') + ) + if (declPrefixes.includes('-webkit-')) { + this.cloneBefore(decl, `-webkit-${decl.prop}`, webkitClean) + } + this.cloneBefore(decl, decl.prop, webkitClean) + if (declPrefixes.includes('-o-')) { + let operaClean = this.stringify(this.cleanFromUnprefixed(params, '-o-')) + this.cloneBefore(decl, `-o-${decl.prop}`, operaClean) + } + + for (prefix of declPrefixes) { + if (prefix !== '-webkit-' && prefix !== '-o-') { + let prefixValue = this.stringify( + this.cleanOtherPrefixes(params, prefix) + ) + this.cloneBefore(decl, prefix + decl.prop, prefixValue) + } + } + + if (value !== decl.value && !this.already(decl, decl.prop, value)) { + this.checkForWarning(result, decl) + decl.cloneBefore() + decl.value = value + } + } + + /** + * Does we already have this declaration + */ + already(decl, prop, value) { + return decl.parent.some(i => i.prop === prop && i.value === value) + } + + /** + * Show transition-property warning + */ + checkForWarning(result, decl) { + if (decl.prop !== 'transition-property') { + return + } + + let isPrefixed = false + let hasAssociatedProp = false + + decl.parent.each(i => { + if (i.type !== 'decl') { + return undefined + } + if (i.prop.indexOf('transition-') !== 0) { + return undefined + } + let values = list.comma(i.value) + // check if current Rule's transition-property comma separated value list needs prefixes + if (i.prop === 'transition-property') { + values.forEach(value => { + let lookup = this.prefixes.add[value] + if (lookup && lookup.prefixes && lookup.prefixes.length > 0) { + isPrefixed = true + } + }) + return undefined + } + // check if another transition-* prop in current Rule has comma separated value list + hasAssociatedProp = hasAssociatedProp || values.length > 1 + return false + }) + + if (isPrefixed && hasAssociatedProp) { + decl.warn( + result, + 'Replace transition-property to transition, ' + + 'because Autoprefixer could not support ' + + 'any cases of transition-property ' + + 'and other transition-*' + ) + } + } + + /** + * Remove all non-webkit prefixes and unprefixed params if we have prefixed + */ + cleanFromUnprefixed(params, prefix) { + let remove = params + .map(i => this.findProp(i)) + .filter(i => i.slice(0, prefix.length) === prefix) + .map(i => this.prefixes.unprefixed(i)) + + let result = [] + for (let param of params) { + let prop = this.findProp(param) + let p = vendor.prefix(prop) + if (!remove.includes(prop) && (p === prefix || p === '')) { + result.push(param) + } + } + return result + } + + cleanOtherPrefixes(params, prefix) { + return params.filter(param => { + let current = vendor.prefix(this.findProp(param)) + return current === '' || current === prefix + }) + } + + /** + * Return new param array with different name + */ + clone(origin, name, param) { + let result = [] + let changed = false + for (let i of param) { + if (!changed && i.type === 'word' && i.value === origin) { + result.push({ type: 'word', value: name }) + changed = true + } else { + result.push(i) + } + } + return result + } + + /** + * Add declaration if it is not exist + */ + cloneBefore(decl, prop, value) { + if (!this.already(decl, prop, value)) { + decl.cloneBefore({ prop, value }) + } + } + + /** + * Check property for disabled by option + */ + disabled(prop, prefix) { + let other = ['order', 'justify-content', 'align-self', 'align-content'] + if (prop.includes('flex') || other.includes(prop)) { + if (this.prefixes.options.flexbox === false) { + return true + } + + if (this.prefixes.options.flexbox === 'no-2009') { + return prefix.includes('2009') + } + } + return undefined + } + + /** + * Find or create separator + */ + div(params) { + for (let param of params) { + for (let node of param) { + if (node.type === 'div' && node.value === ',') { + return node + } + } + } + return { after: ' ', type: 'div', value: ',' } + } + + /** + * Find property name + */ + findProp(param) { + let prop = param[0].value + if (/^\d/.test(prop)) { + for (let [i, token] of param.entries()) { + if (i !== 0 && token.type === 'word') { + return token.value + } + } + } + return prop + } + + /** + * Parse properties list to array + */ + parse(value) { + let ast = parser(value) + let result = [] + let param = [] + for (let node of ast.nodes) { + param.push(node) + if (node.type === 'div' && node.value === ',') { + result.push(param) + param = [] + } + } + result.push(param) + return result.filter(i => i.length > 0) + } + + /** + * Process transition and remove all unnecessary properties + */ + remove(decl) { + let params = this.parse(decl.value) + params = params.filter(i => { + let prop = this.prefixes.remove[this.findProp(i)] + return !prop || !prop.remove + }) + let value = this.stringify(params) + + if (decl.value === value) { + return + } + + if (params.length === 0) { + decl.remove() + return + } + + let double = decl.parent.some(i => { + return i.prop === decl.prop && i.value === value + }) + let smaller = decl.parent.some(i => { + return i !== decl && i.prop === decl.prop && i.value.length > value.length + }) + + if (double || smaller) { + decl.remove() + return + } + + decl.value = value + } + + /** + * Check if transition prop is inside vendor specific rule + */ + ruleVendorPrefixes(decl) { + let { parent } = decl + + if (parent.type !== 'rule') { + return false + } else if (!parent.selector.includes(':-')) { + return false + } + + let selectors = Browsers.prefixes().filter(s => + parent.selector.includes(':' + s) + ) + + return selectors.length > 0 ? selectors : false + } + + /** + * Return properties string from array + */ + stringify(params) { + if (params.length === 0) { + return '' + } + let nodes = [] + for (let param of params) { + if (param[param.length - 1].type !== 'div') { + param.push(this.div(params)) + } + nodes.push(...param) + } + if (nodes[0].type === 'div') { + nodes = nodes.slice(1) + } + if (nodes[nodes.length - 1].type === 'div') { + nodes = nodes.slice(0, -1) + } + return parser.stringify({ nodes }) + } +} + +module.exports = Transition diff --git a/node_modules/autoprefixer/lib/utils.js b/node_modules/autoprefixer/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..2309e8e2b15b4557101417e3bec78887c22e7ecf --- /dev/null +++ b/node_modules/autoprefixer/lib/utils.js @@ -0,0 +1,93 @@ +let { list } = require('postcss') + +/** + * Throw special error, to tell beniary, + * that this error is from Autoprefixer. + */ +module.exports.error = function (text) { + let err = new Error(text) + err.autoprefixer = true + throw err +} + +/** + * Return array, that doesn’t contain duplicates. + */ +module.exports.uniq = function (array) { + return [...new Set(array)] +} + +/** + * Return "-webkit-" on "-webkit- old" + */ +module.exports.removeNote = function (string) { + if (!string.includes(' ')) { + return string + } + + return string.split(' ')[0] +} + +/** + * Escape RegExp symbols + */ +module.exports.escapeRegexp = function (string) { + return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') +} + +/** + * Return regexp to check, that CSS string contain word + */ +module.exports.regexp = function (word, escape = true) { + if (escape) { + word = this.escapeRegexp(word) + } + return new RegExp(`(^|[\\s,(])(${word}($|[\\s(,]))`, 'gi') +} + +/** + * Change comma list + */ +module.exports.editList = function (value, callback) { + let origin = list.comma(value) + let changed = callback(origin, []) + + if (origin === changed) { + return value + } + + let join = value.match(/,\s*/) + join = join ? join[0] : ', ' + return changed.join(join) +} + +/** + * Split the selector into parts. + * It returns 3 level deep array because selectors can be comma + * separated (1), space separated (2), and combined (3) + * @param {String} selector selector string + * @return {Array>} 3 level deep array of split selector + * @see utils.test.js for examples + */ +module.exports.splitSelector = function (selector) { + return list.comma(selector).map(i => { + return list.space(i).map(k => { + return k.split(/(?=\.|#)/g) + }) + }) +} + +/** + * Return true if a given value only contains numbers. + * @param {*} value + * @returns {boolean} + */ +module.exports.isPureNumber = function (value) { + if (typeof value === 'number') { + return true + } + if (typeof value === 'string') { + return /^[0-9]+$/.test(value) + } + return false +} diff --git a/node_modules/autoprefixer/lib/value.js b/node_modules/autoprefixer/lib/value.js new file mode 100644 index 0000000000000000000000000000000000000000..39d2915d07df90808d20234a24bd5d3038fbc42f --- /dev/null +++ b/node_modules/autoprefixer/lib/value.js @@ -0,0 +1,125 @@ +let OldValue = require('./old-value') +let Prefixer = require('./prefixer') +let utils = require('./utils') +let vendor = require('./vendor') + +class Value extends Prefixer { + /** + * Clone decl for each prefixed values + */ + static save(prefixes, decl) { + let prop = decl.prop + let result = [] + + for (let prefix in decl._autoprefixerValues) { + let value = decl._autoprefixerValues[prefix] + + if (value === decl.value) { + continue + } + + let item + let propPrefix = vendor.prefix(prop) + + if (propPrefix === '-pie-') { + continue + } + + if (propPrefix === prefix) { + item = decl.value = value + result.push(item) + continue + } + + let prefixed = prefixes.prefixed(prop, prefix) + let rule = decl.parent + + if (!rule.every(i => i.prop !== prefixed)) { + result.push(item) + continue + } + + let trimmed = value.replace(/\s+/, ' ') + let already = rule.some( + i => i.prop === decl.prop && i.value.replace(/\s+/, ' ') === trimmed + ) + + if (already) { + result.push(item) + continue + } + + let cloned = this.clone(decl, { value }) + item = decl.parent.insertBefore(decl, cloned) + + result.push(item) + } + + return result + } + + /** + * Save values with next prefixed token + */ + add(decl, prefix) { + if (!decl._autoprefixerValues) { + decl._autoprefixerValues = {} + } + let value = decl._autoprefixerValues[prefix] || this.value(decl) + + let before + do { + before = value + value = this.replace(value, prefix) + if (value === false) return + } while (value !== before) + + decl._autoprefixerValues[prefix] = value + } + + /** + * Is declaration need to be prefixed + */ + check(decl) { + let value = decl.value + if (!value.includes(this.name)) { + return false + } + + return !!value.match(this.regexp()) + } + + /** + * Return function to fast find prefixed value + */ + old(prefix) { + return new OldValue(this.name, prefix + this.name) + } + + /** + * Lazy regexp loading + */ + regexp() { + return this.regexpCache || (this.regexpCache = utils.regexp(this.name)) + } + + /** + * Add prefix to values in string + */ + replace(string, prefix) { + return string.replace(this.regexp(), `$1${prefix}$2`) + } + + /** + * Get value with comments if it was not changed + */ + value(decl) { + if (decl.raws.value && decl.raws.value.value === decl.value) { + return decl.raws.value.raw + } else { + return decl.value + } + } +} + +module.exports = Value diff --git a/node_modules/autoprefixer/lib/vendor.js b/node_modules/autoprefixer/lib/vendor.js new file mode 100644 index 0000000000000000000000000000000000000000..099ffc10d6824ec56b99a0b2207658ea0dd1aad4 --- /dev/null +++ b/node_modules/autoprefixer/lib/vendor.js @@ -0,0 +1,14 @@ +module.exports = { + prefix(prop) { + let match = prop.match(/^(-\w+-)/) + if (match) { + return match[0] + } + + return '' + }, + + unprefixed(prop) { + return prop.replace(/^-\w+-/, '') + } +} diff --git a/node_modules/autoprefixer/node_modules/.bin/browserslist b/node_modules/autoprefixer/node_modules/.bin/browserslist new file mode 100644 index 0000000000000000000000000000000000000000..78c08d743a8e478c346029e241b1f795b646fbd2 --- /dev/null +++ b/node_modules/autoprefixer/node_modules/.bin/browserslist @@ -0,0 +1,156 @@ +#!/usr/bin/env node + +var fs = require('fs') +var updateDb = require('update-browserslist-db') + +var browserslist = require('./') +var pkg = require('./package.json') + +var args = process.argv.slice(2) + +var USAGE = + 'Usage:\n' + + ' npx browserslist\n' + + ' npx browserslist "QUERIES"\n' + + ' npx browserslist --json "QUERIES"\n' + + ' npx browserslist --config="path/to/browserlist/file"\n' + + ' npx browserslist --coverage "QUERIES"\n' + + ' npx browserslist --coverage=US "QUERIES"\n' + + ' npx browserslist --coverage=US,RU,global "QUERIES"\n' + + ' npx browserslist --env="environment name defined in config"\n' + + ' npx browserslist --stats="path/to/browserlist/stats/file"\n' + + ' npx browserslist --mobile-to-desktop\n' + + ' npx browserslist --ignore-unknown-versions\n' + +function isArg(arg) { + return args.some(function (str) { + return str === arg || str.indexOf(arg + '=') === 0 + }) +} + +function error(msg) { + process.stderr.write('browserslist: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(pkg.description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist ' + pkg.version + '\n') +} else if (isArg('--update-db')) { + /* c8 ignore next 8 */ + process.stdout.write( + 'The --update-db command is deprecated.\n' + + 'Please use npx update-browserslist-db@latest instead.\n' + ) + process.stdout.write('Browserslist DB update will still be made.\n') + updateDb(function (str) { + process.stdout.write(str) + }) +} else { + var mode = 'browsers' + var opts = {} + var queries + var areas + + for (var i = 0; i < args.length; i++) { + if (args[i][0] !== '-') { + queries = args[i].replace(/^["']|["']$/g, '') + continue + } + + var arg = args[i].split('=') + var name = arg[0] + var value = arg[1] + + if (value) value = value.replace(/^["']|["']$/g, '') + + if (name === '--config' || name === '-b') { + opts.config = value + } else if (name === '--env' || name === '-e') { + opts.env = value + } else if (name === '--stats' || name === '-s') { + opts.stats = value + } else if (name === '--coverage' || name === '-c') { + if (mode !== 'json') mode = 'coverage' + if (value) { + areas = value.split(',') + } else { + areas = ['global'] + } + } else if (name === '--json') { + mode = 'json' + } else if (name === '--mobile-to-desktop') { + /* c8 ignore next */ + opts.mobileToDesktop = true + } else if (name === '--ignore-unknown-versions') { + /* c8 ignore next */ + opts.ignoreUnknownVersions = true + } else { + error('Unknown arguments ' + args[i] + '.\n\n' + USAGE) + } + } + + var browsers + try { + browsers = browserslist(queries, opts) + } catch (e) { + if (e.name === 'BrowserslistError') { + error(e.message) + } /* c8 ignore start */ else { + throw e + } /* c8 ignore end */ + } + + var coverage + if (mode === 'browsers') { + browsers.forEach(function (browser) { + process.stdout.write(browser + '\n') + }) + } else if (areas) { + coverage = areas.map(function (area) { + var stats + if (area !== 'global') { + stats = area + } else if (opts.stats) { + stats = JSON.parse(fs.readFileSync(opts.stats)) + } + var result = browserslist.coverage(browsers, stats) + var round = Math.round(result * 100) / 100.0 + + return [area, round] + }) + + if (mode === 'coverage') { + var prefix = 'These browsers account for ' + process.stdout.write(prefix) + coverage.forEach(function (data, index) { + var area = data[0] + var round = data[1] + var end = 'globally' + if (area && area !== 'global') { + end = 'in the ' + area.toUpperCase() + } else if (opts.stats) { + end = 'in custom statistics' + } + + if (index !== 0) { + process.stdout.write(prefix.replace(/./g, ' ')) + } + + process.stdout.write(round + '% of all users ' + end + '\n') + }) + } + } + + if (mode === 'json') { + var data = { browsers: browsers } + if (coverage) { + data.coverage = coverage.reduce(function (object, j) { + object[j[0]] = j[1] + return object + }, {}) + } + process.stdout.write(JSON.stringify(data, null, ' ') + '\n') + } +} diff --git a/node_modules/autoprefixer/package.json b/node_modules/autoprefixer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..22eecaefda0f632a90c8193a92bb52cff2645585 --- /dev/null +++ b/node_modules/autoprefixer/package.json @@ -0,0 +1,48 @@ +{ + "name": "autoprefixer", + "version": "10.5.5", + "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website", + "keywords": [ + "autoprefixer", + "css", + "postcss", + "postcss-plugin", + "prefix" + ], + "bugs": { + "url": "https://github.com/postcss/autoprefixer/issues" + }, + "license": "MIT", + "author": "Andrey Sitnik ", + "repository": "postcss/autoprefixer", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": "bin/autoprefixer", + "main": "lib/autoprefixer.js", + "types": "lib/autoprefixer.d.ts", + "dependencies": { + "browserslist": "^4.28.9", + "caniuse-lite": "^1.0.30001810", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "postcss": "^8.1.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } +} diff --git a/node_modules/available-typed-arrays/.eslintrc b/node_modules/available-typed-arrays/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..3b5d9e90ec405f85dd7f9066656efccc51193697 --- /dev/null +++ b/node_modules/available-typed-arrays/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/node_modules/available-typed-arrays/.github/FUNDING.yml b/node_modules/available-typed-arrays/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..14abc7253f839c7d3573adf12bdcc3d6cd9bec4f --- /dev/null +++ b/node_modules/available-typed-arrays/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/available-typed-arrays +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/available-typed-arrays/.nycrc b/node_modules/available-typed-arrays/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/available-typed-arrays/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/available-typed-arrays/CHANGELOG.md b/node_modules/available-typed-arrays/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..f5ade9a28ddf7b95161b83062a96630484785b0c --- /dev/null +++ b/node_modules/available-typed-arrays/CHANGELOG.md @@ -0,0 +1,100 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.7](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.6...v1.0.7) - 2024-02-19 + +### Commits + +- [Refactor] use `possible-typed-array-names` [`ac86abf`](https://github.com/inspect-js/available-typed-arrays/commit/ac86abfd64c4b633fd6523cc4193f1913fd22666) + +## [v1.0.6](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.5...v1.0.6) - 2024-01-31 + +### Commits + +- [actions] reuse common workflows [`1850353`](https://github.com/inspect-js/available-typed-arrays/commit/1850353ded0ceb4d02d9d05649da5b7f3a28c89f) +- [meta] use `npmignore` to autogenerate an npmignore file [`5c7de12`](https://github.com/inspect-js/available-typed-arrays/commit/5c7de120d22a5c35f703ba3f0b5287e5c5f38af6) +- [patch] add types [`fcfb0ea`](https://github.com/inspect-js/available-typed-arrays/commit/fcfb0ea21c9dc8459d68f8bb26679abb0bec71ca) +- [actions] update codecov uploader [`d844945`](https://github.com/inspect-js/available-typed-arrays/commit/d84494596881a298aabde9bd87e538ce10c6cd01) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.every`, `safe-publish-latest`, `tape` [`a2be6f4`](https://github.com/inspect-js/available-typed-arrays/commit/a2be6f482010e920692d8f65fe1f193dbb73004d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b283a3e`](https://github.com/inspect-js/available-typed-arrays/commit/b283a3e2176fbe8e431a27e20df21c831f216d5a) +- [actions] update rebase action to use reusable workflow [`0ad1f2d`](https://github.com/inspect-js/available-typed-arrays/commit/0ad1f2d82b11713ee48d9b37cb73fcc891bd9f4a) +- [Dev Deps] update `@ljharb/eslint-config`, `array.prototype.every`, `aud`, `tape` [`cd36e81`](https://github.com/inspect-js/available-typed-arrays/commit/cd36e8131076dd4e67a88b259f829067fa56c139) +- [meta] simplify "exports" [`f696e5f`](https://github.com/inspect-js/available-typed-arrays/commit/f696e5ff9ded838e192ade4e8550a890c4f35eb0) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`bf20080`](https://github.com/inspect-js/available-typed-arrays/commit/bf200809aea3107b31fc8817122c693e099be30e) + +## [v1.0.5](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.4...v1.0.5) - 2021-08-30 + +### Fixed + +- [Refactor] use `globalThis` if available [`#12`](https://github.com/inspect-js/available-typed-arrays/issues/12) + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1199790`](https://github.com/inspect-js/available-typed-arrays/commit/1199790ab5841517ad04827fab3f135d2dc5cfb7) + +## [v1.0.4](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.3...v1.0.4) - 2021-05-25 + +### Commits + +- [Refactor] Remove `array.prototype.filter` dependency [`f39c90e`](https://github.com/inspect-js/available-typed-arrays/commit/f39c90ecb1907de28ee2d3577b7da37ae12aac56) +- [Dev Deps] update `eslint`, `auto-changelog` [`b2e3a03`](https://github.com/inspect-js/available-typed-arrays/commit/b2e3a035e8cd3ddfd7b565249e1651c6419a34d0) +- [meta] create `FUNDING.yml` [`8c0e758`](https://github.com/inspect-js/available-typed-arrays/commit/8c0e758c6ec80adbb3770554653cdc3aa16beb55) +- [Tests] fix harmony test matrix [`ef96549`](https://github.com/inspect-js/available-typed-arrays/commit/ef96549df171776267529413240a2219cb59d5ce) +- [meta] add `sideEffects` flag [`288cca0`](https://github.com/inspect-js/available-typed-arrays/commit/288cca0fbd214bec706447851bb8bccc4b899a48) + +## [v1.0.3](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.2...v1.0.3) - 2021-05-19 + +### Commits + +- [Tests] migrate tests to Github Actions [`3ef082c`](https://github.com/inspect-js/available-typed-arrays/commit/3ef082caaa153b49f4c37c85bbd5c4b13fe4f638) +- [meta] do not publish github action workflow files [`fd95ffd`](https://github.com/inspect-js/available-typed-arrays/commit/fd95ffdaca759eca81cb4c5d5772ee863dfea501) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`eb6bd65`](https://github.com/inspect-js/available-typed-arrays/commit/eb6bd659a31c92a6a178c71a89fe0d5261413e6c) +- [Tests] run `nyc` on all tests [`636c946`](https://github.com/inspect-js/available-typed-arrays/commit/636c94657b532599ef90a214aaa12639d11b0161) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`70a3b61`](https://github.com/inspect-js/available-typed-arrays/commit/70a3b61367b318fb883c2f35b8f2d539849a23b6) +- [actions] add "Allow Edits" workflow [`bd09c45`](https://github.com/inspect-js/available-typed-arrays/commit/bd09c45299e396fa5bbd5be4c58b1aedcb372a82) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.every`, `aud`, `tape` [`8f97523`](https://github.com/inspect-js/available-typed-arrays/commit/8f9752308390a79068cd431436bbfd77bca15647) +- [readme] fix URLs [`75418e2`](https://github.com/inspect-js/available-typed-arrays/commit/75418e20b57f4ad5e65d8c2e1864efd14eaa2e65) +- [readme] add actions and codecov badges [`4a8bc30`](https://github.com/inspect-js/available-typed-arrays/commit/4a8bc30af2ce1f48e2b28ab3db5be9589bd6f2d0) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`65198ac`](https://github.com/inspect-js/available-typed-arrays/commit/65198ace335a013ef49b6bd722bc80bbbc6be784) +- [actions] update workflows [`7f816eb`](https://github.com/inspect-js/available-typed-arrays/commit/7f816eb231131e53ced2572ba6c6c6a00f975789) +- [Refactor] use `array.prototype.filter` instead of `array-filter` [`2dd1038`](https://github.com/inspect-js/available-typed-arrays/commit/2dd1038d71ce48b5650687691cf8fe09795a6d30) +- [actions] switch Automatic Rease workflow to `pull_request_target` event [`9b45e91`](https://github.com/inspect-js/available-typed-arrays/commit/9b45e914fcb08bdaaaa0166b41716e51f400d1c6) +- [Dev Deps] update `auto-changelog`, `tape` [`0003a5b`](https://github.com/inspect-js/available-typed-arrays/commit/0003a5b122a0724db5499c114104eeeb396b2f67) +- [meta] use `prepublishOnly` script for npm 7+ [`d884dd1`](https://github.com/inspect-js/available-typed-arrays/commit/d884dd1c1117411f35d9fbc07f513a1a85ccdead) +- [readme] remove travis badge [`9da2b3c`](https://github.com/inspect-js/available-typed-arrays/commit/9da2b3c29706340fada995137aba12cfae4d6f37) +- [Dev Deps] update `auto-changelog`; add `aud` [`41b1336`](https://github.com/inspect-js/available-typed-arrays/commit/41b13369c71b0e3e57b9de0f4fb1e4d67950d74a) +- [Tests] only audit prod deps [`2571826`](https://github.com/inspect-js/available-typed-arrays/commit/2571826a5d121eeeeccf4c711e3f9e4616685d50) + +## [v1.0.2](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.1...v1.0.2) - 2020-01-26 + +### Commits + +- [actions] add automatic rebasing / merge commit blocking [`3229a74`](https://github.com/inspect-js/available-typed-arrays/commit/3229a74bda60f24e2257efc40ddff9a3ce98de76) +- [Dev Deps] update `@ljharb/eslint-config` [`9579abe`](https://github.com/inspect-js/available-typed-arrays/commit/9579abecc196088561d3aedf27cad45b56f8e18b) +- [Fix] remove `require` condition to avoid experimental warning [`2cade6b`](https://github.com/inspect-js/available-typed-arrays/commit/2cade6b56d6a508a950c7da27d038bee496e716b) + +## [v1.0.1](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.0...v1.0.1) - 2020-01-24 + +### Commits + +- [meta] add "exports" [`5942917`](https://github.com/inspect-js/available-typed-arrays/commit/5942917aafb56c6bce80f01b7ae6a9b46bc72c69) + +## v1.0.0 - 2020-01-24 + +### Commits + +- Initial commit [`2bc5144`](https://github.com/inspect-js/available-typed-arrays/commit/2bc514459c9f65756adfbd9964abf433183d78f6) +- readme [`31e4796`](https://github.com/inspect-js/available-typed-arrays/commit/31e4796379eba4a16d3c6a8e9baf6eb3f39e33d1) +- npm init [`9194266`](https://github.com/inspect-js/available-typed-arrays/commit/9194266b471a2a2dd5e6969bc40358ceb346e21e) +- Tests [`b539830`](https://github.com/inspect-js/available-typed-arrays/commit/b539830c3213f90de42b4d6e62803f52daf61a6d) +- Implementation [`6577df2`](https://github.com/inspect-js/available-typed-arrays/commit/6577df244ea146ef5ec16858044c8955e0fc445c) +- [meta] add `auto-changelog` [`7b43310`](https://github.com/inspect-js/available-typed-arrays/commit/7b43310be76f00fe60b74a2fd6d0e46ac1d01f3e) +- [Tests] add `npm run lint` [`dedfbc1`](https://github.com/inspect-js/available-typed-arrays/commit/dedfbc1592f86ac1636267d3965f2345df43815b) +- [Tests] use shared travis-ci configs [`c459d78`](https://github.com/inspect-js/available-typed-arrays/commit/c459d78bf2efa9d777f88599ae71a796dbfcb70f) +- Only apps should have lockfiles [`d294668`](https://github.com/inspect-js/available-typed-arrays/commit/d294668422cf35f5e7716a85bfd204e62b01c056) +- [meta] add `funding` field [`6e70bc1`](https://github.com/inspect-js/available-typed-arrays/commit/6e70bc1fb199c7898165aaf05c25bb49f4062e53) +- [meta] add `safe-publish-latest` [`dd89ca2`](https://github.com/inspect-js/available-typed-arrays/commit/dd89ca2c6842f0f3e82958df2b2bd0fc0c929c51) diff --git a/node_modules/available-typed-arrays/LICENSE b/node_modules/available-typed-arrays/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..707437b5750a24d0ed2dd693ce221283ff4508a0 --- /dev/null +++ b/node_modules/available-typed-arrays/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Inspect JS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/available-typed-arrays/README.md b/node_modules/available-typed-arrays/README.md new file mode 100644 index 0000000000000000000000000000000000000000..df6f5864a5c771b5cd6c3a3527e97365532f2858 --- /dev/null +++ b/node_modules/available-typed-arrays/README.md @@ -0,0 +1,55 @@ +# available-typed-arrays [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Returns an array of Typed Array names that are available in the current environment. + +## Example + +```js +var availableTypedArrays = require('available-typed-arrays'); +var assert = require('assert'); + +assert.deepStrictEqual( + availableTypedArrays().sort(), + [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' + ].sort() +); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/available-typed-arrays +[2]: https://versionbadg.es/inspect-js/available-typed-arrays.svg +[5]: https://david-dm.org/inspect-js/available-typed-arrays.svg +[6]: https://david-dm.org/inspect-js/available-typed-arrays +[7]: https://david-dm.org/inspect-js/available-typed-arrays/dev-status.svg +[8]: https://david-dm.org/inspect-js/available-typed-arrays#info=devDependencies +[11]: https://nodei.co/npm/available-typed-arrays.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/available-typed-arrays.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/available-typed-arrays.svg +[downloads-url]: https://npm-stat.com/charts.html?package=available-typed-arrays +[codecov-image]: https://codecov.io/gh/inspect-js/available-typed-arrays/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/available-typed-arrays/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/available-typed-arrays +[actions-url]: https://github.com/inspect-js/available-typed-arrays/actions diff --git a/node_modules/available-typed-arrays/index.d.ts b/node_modules/available-typed-arrays/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c21e1c4951f9c66fa635c3fb33fdede106aaf064 --- /dev/null +++ b/node_modules/available-typed-arrays/index.d.ts @@ -0,0 +1,8 @@ +type AllPossibleTypedArrays = typeof import('possible-typed-array-names'); + +declare function availableTypedArrays(): + | [] + | AllPossibleTypedArrays + | Omit; + +export = availableTypedArrays; diff --git a/node_modules/available-typed-arrays/index.js b/node_modules/available-typed-arrays/index.js new file mode 100644 index 0000000000000000000000000000000000000000..125f000cc46e0608d8efe1a603ee02cbd0fd690e --- /dev/null +++ b/node_modules/available-typed-arrays/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var possibleNames = require('possible-typed-array-names'); + +var g = typeof globalThis === 'undefined' ? global : globalThis; + +/** @type {import('.')} */ +module.exports = function availableTypedArrays() { + var /** @type {ReturnType} */ out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + // @ts-expect-error + out[out.length] = possibleNames[i]; + } + } + return out; +}; diff --git a/node_modules/available-typed-arrays/package.json b/node_modules/available-typed-arrays/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9b4e245e2eb63d3ff9232b6dd2244211f89562d5 --- /dev/null +++ b/node_modules/available-typed-arrays/package.json @@ -0,0 +1,93 @@ +{ + "name": "available-typed-arrays", + "version": "1.0.7", + "description": "Returns an array of Typed Array names that are available in the current environment", + "main": "index.js", + "type": "commonjs", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test:harmony": "nyc node --harmony --es-staging test", + "test": "npm run tests-only && npm run test:harmony", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/available-typed-arrays.git" + }, + "keywords": [ + "typed", + "arrays", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "BigInt64Array", + "BigUint64Array" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/available-typed-arrays/issues" + }, + "homepage": "https://github.com/inspect-js/available-typed-arrays#readme", + "engines": { + "node": ">= 0.4" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/array.prototype.every": "^1.1.1", + "@types/isarray": "^2.0.2", + "@types/tape": "^5.6.4", + "array.prototype.every": "^1.1.5", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "isarray": "^2.0.5", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "^5.4.0-dev.20240131" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + } +} diff --git a/node_modules/available-typed-arrays/test/index.js b/node_modules/available-typed-arrays/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..21c986dc8e44c242606ce312539ba8022fb74a84 --- /dev/null +++ b/node_modules/available-typed-arrays/test/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); +var isArray = require('isarray'); +var every = require('array.prototype.every'); + +var availableTypedArrays = require('../'); + +test('available typed arrays', function (t) { + t.equal(typeof availableTypedArrays, 'function', 'is a function'); + + var arrays = availableTypedArrays(); + t.equal(isArray(arrays), true, 'returns an array'); + + t.equal(every(arrays, function (array) { return typeof array === 'string'; }), true, 'contains only strings'); + + t.end(); +}); diff --git a/node_modules/available-typed-arrays/tsconfig.json b/node_modules/available-typed-arrays/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..fdab34fe3115774b0c77f42a46ba251f95ce150a --- /dev/null +++ b/node_modules/available-typed-arrays/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + //"skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/node_modules/babel-plugin-polyfill-corejs2/LICENSE b/node_modules/babel-plugin-polyfill-corejs2/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b74971fede812cae3d1b3d7db474db739fac2d53 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Nicolò Ribaudo and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/babel-plugin-polyfill-corejs2/README.md b/node_modules/babel-plugin-polyfill-corejs2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c5dfdc5c88a4414245eb09c9bdb4b4c3d01cc085 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/README.md @@ -0,0 +1,28 @@ +# babel-plugin-polyfill-corejs2 + +## Install + +Using npm: + +```sh +npm install --save-dev babel-plugin-polyfill-corejs2 +``` + +or using yarn: + +```sh +yarn add babel-plugin-polyfill-corejs2 --dev +``` + +## Usage + +Add this plugin to your Babel configuration: + +```json +{ + "plugins": [["polyfill-corejs2", { "method": "usage-global" }]] +} +``` + +This package supports the `usage-pure`, `usage-global`, and `entry-global` methods. +When `entry-global` is used, it replaces imports to `core-js`. diff --git a/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs b/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b850877869aacaf0715ff77643ae0e075bad62f5 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs @@ -0,0 +1,395 @@ +import corejs2Polyfills from '@babel/compat-data/corejs2-built-ins'; +import semver from 'semver'; +import defineProvider from '@babel/helper-define-polyfill-provider'; +import * as _babel from '@babel/core'; + +const define = (name, pure, global = [], meta) => { + return { + name, + pure, + global, + meta + }; +}; +const pureAndGlobal = (pure, global, minRuntimeVersion = null) => define(global[0], pure, global, { + minRuntimeVersion +}); +const globalOnly = global => define(global[0], null, global); +const pureOnly = (pure, name) => define(name, pure, []); +const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"]; +const CommonIterators = ["es6.string.iterator", ...ArrayNatureIterators]; +const PromiseDependencies = ["es6.object.to-string", "es6.promise"]; +const BuiltIns = { + DataView: globalOnly(["es6.typed.data-view"]), + Float32Array: globalOnly(["es6.typed.float32-array"]), + Float64Array: globalOnly(["es6.typed.float64-array"]), + Int8Array: globalOnly(["es6.typed.int8-array"]), + Int16Array: globalOnly(["es6.typed.int16-array"]), + Int32Array: globalOnly(["es6.typed.int32-array"]), + Map: pureAndGlobal("map", ["es6.map", ...CommonIterators]), + Number: globalOnly(["es6.number.constructor"]), + Promise: pureAndGlobal("promise", PromiseDependencies), + RegExp: globalOnly(["es6.regexp.constructor"]), + Set: pureAndGlobal("set", ["es6.set", ...CommonIterators]), + Symbol: pureAndGlobal("symbol/index", ["es6.symbol"]), + Uint8Array: globalOnly(["es6.typed.uint8-array"]), + Uint8ClampedArray: globalOnly(["es6.typed.uint8-clamped-array"]), + Uint16Array: globalOnly(["es6.typed.uint16-array"]), + Uint32Array: globalOnly(["es6.typed.uint32-array"]), + WeakMap: pureAndGlobal("weak-map", ["es6.weak-map", ...CommonIterators]), + WeakSet: pureAndGlobal("weak-set", ["es6.weak-set", ...CommonIterators]), + setImmediate: pureOnly("set-immediate", "web.immediate"), + clearImmediate: pureOnly("clear-immediate", "web.immediate"), + parseFloat: pureOnly("parse-float", "es6.parse-float"), + parseInt: pureOnly("parse-int", "es6.parse-int") +}; +const InstanceProperties = { + __defineGetter__: globalOnly(["es7.object.define-getter"]), + __defineSetter__: globalOnly(["es7.object.define-setter"]), + __lookupGetter__: globalOnly(["es7.object.lookup-getter"]), + __lookupSetter__: globalOnly(["es7.object.lookup-setter"]), + anchor: globalOnly(["es6.string.anchor"]), + big: globalOnly(["es6.string.big"]), + bind: globalOnly(["es6.function.bind"]), + blink: globalOnly(["es6.string.blink"]), + bold: globalOnly(["es6.string.bold"]), + codePointAt: globalOnly(["es6.string.code-point-at"]), + copyWithin: globalOnly(["es6.array.copy-within"]), + endsWith: globalOnly(["es6.string.ends-with"]), + entries: globalOnly(ArrayNatureIterators), + every: globalOnly(["es6.array.every"]), + fill: globalOnly(["es6.array.fill"]), + filter: globalOnly(["es6.array.filter"]), + finally: globalOnly(["es7.promise.finally", ...PromiseDependencies]), + find: globalOnly(["es6.array.find"]), + findIndex: globalOnly(["es6.array.find-index"]), + fixed: globalOnly(["es6.string.fixed"]), + flags: globalOnly(["es6.regexp.flags"]), + flatMap: globalOnly(["es7.array.flat-map"]), + fontcolor: globalOnly(["es6.string.fontcolor"]), + fontsize: globalOnly(["es6.string.fontsize"]), + forEach: globalOnly(["es6.array.for-each"]), + includes: globalOnly(["es6.string.includes", "es7.array.includes"]), + indexOf: globalOnly(["es6.array.index-of"]), + italics: globalOnly(["es6.string.italics"]), + keys: globalOnly(ArrayNatureIterators), + lastIndexOf: globalOnly(["es6.array.last-index-of"]), + link: globalOnly(["es6.string.link"]), + map: globalOnly(["es6.array.map"]), + match: globalOnly(["es6.regexp.match"]), + name: globalOnly(["es6.function.name"]), + padStart: globalOnly(["es7.string.pad-start"]), + padEnd: globalOnly(["es7.string.pad-end"]), + reduce: globalOnly(["es6.array.reduce"]), + reduceRight: globalOnly(["es6.array.reduce-right"]), + repeat: globalOnly(["es6.string.repeat"]), + replace: globalOnly(["es6.regexp.replace"]), + search: globalOnly(["es6.regexp.search"]), + small: globalOnly(["es6.string.small"]), + some: globalOnly(["es6.array.some"]), + sort: globalOnly(["es6.array.sort"]), + split: globalOnly(["es6.regexp.split"]), + startsWith: globalOnly(["es6.string.starts-with"]), + strike: globalOnly(["es6.string.strike"]), + sub: globalOnly(["es6.string.sub"]), + sup: globalOnly(["es6.string.sup"]), + toISOString: globalOnly(["es6.date.to-iso-string"]), + toJSON: globalOnly(["es6.date.to-json"]), + toString: globalOnly(["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"]), + trim: globalOnly(["es6.string.trim"]), + trimEnd: globalOnly(["es7.string.trim-right"]), + trimLeft: globalOnly(["es7.string.trim-left"]), + trimRight: globalOnly(["es7.string.trim-right"]), + trimStart: globalOnly(["es7.string.trim-left"]), + values: globalOnly(ArrayNatureIterators) +}; + +// This isn't present in older @babel/compat-data versions +if ("es6.array.slice" in corejs2Polyfills) { + InstanceProperties.slice = globalOnly(["es6.array.slice"]); +} +const StaticProperties = { + Array: { + from: pureAndGlobal("array/from", ["es6.symbol", "es6.array.from", ...CommonIterators]), + isArray: pureAndGlobal("array/is-array", ["es6.array.is-array"]), + of: pureAndGlobal("array/of", ["es6.array.of"]) + }, + Date: { + now: pureAndGlobal("date/now", ["es6.date.now"]) + }, + JSON: { + stringify: pureOnly("json/stringify", "es6.symbol") + }, + Math: { + // 'Math' was not included in the 7.0.0 + // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616. + acosh: pureAndGlobal("math/acosh", ["es6.math.acosh"], "7.0.1"), + asinh: pureAndGlobal("math/asinh", ["es6.math.asinh"], "7.0.1"), + atanh: pureAndGlobal("math/atanh", ["es6.math.atanh"], "7.0.1"), + cbrt: pureAndGlobal("math/cbrt", ["es6.math.cbrt"], "7.0.1"), + clz32: pureAndGlobal("math/clz32", ["es6.math.clz32"], "7.0.1"), + cosh: pureAndGlobal("math/cosh", ["es6.math.cosh"], "7.0.1"), + expm1: pureAndGlobal("math/expm1", ["es6.math.expm1"], "7.0.1"), + fround: pureAndGlobal("math/fround", ["es6.math.fround"], "7.0.1"), + hypot: pureAndGlobal("math/hypot", ["es6.math.hypot"], "7.0.1"), + imul: pureAndGlobal("math/imul", ["es6.math.imul"], "7.0.1"), + log1p: pureAndGlobal("math/log1p", ["es6.math.log1p"], "7.0.1"), + log10: pureAndGlobal("math/log10", ["es6.math.log10"], "7.0.1"), + log2: pureAndGlobal("math/log2", ["es6.math.log2"], "7.0.1"), + sign: pureAndGlobal("math/sign", ["es6.math.sign"], "7.0.1"), + sinh: pureAndGlobal("math/sinh", ["es6.math.sinh"], "7.0.1"), + tanh: pureAndGlobal("math/tanh", ["es6.math.tanh"], "7.0.1"), + trunc: pureAndGlobal("math/trunc", ["es6.math.trunc"], "7.0.1") + }, + Number: { + EPSILON: pureAndGlobal("number/epsilon", ["es6.number.epsilon"]), + MIN_SAFE_INTEGER: pureAndGlobal("number/min-safe-integer", ["es6.number.min-safe-integer"]), + MAX_SAFE_INTEGER: pureAndGlobal("number/max-safe-integer", ["es6.number.max-safe-integer"]), + isFinite: pureAndGlobal("number/is-finite", ["es6.number.is-finite"]), + isInteger: pureAndGlobal("number/is-integer", ["es6.number.is-integer"]), + isSafeInteger: pureAndGlobal("number/is-safe-integer", ["es6.number.is-safe-integer"]), + isNaN: pureAndGlobal("number/is-nan", ["es6.number.is-nan"]), + parseFloat: pureAndGlobal("number/parse-float", ["es6.number.parse-float"]), + parseInt: pureAndGlobal("number/parse-int", ["es6.number.parse-int"]) + }, + Object: { + assign: pureAndGlobal("object/assign", ["es6.object.assign"]), + create: pureAndGlobal("object/create", ["es6.object.create"]), + defineProperties: pureAndGlobal("object/define-properties", ["es6.object.define-properties"]), + defineProperty: pureAndGlobal("object/define-property", ["es6.object.define-property"]), + entries: pureAndGlobal("object/entries", ["es7.object.entries"]), + freeze: pureAndGlobal("object/freeze", ["es6.object.freeze"]), + getOwnPropertyDescriptor: pureAndGlobal("object/get-own-property-descriptor", ["es6.object.get-own-property-descriptor"]), + getOwnPropertyDescriptors: pureAndGlobal("object/get-own-property-descriptors", ["es7.object.get-own-property-descriptors"]), + getOwnPropertyNames: pureAndGlobal("object/get-own-property-names", ["es6.object.get-own-property-names"]), + getOwnPropertySymbols: pureAndGlobal("object/get-own-property-symbols", ["es6.symbol"]), + getPrototypeOf: pureAndGlobal("object/get-prototype-of", ["es6.object.get-prototype-of"]), + is: pureAndGlobal("object/is", ["es6.object.is"]), + isExtensible: pureAndGlobal("object/is-extensible", ["es6.object.is-extensible"]), + isFrozen: pureAndGlobal("object/is-frozen", ["es6.object.is-frozen"]), + isSealed: pureAndGlobal("object/is-sealed", ["es6.object.is-sealed"]), + keys: pureAndGlobal("object/keys", ["es6.object.keys"]), + preventExtensions: pureAndGlobal("object/prevent-extensions", ["es6.object.prevent-extensions"]), + seal: pureAndGlobal("object/seal", ["es6.object.seal"]), + setPrototypeOf: pureAndGlobal("object/set-prototype-of", ["es6.object.set-prototype-of"]), + values: pureAndGlobal("object/values", ["es7.object.values"]) + }, + Promise: { + all: globalOnly(CommonIterators), + race: globalOnly(CommonIterators) + }, + Reflect: { + apply: pureAndGlobal("reflect/apply", ["es6.reflect.apply"]), + construct: pureAndGlobal("reflect/construct", ["es6.reflect.construct"]), + defineProperty: pureAndGlobal("reflect/define-property", ["es6.reflect.define-property"]), + deleteProperty: pureAndGlobal("reflect/delete-property", ["es6.reflect.delete-property"]), + get: pureAndGlobal("reflect/get", ["es6.reflect.get"]), + getOwnPropertyDescriptor: pureAndGlobal("reflect/get-own-property-descriptor", ["es6.reflect.get-own-property-descriptor"]), + getPrototypeOf: pureAndGlobal("reflect/get-prototype-of", ["es6.reflect.get-prototype-of"]), + has: pureAndGlobal("reflect/has", ["es6.reflect.has"]), + isExtensible: pureAndGlobal("reflect/is-extensible", ["es6.reflect.is-extensible"]), + ownKeys: pureAndGlobal("reflect/own-keys", ["es6.reflect.own-keys"]), + preventExtensions: pureAndGlobal("reflect/prevent-extensions", ["es6.reflect.prevent-extensions"]), + set: pureAndGlobal("reflect/set", ["es6.reflect.set"]), + setPrototypeOf: pureAndGlobal("reflect/set-prototype-of", ["es6.reflect.set-prototype-of"]) + }, + String: { + at: pureOnly("string/at", "es7.string.at"), + fromCodePoint: pureAndGlobal("string/from-code-point", ["es6.string.from-code-point"]), + raw: pureAndGlobal("string/raw", ["es6.string.raw"]) + }, + Symbol: { + // FIXME: Pure disabled to work around zloirock/core-js#262. + asyncIterator: globalOnly(["es6.symbol", "es7.symbol.async-iterator"]), + for: pureOnly("symbol/for", "es6.symbol"), + hasInstance: pureOnly("symbol/has-instance", "es6.symbol"), + isConcatSpreadable: pureOnly("symbol/is-concat-spreadable", "es6.symbol"), + iterator: define("es6.symbol", "symbol/iterator", CommonIterators), + keyFor: pureOnly("symbol/key-for", "es6.symbol"), + match: pureAndGlobal("symbol/match", ["es6.regexp.match"]), + replace: pureOnly("symbol/replace", "es6.symbol"), + search: pureOnly("symbol/search", "es6.symbol"), + species: pureOnly("symbol/species", "es6.symbol"), + split: pureOnly("symbol/split", "es6.symbol"), + toPrimitive: pureOnly("symbol/to-primitive", "es6.symbol"), + toStringTag: pureOnly("symbol/to-string-tag", "es6.symbol"), + unscopables: pureOnly("symbol/unscopables", "es6.symbol") + } +}; + +const webPolyfills = { + "web.timers": {}, + "web.immediate": {}, + "web.dom.iterable": {} +}; +const purePolyfills = { + "es6.parse-float": {}, + "es6.parse-int": {}, + "es7.string.at": {} +}; +function addPlatformSpecificPolyfills (targets, method, polyfills) { + const targetNames = Object.keys(targets); + const isAnyTarget = !targetNames.length; + const isWebTarget = targetNames.some(name => name !== "node"); + return { + ...polyfills, + ...(method === "usage-pure" ? purePolyfills : null), + ...(isAnyTarget || isWebTarget ? webPolyfills : null) + }; +} + +function hasMinVersion(minVersion, runtimeVersion) { + // If the range is unavailable, we're running the script during Babel's + // build process, and we want to assume that all versions are satisfied so + // that the built output will include all definitions. + if (!runtimeVersion || !minVersion) return true; + runtimeVersion = String(runtimeVersion); + + // semver.intersects() has some surprising behavior with comparing ranges + // with preprelease versions. We add '^' to ensure that we are always + // comparing ranges with ranges, which sidesteps this logic. + // For example: + // + // semver.intersects(`<7.0.1`, "7.0.0-beta.0") // false - surprising + // semver.intersects(`<7.0.1`, "^7.0.0-beta.0") // true - expected + // + // This is because the first falls back to + // + // semver.satisfies("7.0.0-beta.0", `<7.0.1`) // false - surprising + // + // and this fails because a prerelease version can only satisfy a range + // if it is a prerelease within the same major/minor/patch range. + // + // Note: If this is found to have issues, please also revist the logic in + // babel-core's availableHelper() API. + if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`; + return !semver.intersects(`<${minVersion}`, runtimeVersion) && !semver.intersects(`>=8.0.0`, runtimeVersion); +} + +const { + types: t +} = _babel.default || _babel; +const BABEL_RUNTIME = "@babel/runtime-corejs2"; +const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility"; +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +const has = Function.call.bind(Object.hasOwnProperty); +var index = defineProvider(function (api, { + [presetEnvCompat]: { + entryInjectRegenerator = false, + noRuntimeName = false + } = {}, + [runtimeCompat]: { + useBabelRuntime = false, + runtimeVersion = "", + ext = ".js" + } = {} +}) { + const resolve = api.createMetaResolver({ + global: BuiltIns, + static: StaticProperties, + instance: InstanceProperties + }); + const { + debug, + shouldInjectPolyfill, + method + } = api; + const polyfills = addPlatformSpecificPolyfills(api.targets, method, corejs2Polyfills); + const coreJSBase = useBabelRuntime ? `${BABEL_RUNTIME}/core-js` : method === "usage-pure" ? "core-js/library/fn" : "core-js/modules"; + function inject(name, utils) { + if (typeof name === "string") { + // Some polyfills aren't always available, for example + // web.dom.iterable when targeting node + if (has(polyfills, name) && shouldInjectPolyfill(name)) { + debug(name); + utils.injectGlobalImport(`${coreJSBase}/${name}.js`); + } + return; + } + name.forEach(name => inject(name, utils)); + } + function maybeInjectPure(desc, hint, utils) { + let { + pure, + meta, + name + } = desc; + if (!pure || !shouldInjectPolyfill(name)) return; + if (runtimeVersion && meta && meta.minRuntimeVersion && !hasMinVersion(meta && meta.minRuntimeVersion, runtimeVersion)) { + return; + } + + // Unfortunately core-js and @babel/runtime-corejs2 don't have the same + // directory structure, so we need to special case this. + if (useBabelRuntime && pure === "symbol/index") pure = "symbol"; + return utils.injectDefaultImport(`${coreJSBase}/${pure}${ext}`, hint); + } + return { + name: "corejs2", + runtimeName: noRuntimeName ? null : BABEL_RUNTIME, + polyfills, + entryGlobal(meta, utils, path) { + if (meta.kind === "import" && meta.source === "core-js") { + debug(null); + inject(Object.keys(polyfills), utils); + if (entryInjectRegenerator) { + utils.injectGlobalImport("regenerator-runtime/runtime.js"); + } + path.remove(); + } + }, + usageGlobal(meta, utils) { + const resolved = resolve(meta); + if (!resolved) return; + let deps = resolved.desc.global; + if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") { + const low = meta.object.toLowerCase(); + deps = deps.filter(m => m.includes(low)); + } + inject(deps, utils); + }, + usagePure(meta, utils, path) { + if (meta.kind === "in") { + if (meta.key === "Symbol.iterator") { + path.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/is-iterable${ext}`, "isIterable"), [path.node.right] // meta.kind === "in" narrows this + )); + } + return; + } + if (path.parentPath.isUnaryExpression({ + operator: "delete" + })) return; + if (meta.kind === "property") { + // We can't compile destructuring. + if (!path.isMemberExpression()) return; + if (!path.isReferenced()) return; + if (meta.key === "Symbol.iterator" && shouldInjectPolyfill("es6.symbol") && path.parentPath.isCallExpression({ + callee: path.node + }) && path.parentPath.node.arguments.length === 0) { + path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator${ext}`, "getIterator"), [path.node.object])); + path.skip(); + return; + } + } + const resolved = resolve(meta); + if (!resolved) return; + const id = maybeInjectPure(resolved.desc, resolved.name, utils); + if (id) path.replaceWith(id); + }, + visitor: method === "usage-global" && { + // yield* + YieldExpression(path) { + if (path.node.delegate) { + inject("web.dom.iterable", api.getUtils(path)); + } + }, + // for-of, [a, b] = c + "ForOfStatement|ArrayPattern"(path) { + CommonIterators.forEach(name => inject(name, api.getUtils(path))); + } + } + }; +}); + +export { index as default }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs.map b/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..b5613e96e615ea634195666c0d692f83893b3dec --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/esm/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../src/built-in-definitions.ts","../src/add-platform-specific-polyfills.ts","../src/helpers.ts","../src/index.ts"],"sourcesContent":["import corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\n\ntype ObjectMap = { [name: string]: V };\n\ntype PolyfillDescriptor = {\n name: string;\n pure: string | null;\n global: string[];\n meta: T | null;\n};\n\ntype CoreJS2Meta = {\n minRuntimeVersion: string | null;\n};\n\nconst define = (\n name: string,\n pure?: string | null,\n global: string[] = [],\n meta?: T | null,\n): PolyfillDescriptor => {\n return { name, pure, global, meta };\n};\n\nconst pureAndGlobal = (\n pure: string,\n global: string[],\n minRuntimeVersion: string | null = null,\n) => define(global[0], pure, global, { minRuntimeVersion });\n\nconst globalOnly = (global: string[]) =>\n define(global[0], null, global);\n\nconst pureOnly = (pure: string, name: string) =>\n define(name, pure, []);\n\nconst ArrayNatureIterators = [\n \"es6.object.to-string\",\n \"es6.array.iterator\",\n \"web.dom.iterable\",\n];\n\nexport const CommonIterators = [\"es6.string.iterator\", ...ArrayNatureIterators];\n\nconst PromiseDependencies = [\"es6.object.to-string\", \"es6.promise\"];\n\nexport const BuiltIns: ObjectMap> = {\n DataView: globalOnly([\"es6.typed.data-view\"]),\n Float32Array: globalOnly([\"es6.typed.float32-array\"]),\n Float64Array: globalOnly([\"es6.typed.float64-array\"]),\n Int8Array: globalOnly([\"es6.typed.int8-array\"]),\n Int16Array: globalOnly([\"es6.typed.int16-array\"]),\n Int32Array: globalOnly([\"es6.typed.int32-array\"]),\n Map: pureAndGlobal(\"map\", [\"es6.map\", ...CommonIterators]),\n Number: globalOnly([\"es6.number.constructor\"]),\n Promise: pureAndGlobal(\"promise\", PromiseDependencies),\n RegExp: globalOnly([\"es6.regexp.constructor\"]),\n Set: pureAndGlobal(\"set\", [\"es6.set\", ...CommonIterators]),\n Symbol: pureAndGlobal(\"symbol/index\", [\"es6.symbol\"]),\n Uint8Array: globalOnly([\"es6.typed.uint8-array\"]),\n Uint8ClampedArray: globalOnly([\"es6.typed.uint8-clamped-array\"]),\n Uint16Array: globalOnly([\"es6.typed.uint16-array\"]),\n Uint32Array: globalOnly([\"es6.typed.uint32-array\"]),\n WeakMap: pureAndGlobal(\"weak-map\", [\"es6.weak-map\", ...CommonIterators]),\n WeakSet: pureAndGlobal(\"weak-set\", [\"es6.weak-set\", ...CommonIterators]),\n\n setImmediate: pureOnly(\"set-immediate\", \"web.immediate\"),\n clearImmediate: pureOnly(\"clear-immediate\", \"web.immediate\"),\n parseFloat: pureOnly(\"parse-float\", \"es6.parse-float\"),\n parseInt: pureOnly(\"parse-int\", \"es6.parse-int\"),\n};\n\nexport const InstanceProperties: ObjectMap> = {\n __defineGetter__: globalOnly([\"es7.object.define-getter\"]),\n __defineSetter__: globalOnly([\"es7.object.define-setter\"]),\n __lookupGetter__: globalOnly([\"es7.object.lookup-getter\"]),\n __lookupSetter__: globalOnly([\"es7.object.lookup-setter\"]),\n anchor: globalOnly([\"es6.string.anchor\"]),\n big: globalOnly([\"es6.string.big\"]),\n bind: globalOnly([\"es6.function.bind\"]),\n blink: globalOnly([\"es6.string.blink\"]),\n bold: globalOnly([\"es6.string.bold\"]),\n codePointAt: globalOnly([\"es6.string.code-point-at\"]),\n copyWithin: globalOnly([\"es6.array.copy-within\"]),\n endsWith: globalOnly([\"es6.string.ends-with\"]),\n entries: globalOnly(ArrayNatureIterators),\n every: globalOnly([\"es6.array.every\"]),\n fill: globalOnly([\"es6.array.fill\"]),\n filter: globalOnly([\"es6.array.filter\"]),\n finally: globalOnly([\"es7.promise.finally\", ...PromiseDependencies]),\n find: globalOnly([\"es6.array.find\"]),\n findIndex: globalOnly([\"es6.array.find-index\"]),\n fixed: globalOnly([\"es6.string.fixed\"]),\n flags: globalOnly([\"es6.regexp.flags\"]),\n flatMap: globalOnly([\"es7.array.flat-map\"]),\n fontcolor: globalOnly([\"es6.string.fontcolor\"]),\n fontsize: globalOnly([\"es6.string.fontsize\"]),\n forEach: globalOnly([\"es6.array.for-each\"]),\n includes: globalOnly([\"es6.string.includes\", \"es7.array.includes\"]),\n indexOf: globalOnly([\"es6.array.index-of\"]),\n italics: globalOnly([\"es6.string.italics\"]),\n keys: globalOnly(ArrayNatureIterators),\n lastIndexOf: globalOnly([\"es6.array.last-index-of\"]),\n link: globalOnly([\"es6.string.link\"]),\n map: globalOnly([\"es6.array.map\"]),\n match: globalOnly([\"es6.regexp.match\"]),\n name: globalOnly([\"es6.function.name\"]),\n padStart: globalOnly([\"es7.string.pad-start\"]),\n padEnd: globalOnly([\"es7.string.pad-end\"]),\n reduce: globalOnly([\"es6.array.reduce\"]),\n reduceRight: globalOnly([\"es6.array.reduce-right\"]),\n repeat: globalOnly([\"es6.string.repeat\"]),\n replace: globalOnly([\"es6.regexp.replace\"]),\n search: globalOnly([\"es6.regexp.search\"]),\n small: globalOnly([\"es6.string.small\"]),\n some: globalOnly([\"es6.array.some\"]),\n sort: globalOnly([\"es6.array.sort\"]),\n split: globalOnly([\"es6.regexp.split\"]),\n startsWith: globalOnly([\"es6.string.starts-with\"]),\n strike: globalOnly([\"es6.string.strike\"]),\n sub: globalOnly([\"es6.string.sub\"]),\n sup: globalOnly([\"es6.string.sup\"]),\n toISOString: globalOnly([\"es6.date.to-iso-string\"]),\n toJSON: globalOnly([\"es6.date.to-json\"]),\n toString: globalOnly([\n \"es6.object.to-string\",\n \"es6.date.to-string\",\n \"es6.regexp.to-string\",\n ]),\n trim: globalOnly([\"es6.string.trim\"]),\n trimEnd: globalOnly([\"es7.string.trim-right\"]),\n trimLeft: globalOnly([\"es7.string.trim-left\"]),\n trimRight: globalOnly([\"es7.string.trim-right\"]),\n trimStart: globalOnly([\"es7.string.trim-left\"]),\n values: globalOnly(ArrayNatureIterators),\n};\n\n// This isn't present in older @babel/compat-data versions\nif (\"es6.array.slice\" in corejs2Polyfills) {\n InstanceProperties.slice = globalOnly([\"es6.array.slice\"]);\n}\n\nexport const StaticProperties: ObjectMap<\n ObjectMap>\n> = {\n Array: {\n from: pureAndGlobal(\"array/from\", [\n \"es6.symbol\",\n \"es6.array.from\",\n ...CommonIterators,\n ]),\n isArray: pureAndGlobal(\"array/is-array\", [\"es6.array.is-array\"]),\n of: pureAndGlobal(\"array/of\", [\"es6.array.of\"]),\n },\n\n Date: {\n now: pureAndGlobal(\"date/now\", [\"es6.date.now\"]),\n },\n\n JSON: {\n stringify: pureOnly(\"json/stringify\", \"es6.symbol\"),\n },\n\n Math: {\n // 'Math' was not included in the 7.0.0\n // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616.\n acosh: pureAndGlobal(\"math/acosh\", [\"es6.math.acosh\"], \"7.0.1\"),\n asinh: pureAndGlobal(\"math/asinh\", [\"es6.math.asinh\"], \"7.0.1\"),\n atanh: pureAndGlobal(\"math/atanh\", [\"es6.math.atanh\"], \"7.0.1\"),\n cbrt: pureAndGlobal(\"math/cbrt\", [\"es6.math.cbrt\"], \"7.0.1\"),\n clz32: pureAndGlobal(\"math/clz32\", [\"es6.math.clz32\"], \"7.0.1\"),\n cosh: pureAndGlobal(\"math/cosh\", [\"es6.math.cosh\"], \"7.0.1\"),\n expm1: pureAndGlobal(\"math/expm1\", [\"es6.math.expm1\"], \"7.0.1\"),\n fround: pureAndGlobal(\"math/fround\", [\"es6.math.fround\"], \"7.0.1\"),\n hypot: pureAndGlobal(\"math/hypot\", [\"es6.math.hypot\"], \"7.0.1\"),\n imul: pureAndGlobal(\"math/imul\", [\"es6.math.imul\"], \"7.0.1\"),\n log1p: pureAndGlobal(\"math/log1p\", [\"es6.math.log1p\"], \"7.0.1\"),\n log10: pureAndGlobal(\"math/log10\", [\"es6.math.log10\"], \"7.0.1\"),\n log2: pureAndGlobal(\"math/log2\", [\"es6.math.log2\"], \"7.0.1\"),\n sign: pureAndGlobal(\"math/sign\", [\"es6.math.sign\"], \"7.0.1\"),\n sinh: pureAndGlobal(\"math/sinh\", [\"es6.math.sinh\"], \"7.0.1\"),\n tanh: pureAndGlobal(\"math/tanh\", [\"es6.math.tanh\"], \"7.0.1\"),\n trunc: pureAndGlobal(\"math/trunc\", [\"es6.math.trunc\"], \"7.0.1\"),\n },\n\n Number: {\n EPSILON: pureAndGlobal(\"number/epsilon\", [\"es6.number.epsilon\"]),\n MIN_SAFE_INTEGER: pureAndGlobal(\"number/min-safe-integer\", [\n \"es6.number.min-safe-integer\",\n ]),\n MAX_SAFE_INTEGER: pureAndGlobal(\"number/max-safe-integer\", [\n \"es6.number.max-safe-integer\",\n ]),\n isFinite: pureAndGlobal(\"number/is-finite\", [\"es6.number.is-finite\"]),\n isInteger: pureAndGlobal(\"number/is-integer\", [\"es6.number.is-integer\"]),\n isSafeInteger: pureAndGlobal(\"number/is-safe-integer\", [\n \"es6.number.is-safe-integer\",\n ]),\n isNaN: pureAndGlobal(\"number/is-nan\", [\"es6.number.is-nan\"]),\n parseFloat: pureAndGlobal(\"number/parse-float\", [\"es6.number.parse-float\"]),\n parseInt: pureAndGlobal(\"number/parse-int\", [\"es6.number.parse-int\"]),\n },\n\n Object: {\n assign: pureAndGlobal(\"object/assign\", [\"es6.object.assign\"]),\n create: pureAndGlobal(\"object/create\", [\"es6.object.create\"]),\n defineProperties: pureAndGlobal(\"object/define-properties\", [\n \"es6.object.define-properties\",\n ]),\n defineProperty: pureAndGlobal(\"object/define-property\", [\n \"es6.object.define-property\",\n ]),\n entries: pureAndGlobal(\"object/entries\", [\"es7.object.entries\"]),\n freeze: pureAndGlobal(\"object/freeze\", [\"es6.object.freeze\"]),\n getOwnPropertyDescriptor: pureAndGlobal(\n \"object/get-own-property-descriptor\",\n [\"es6.object.get-own-property-descriptor\"],\n ),\n getOwnPropertyDescriptors: pureAndGlobal(\n \"object/get-own-property-descriptors\",\n [\"es7.object.get-own-property-descriptors\"],\n ),\n getOwnPropertyNames: pureAndGlobal(\"object/get-own-property-names\", [\n \"es6.object.get-own-property-names\",\n ]),\n getOwnPropertySymbols: pureAndGlobal(\"object/get-own-property-symbols\", [\n \"es6.symbol\",\n ]),\n getPrototypeOf: pureAndGlobal(\"object/get-prototype-of\", [\n \"es6.object.get-prototype-of\",\n ]),\n is: pureAndGlobal(\"object/is\", [\"es6.object.is\"]),\n isExtensible: pureAndGlobal(\"object/is-extensible\", [\n \"es6.object.is-extensible\",\n ]),\n isFrozen: pureAndGlobal(\"object/is-frozen\", [\"es6.object.is-frozen\"]),\n isSealed: pureAndGlobal(\"object/is-sealed\", [\"es6.object.is-sealed\"]),\n keys: pureAndGlobal(\"object/keys\", [\"es6.object.keys\"]),\n preventExtensions: pureAndGlobal(\"object/prevent-extensions\", [\n \"es6.object.prevent-extensions\",\n ]),\n seal: pureAndGlobal(\"object/seal\", [\"es6.object.seal\"]),\n setPrototypeOf: pureAndGlobal(\"object/set-prototype-of\", [\n \"es6.object.set-prototype-of\",\n ]),\n values: pureAndGlobal(\"object/values\", [\"es7.object.values\"]),\n },\n\n Promise: {\n all: globalOnly(CommonIterators),\n race: globalOnly(CommonIterators),\n },\n\n Reflect: {\n apply: pureAndGlobal(\"reflect/apply\", [\"es6.reflect.apply\"]),\n construct: pureAndGlobal(\"reflect/construct\", [\"es6.reflect.construct\"]),\n defineProperty: pureAndGlobal(\"reflect/define-property\", [\n \"es6.reflect.define-property\",\n ]),\n deleteProperty: pureAndGlobal(\"reflect/delete-property\", [\n \"es6.reflect.delete-property\",\n ]),\n get: pureAndGlobal(\"reflect/get\", [\"es6.reflect.get\"]),\n getOwnPropertyDescriptor: pureAndGlobal(\n \"reflect/get-own-property-descriptor\",\n [\"es6.reflect.get-own-property-descriptor\"],\n ),\n getPrototypeOf: pureAndGlobal(\"reflect/get-prototype-of\", [\n \"es6.reflect.get-prototype-of\",\n ]),\n has: pureAndGlobal(\"reflect/has\", [\"es6.reflect.has\"]),\n isExtensible: pureAndGlobal(\"reflect/is-extensible\", [\n \"es6.reflect.is-extensible\",\n ]),\n ownKeys: pureAndGlobal(\"reflect/own-keys\", [\"es6.reflect.own-keys\"]),\n preventExtensions: pureAndGlobal(\"reflect/prevent-extensions\", [\n \"es6.reflect.prevent-extensions\",\n ]),\n set: pureAndGlobal(\"reflect/set\", [\"es6.reflect.set\"]),\n setPrototypeOf: pureAndGlobal(\"reflect/set-prototype-of\", [\n \"es6.reflect.set-prototype-of\",\n ]),\n },\n\n String: {\n at: pureOnly(\"string/at\", \"es7.string.at\"),\n fromCodePoint: pureAndGlobal(\"string/from-code-point\", [\n \"es6.string.from-code-point\",\n ]),\n raw: pureAndGlobal(\"string/raw\", [\"es6.string.raw\"]),\n },\n\n Symbol: {\n // FIXME: Pure disabled to work around zloirock/core-js#262.\n asyncIterator: globalOnly([\"es6.symbol\", \"es7.symbol.async-iterator\"]),\n for: pureOnly(\"symbol/for\", \"es6.symbol\"),\n hasInstance: pureOnly(\"symbol/has-instance\", \"es6.symbol\"),\n isConcatSpreadable: pureOnly(\"symbol/is-concat-spreadable\", \"es6.symbol\"),\n iterator: define(\"es6.symbol\", \"symbol/iterator\", CommonIterators),\n keyFor: pureOnly(\"symbol/key-for\", \"es6.symbol\"),\n match: pureAndGlobal(\"symbol/match\", [\"es6.regexp.match\"]),\n replace: pureOnly(\"symbol/replace\", \"es6.symbol\"),\n search: pureOnly(\"symbol/search\", \"es6.symbol\"),\n species: pureOnly(\"symbol/species\", \"es6.symbol\"),\n split: pureOnly(\"symbol/split\", \"es6.symbol\"),\n toPrimitive: pureOnly(\"symbol/to-primitive\", \"es6.symbol\"),\n toStringTag: pureOnly(\"symbol/to-string-tag\", \"es6.symbol\"),\n unscopables: pureOnly(\"symbol/unscopables\", \"es6.symbol\"),\n },\n};\n","import type { Targets } from \"@babel/helper-define-polyfill-provider\";\n\nconst webPolyfills = {\n \"web.timers\": {},\n \"web.immediate\": {},\n \"web.dom.iterable\": {},\n};\n\nconst purePolyfills = {\n \"es6.parse-float\": {},\n \"es6.parse-int\": {},\n \"es7.string.at\": {},\n};\n\nexport default function (targets: Targets, method: string, polyfills: any) {\n const targetNames = Object.keys(targets);\n const isAnyTarget = !targetNames.length;\n const isWebTarget = targetNames.some(name => name !== \"node\");\n\n return {\n ...polyfills,\n ...(method === \"usage-pure\" ? purePolyfills : null),\n ...(isAnyTarget || isWebTarget ? webPolyfills : null),\n };\n}\n","import semver from \"semver\";\n\nexport function hasMinVersion(\n minVersion?: string | null,\n runtimeVersion?: string | number | null,\n) {\n // If the range is unavailable, we're running the script during Babel's\n // build process, and we want to assume that all versions are satisfied so\n // that the built output will include all definitions.\n if (!runtimeVersion || !minVersion) return true;\n\n runtimeVersion = String(runtimeVersion);\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with preprelease versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revist the logic in\n // babel-core's availableHelper() API.\n if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;\n\n return (\n !semver.intersects(`<${minVersion}`, runtimeVersion) &&\n !semver.intersects(`>=8.0.0`, runtimeVersion)\n );\n}\n","import corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n CommonIterators,\n} from \"./built-in-definitions\";\nimport addPlatformSpecificPolyfills from \"./add-platform-specific-polyfills\";\nimport { hasMinVersion } from \"./helpers\";\n\nimport defineProvider from \"@babel/helper-define-polyfill-provider\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n\nconst BABEL_RUNTIME = \"@babel/runtime-corejs2\";\n\nconst presetEnvCompat = \"#__secret_key__@babel/preset-env__compatibility\";\nconst runtimeCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\nconst has = Function.call.bind(Object.hasOwnProperty);\n\ntype Options = {\n [presetEnvCompat]?: {\n entryInjectRegenerator: boolean;\n noRuntimeName: boolean;\n };\n [runtimeCompat]?: {\n useBabelRuntime: boolean;\n runtimeVersion: string;\n ext: string;\n };\n};\n\nexport default defineProvider(function (\n api,\n {\n [presetEnvCompat]: {\n entryInjectRegenerator = false,\n noRuntimeName = false,\n } = {},\n [runtimeCompat]: {\n useBabelRuntime = false,\n runtimeVersion = \"\",\n ext = \".js\",\n } = {},\n },\n) {\n const resolve = api.createMetaResolver({\n global: BuiltIns,\n static: StaticProperties,\n instance: InstanceProperties,\n });\n\n const { debug, shouldInjectPolyfill, method } = api;\n\n const polyfills = addPlatformSpecificPolyfills(\n api.targets,\n method,\n corejs2Polyfills,\n );\n\n const coreJSBase = useBabelRuntime\n ? `${BABEL_RUNTIME}/core-js`\n : method === \"usage-pure\"\n ? \"core-js/library/fn\"\n : \"core-js/modules\";\n\n function inject(name: string | string[], utils) {\n if (typeof name === \"string\") {\n // Some polyfills aren't always available, for example\n // web.dom.iterable when targeting node\n if (has(polyfills, name) && shouldInjectPolyfill(name)) {\n debug(name);\n utils.injectGlobalImport(`${coreJSBase}/${name}.js`);\n }\n return;\n }\n\n name.forEach(name => inject(name, utils));\n }\n\n function maybeInjectPure(desc, hint, utils) {\n let { pure, meta, name } = desc;\n\n if (!pure || !shouldInjectPolyfill(name)) return;\n\n if (\n runtimeVersion &&\n meta &&\n meta.minRuntimeVersion &&\n !hasMinVersion(meta && meta.minRuntimeVersion, runtimeVersion)\n ) {\n return;\n }\n\n // Unfortunately core-js and @babel/runtime-corejs2 don't have the same\n // directory structure, so we need to special case this.\n if (useBabelRuntime && pure === \"symbol/index\") pure = \"symbol\";\n\n return utils.injectDefaultImport(`${coreJSBase}/${pure}${ext}`, hint);\n }\n\n return {\n name: \"corejs2\",\n\n runtimeName: noRuntimeName ? null : BABEL_RUNTIME,\n\n polyfills,\n\n entryGlobal(meta, utils, path) {\n if (meta.kind === \"import\" && meta.source === \"core-js\") {\n debug(null);\n\n inject(Object.keys(polyfills), utils);\n\n if (entryInjectRegenerator) {\n utils.injectGlobalImport(\"regenerator-runtime/runtime.js\");\n }\n\n path.remove();\n }\n },\n\n usageGlobal(meta, utils): undefined {\n const resolved = resolve(meta);\n if (!resolved) return;\n\n let deps = resolved.desc.global;\n\n if (\n resolved.kind !== \"global\" &&\n \"object\" in meta &&\n meta.object &&\n meta.placement === \"prototype\"\n ) {\n const low = meta.object.toLowerCase();\n deps = deps.filter(m => m.includes(low));\n }\n\n inject(deps, utils);\n },\n\n usagePure(meta, utils, path) {\n if (meta.kind === \"in\") {\n if (meta.key === \"Symbol.iterator\") {\n path.replaceWith(\n t.callExpression(\n utils.injectDefaultImport(\n `${coreJSBase}/is-iterable${ext}`,\n \"isIterable\",\n ),\n [(path.node as t.BinaryExpression).right], // meta.kind === \"in\" narrows this\n ),\n );\n }\n\n return;\n }\n\n if (path.parentPath.isUnaryExpression({ operator: \"delete\" })) return;\n\n if (meta.kind === \"property\") {\n // We can't compile destructuring.\n if (!path.isMemberExpression()) return;\n if (!path.isReferenced()) return;\n\n if (\n meta.key === \"Symbol.iterator\" &&\n shouldInjectPolyfill(\"es6.symbol\") &&\n path.parentPath.isCallExpression({ callee: path.node }) &&\n path.parentPath.node.arguments.length === 0\n ) {\n path.parentPath.replaceWith(\n t.callExpression(\n utils.injectDefaultImport(\n `${coreJSBase}/get-iterator${ext}`,\n \"getIterator\",\n ),\n [path.node.object],\n ),\n );\n path.skip();\n\n return;\n }\n }\n\n const resolved = resolve(meta);\n if (!resolved) return;\n\n const id = maybeInjectPure(resolved.desc, resolved.name, utils);\n if (id) path.replaceWith(id);\n },\n\n visitor: method === \"usage-global\" && {\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n inject(\"web.dom.iterable\", api.getUtils(path));\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"(\n path: NodePath,\n ) {\n CommonIterators.forEach(name => inject(name, api.getUtils(path)));\n },\n },\n };\n});\n"],"names":["define","name","pure","global","meta","pureAndGlobal","minRuntimeVersion","globalOnly","pureOnly","ArrayNatureIterators","CommonIterators","PromiseDependencies","BuiltIns","DataView","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Map","Number","Promise","RegExp","Set","Symbol","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","WeakSet","setImmediate","clearImmediate","parseFloat","parseInt","InstanceProperties","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","anchor","big","bind","blink","bold","codePointAt","copyWithin","endsWith","entries","every","fill","filter","finally","find","findIndex","fixed","flags","flatMap","fontcolor","fontsize","forEach","includes","indexOf","italics","keys","lastIndexOf","link","map","match","padStart","padEnd","reduce","reduceRight","repeat","replace","search","small","some","sort","split","startsWith","strike","sub","sup","toISOString","toJSON","toString","trim","trimEnd","trimLeft","trimRight","trimStart","values","corejs2Polyfills","slice","StaticProperties","Array","from","isArray","of","Date","now","JSON","stringify","Math","acosh","asinh","atanh","cbrt","clz32","cosh","expm1","fround","hypot","imul","log1p","log10","log2","sign","sinh","tanh","trunc","EPSILON","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","isFinite","isInteger","isSafeInteger","isNaN","Object","assign","create","defineProperties","defineProperty","freeze","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","is","isExtensible","isFrozen","isSealed","preventExtensions","seal","setPrototypeOf","all","race","Reflect","apply","construct","deleteProperty","get","has","ownKeys","set","String","at","fromCodePoint","raw","asyncIterator","for","hasInstance","isConcatSpreadable","iterator","keyFor","species","toPrimitive","toStringTag","unscopables","webPolyfills","purePolyfills","targets","method","polyfills","targetNames","isAnyTarget","length","isWebTarget","hasMinVersion","minVersion","runtimeVersion","semver","valid","intersects","types","t","_babel","default","BABEL_RUNTIME","presetEnvCompat","runtimeCompat","Function","call","hasOwnProperty","defineProvider","api","entryInjectRegenerator","noRuntimeName","useBabelRuntime","ext","resolve","createMetaResolver","static","instance","debug","shouldInjectPolyfill","addPlatformSpecificPolyfills","coreJSBase","inject","utils","injectGlobalImport","maybeInjectPure","desc","hint","injectDefaultImport","runtimeName","entryGlobal","path","kind","source","remove","usageGlobal","resolved","deps","object","placement","low","toLowerCase","m","usagePure","key","replaceWith","callExpression","node","right","parentPath","isUnaryExpression","operator","isMemberExpression","isReferenced","isCallExpression","callee","arguments","skip","id","visitor","YieldExpression","delegate","getUtils","ForOfStatement|ArrayPattern"],"mappings":";;;;;AAeA,MAAMA,MAAM,GAAGA,CACbC,IAAY,EACZC,IAAoB,EACpBC,MAAgB,GAAG,EAAE,EACrBC,IAAe,KACW;EAC1B,OAAO;IAAEH,IAAI;IAAEC,IAAI;IAAEC,MAAM;AAAEC,IAAAA,IAAAA;GAAM,CAAA;AACrC,CAAC,CAAA;AAED,MAAMC,aAAa,GAAGA,CACpBH,IAAY,EACZC,MAAgB,EAChBG,iBAAgC,GAAG,IAAI,KACpCN,MAAM,CAAcG,MAAM,CAAC,CAAC,CAAC,EAAED,IAAI,EAAEC,MAAM,EAAE;AAAEG,EAAAA,iBAAAA;AAAkB,CAAC,CAAC,CAAA;AAExE,MAAMC,UAAU,GAAIJ,MAAgB,IAClCH,MAAM,CAAcG,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAEA,MAAM,CAAC,CAAA;AAE9C,MAAMK,QAAQ,GAAGA,CAACN,IAAY,EAAED,IAAY,KAC1CD,MAAM,CAAcC,IAAI,EAAEC,IAAI,EAAE,EAAE,CAAC,CAAA;AAErC,MAAMO,oBAAoB,GAAG,CAC3B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,CACnB,CAAA;AAEM,MAAMC,eAAe,GAAG,CAAC,qBAAqB,EAAE,GAAGD,oBAAoB,CAAC,CAAA;AAE/E,MAAME,mBAAmB,GAAG,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAA;AAE5D,MAAMC,QAAoD,GAAG;AAClEC,EAAAA,QAAQ,EAAEN,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAC7CO,EAAAA,YAAY,EAAEP,UAAU,CAAC,CAAC,yBAAyB,CAAC,CAAC;AACrDQ,EAAAA,YAAY,EAAER,UAAU,CAAC,CAAC,yBAAyB,CAAC,CAAC;AACrDS,EAAAA,SAAS,EAAET,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC/CU,EAAAA,UAAU,EAAEV,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;AACjDW,EAAAA,UAAU,EAAEX,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;EACjDY,GAAG,EAAEd,aAAa,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,GAAGK,eAAe,CAAC,CAAC;AAC1DU,EAAAA,MAAM,EAAEb,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;AAC9Cc,EAAAA,OAAO,EAAEhB,aAAa,CAAC,SAAS,EAAEM,mBAAmB,CAAC;AACtDW,EAAAA,MAAM,EAAEf,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;EAC9CgB,GAAG,EAAElB,aAAa,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,GAAGK,eAAe,CAAC,CAAC;EAC1Dc,MAAM,EAAEnB,aAAa,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC;AACrDoB,EAAAA,UAAU,EAAElB,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;AACjDmB,EAAAA,iBAAiB,EAAEnB,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC;AAChEoB,EAAAA,WAAW,EAAEpB,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;AACnDqB,EAAAA,WAAW,EAAErB,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;EACnDsB,OAAO,EAAExB,aAAa,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,GAAGK,eAAe,CAAC,CAAC;EACxEoB,OAAO,EAAEzB,aAAa,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,GAAGK,eAAe,CAAC,CAAC;AAExEqB,EAAAA,YAAY,EAAEvB,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;AACxDwB,EAAAA,cAAc,EAAExB,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC;AAC5DyB,EAAAA,UAAU,EAAEzB,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;AACtD0B,EAAAA,QAAQ,EAAE1B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAA;AACjD,CAAC,CAAA;AAEM,MAAM2B,kBAA8D,GAAG;AAC5EC,EAAAA,gBAAgB,EAAE7B,UAAU,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAC1D8B,EAAAA,gBAAgB,EAAE9B,UAAU,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAC1D+B,EAAAA,gBAAgB,EAAE/B,UAAU,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAC1DgC,EAAAA,gBAAgB,EAAEhC,UAAU,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAC1DiC,EAAAA,MAAM,EAAEjC,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACzCkC,EAAAA,GAAG,EAAElC,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACnCmC,EAAAA,IAAI,EAAEnC,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACvCoC,EAAAA,KAAK,EAAEpC,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCqC,EAAAA,IAAI,EAAErC,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;AACrCsC,EAAAA,WAAW,EAAEtC,UAAU,CAAC,CAAC,0BAA0B,CAAC,CAAC;AACrDuC,EAAAA,UAAU,EAAEvC,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;AACjDwC,EAAAA,QAAQ,EAAExC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9CyC,EAAAA,OAAO,EAAEzC,UAAU,CAACE,oBAAoB,CAAC;AACzCwC,EAAAA,KAAK,EAAE1C,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;AACtC2C,EAAAA,IAAI,EAAE3C,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACpC4C,EAAAA,MAAM,EAAE5C,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;EACxC6C,OAAO,EAAE7C,UAAU,CAAC,CAAC,qBAAqB,EAAE,GAAGI,mBAAmB,CAAC,CAAC;AACpE0C,EAAAA,IAAI,EAAE9C,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACpC+C,EAAAA,SAAS,EAAE/C,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC/CgD,EAAAA,KAAK,EAAEhD,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCiD,EAAAA,KAAK,EAAEjD,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCkD,EAAAA,OAAO,EAAElD,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC3CmD,EAAAA,SAAS,EAAEnD,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC/CoD,EAAAA,QAAQ,EAAEpD,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAC7CqD,EAAAA,OAAO,EAAErD,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;EAC3CsD,QAAQ,EAAEtD,UAAU,CAAC,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AACnEuD,EAAAA,OAAO,EAAEvD,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC3CwD,EAAAA,OAAO,EAAExD,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC3CyD,EAAAA,IAAI,EAAEzD,UAAU,CAACE,oBAAoB,CAAC;AACtCwD,EAAAA,WAAW,EAAE1D,UAAU,CAAC,CAAC,yBAAyB,CAAC,CAAC;AACpD2D,EAAAA,IAAI,EAAE3D,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;AACrC4D,EAAAA,GAAG,EAAE5D,UAAU,CAAC,CAAC,eAAe,CAAC,CAAC;AAClC6D,EAAAA,KAAK,EAAE7D,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCN,EAAAA,IAAI,EAAEM,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACvC8D,EAAAA,QAAQ,EAAE9D,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9C+D,EAAAA,MAAM,EAAE/D,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC1CgE,EAAAA,MAAM,EAAEhE,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACxCiE,EAAAA,WAAW,EAAEjE,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;AACnDkE,EAAAA,MAAM,EAAElE,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACzCmE,EAAAA,OAAO,EAAEnE,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC3CoE,EAAAA,MAAM,EAAEpE,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACzCqE,EAAAA,KAAK,EAAErE,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCsE,EAAAA,IAAI,EAAEtE,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACpCuE,EAAAA,IAAI,EAAEvE,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACpCwE,EAAAA,KAAK,EAAExE,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvCyE,EAAAA,UAAU,EAAEzE,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;AAClD0E,EAAAA,MAAM,EAAE1E,UAAU,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACzC2E,EAAAA,GAAG,EAAE3E,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACnC4E,EAAAA,GAAG,EAAE5E,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACnC6E,EAAAA,WAAW,EAAE7E,UAAU,CAAC,CAAC,wBAAwB,CAAC,CAAC;AACnD8E,EAAAA,MAAM,EAAE9E,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;EACxC+E,QAAQ,EAAE/E,UAAU,CAAC,CACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,CACvB,CAAC;AACFgF,EAAAA,IAAI,EAAEhF,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;AACrCiF,EAAAA,OAAO,EAAEjF,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;AAC9CkF,EAAAA,QAAQ,EAAElF,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9CmF,EAAAA,SAAS,EAAEnF,UAAU,CAAC,CAAC,uBAAuB,CAAC,CAAC;AAChDoF,EAAAA,SAAS,EAAEpF,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;EAC/CqF,MAAM,EAAErF,UAAU,CAACE,oBAAoB,CAAA;AACzC,CAAC,CAAA;;AAED;AACA,IAAI,iBAAiB,IAAIoF,gBAAgB,EAAE;EACzC1D,kBAAkB,CAAC2D,KAAK,GAAGvF,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAC5D,CAAA;AAEO,MAAMwF,gBAEZ,GAAG;AACFC,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE5F,aAAa,CAAC,YAAY,EAAE,CAChC,YAAY,EACZ,gBAAgB,EAChB,GAAGK,eAAe,CACnB,CAAC;IACFwF,OAAO,EAAE7F,aAAa,CAAC,gBAAgB,EAAE,CAAC,oBAAoB,CAAC,CAAC;AAChE8F,IAAAA,EAAE,EAAE9F,aAAa,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,CAAA;GAC/C;AAED+F,EAAAA,IAAI,EAAE;AACJC,IAAAA,GAAG,EAAEhG,aAAa,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,CAAA;GAChD;AAEDiG,EAAAA,IAAI,EAAE;AACJC,IAAAA,SAAS,EAAE/F,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAA;GACnD;AAEDgG,EAAAA,IAAI,EAAE;AACJ;AACA;IACAC,KAAK,EAAEpG,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/DqG,KAAK,EAAErG,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/DsG,KAAK,EAAEtG,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/DuG,IAAI,EAAEvG,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5DwG,KAAK,EAAExG,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/DyG,IAAI,EAAEzG,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5D0G,KAAK,EAAE1G,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/D2G,MAAM,EAAE3G,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAClE4G,KAAK,EAAE5G,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/D6G,IAAI,EAAE7G,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5D8G,KAAK,EAAE9G,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/D+G,KAAK,EAAE/G,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC/DgH,IAAI,EAAEhH,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5DiH,IAAI,EAAEjH,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5DkH,IAAI,EAAElH,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5DmH,IAAI,EAAEnH,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5DoH,KAAK,EAAEpH,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;GAC/D;AAEDe,EAAAA,MAAM,EAAE;IACNsG,OAAO,EAAErH,aAAa,CAAC,gBAAgB,EAAE,CAAC,oBAAoB,CAAC,CAAC;IAChEsH,gBAAgB,EAAEtH,aAAa,CAAC,yBAAyB,EAAE,CACzD,6BAA6B,CAC9B,CAAC;IACFuH,gBAAgB,EAAEvH,aAAa,CAAC,yBAAyB,EAAE,CACzD,6BAA6B,CAC9B,CAAC;IACFwH,QAAQ,EAAExH,aAAa,CAAC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACrEyH,SAAS,EAAEzH,aAAa,CAAC,mBAAmB,EAAE,CAAC,uBAAuB,CAAC,CAAC;IACxE0H,aAAa,EAAE1H,aAAa,CAAC,wBAAwB,EAAE,CACrD,4BAA4B,CAC7B,CAAC;IACF2H,KAAK,EAAE3H,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC5D4B,UAAU,EAAE5B,aAAa,CAAC,oBAAoB,EAAE,CAAC,wBAAwB,CAAC,CAAC;AAC3E6B,IAAAA,QAAQ,EAAE7B,aAAa,CAAC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC,CAAA;GACrE;AAED4H,EAAAA,MAAM,EAAE;IACNC,MAAM,EAAE7H,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC7D8H,MAAM,EAAE9H,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC7D+H,gBAAgB,EAAE/H,aAAa,CAAC,0BAA0B,EAAE,CAC1D,8BAA8B,CAC/B,CAAC;IACFgI,cAAc,EAAEhI,aAAa,CAAC,wBAAwB,EAAE,CACtD,4BAA4B,CAC7B,CAAC;IACF2C,OAAO,EAAE3C,aAAa,CAAC,gBAAgB,EAAE,CAAC,oBAAoB,CAAC,CAAC;IAChEiI,MAAM,EAAEjI,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC7DkI,wBAAwB,EAAElI,aAAa,CACrC,oCAAoC,EACpC,CAAC,wCAAwC,CAC3C,CAAC;IACDmI,yBAAyB,EAAEnI,aAAa,CACtC,qCAAqC,EACrC,CAAC,yCAAyC,CAC5C,CAAC;IACDoI,mBAAmB,EAAEpI,aAAa,CAAC,+BAA+B,EAAE,CAClE,mCAAmC,CACpC,CAAC;IACFqI,qBAAqB,EAAErI,aAAa,CAAC,iCAAiC,EAAE,CACtE,YAAY,CACb,CAAC;IACFsI,cAAc,EAAEtI,aAAa,CAAC,yBAAyB,EAAE,CACvD,6BAA6B,CAC9B,CAAC;IACFuI,EAAE,EAAEvI,aAAa,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,CAAC;IACjDwI,YAAY,EAAExI,aAAa,CAAC,sBAAsB,EAAE,CAClD,0BAA0B,CAC3B,CAAC;IACFyI,QAAQ,EAAEzI,aAAa,CAAC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACrE0I,QAAQ,EAAE1I,aAAa,CAAC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACrE2D,IAAI,EAAE3D,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACvD2I,iBAAiB,EAAE3I,aAAa,CAAC,2BAA2B,EAAE,CAC5D,+BAA+B,CAChC,CAAC;IACF4I,IAAI,EAAE5I,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACvD6I,cAAc,EAAE7I,aAAa,CAAC,yBAAyB,EAAE,CACvD,6BAA6B,CAC9B,CAAC;AACFuF,IAAAA,MAAM,EAAEvF,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAA;GAC7D;AAEDgB,EAAAA,OAAO,EAAE;AACP8H,IAAAA,GAAG,EAAE5I,UAAU,CAACG,eAAe,CAAC;IAChC0I,IAAI,EAAE7I,UAAU,CAACG,eAAe,CAAA;GACjC;AAED2I,EAAAA,OAAO,EAAE;IACPC,KAAK,EAAEjJ,aAAa,CAAC,eAAe,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC5DkJ,SAAS,EAAElJ,aAAa,CAAC,mBAAmB,EAAE,CAAC,uBAAuB,CAAC,CAAC;IACxEgI,cAAc,EAAEhI,aAAa,CAAC,yBAAyB,EAAE,CACvD,6BAA6B,CAC9B,CAAC;IACFmJ,cAAc,EAAEnJ,aAAa,CAAC,yBAAyB,EAAE,CACvD,6BAA6B,CAC9B,CAAC;IACFoJ,GAAG,EAAEpJ,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACtDkI,wBAAwB,EAAElI,aAAa,CACrC,qCAAqC,EACrC,CAAC,yCAAyC,CAC5C,CAAC;IACDsI,cAAc,EAAEtI,aAAa,CAAC,0BAA0B,EAAE,CACxD,8BAA8B,CAC/B,CAAC;IACFqJ,GAAG,EAAErJ,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACtDwI,YAAY,EAAExI,aAAa,CAAC,uBAAuB,EAAE,CACnD,2BAA2B,CAC5B,CAAC;IACFsJ,OAAO,EAAEtJ,aAAa,CAAC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACpE2I,iBAAiB,EAAE3I,aAAa,CAAC,4BAA4B,EAAE,CAC7D,gCAAgC,CACjC,CAAC;IACFuJ,GAAG,EAAEvJ,aAAa,CAAC,aAAa,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACtD6I,IAAAA,cAAc,EAAE7I,aAAa,CAAC,0BAA0B,EAAE,CACxD,8BAA8B,CAC/B,CAAA;GACF;AAEDwJ,EAAAA,MAAM,EAAE;AACNC,IAAAA,EAAE,EAAEtJ,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IAC1CuJ,aAAa,EAAE1J,aAAa,CAAC,wBAAwB,EAAE,CACrD,4BAA4B,CAC7B,CAAC;AACF2J,IAAAA,GAAG,EAAE3J,aAAa,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,CAAA;GACpD;AAEDmB,EAAAA,MAAM,EAAE;AACN;IACAyI,aAAa,EAAE1J,UAAU,CAAC,CAAC,YAAY,EAAE,2BAA2B,CAAC,CAAC;AACtE2J,IAAAA,GAAG,EAAE1J,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;AACzC2J,IAAAA,WAAW,EAAE3J,QAAQ,CAAC,qBAAqB,EAAE,YAAY,CAAC;AAC1D4J,IAAAA,kBAAkB,EAAE5J,QAAQ,CAAC,6BAA6B,EAAE,YAAY,CAAC;IACzE6J,QAAQ,EAAErK,MAAM,CAAC,YAAY,EAAE,iBAAiB,EAAEU,eAAe,CAAC;AAClE4J,IAAAA,MAAM,EAAE9J,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC;IAChD4D,KAAK,EAAE/D,aAAa,CAAC,cAAc,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAC1DqE,IAAAA,OAAO,EAAElE,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC;AACjDmE,IAAAA,MAAM,EAAEnE,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC;AAC/C+J,IAAAA,OAAO,EAAE/J,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC;AACjDuE,IAAAA,KAAK,EAAEvE,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;AAC7CgK,IAAAA,WAAW,EAAEhK,QAAQ,CAAC,qBAAqB,EAAE,YAAY,CAAC;AAC1DiK,IAAAA,WAAW,EAAEjK,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC;AAC3DkK,IAAAA,WAAW,EAAElK,QAAQ,CAAC,oBAAoB,EAAE,YAAY,CAAA;AAC1D,GAAA;AACF,CAAC;;ACnTD,MAAMmK,YAAY,GAAG;EACnB,YAAY,EAAE,EAAE;EAChB,eAAe,EAAE,EAAE;AACnB,EAAA,kBAAkB,EAAE,EAAC;AACvB,CAAC,CAAA;AAED,MAAMC,aAAa,GAAG;EACpB,iBAAiB,EAAE,EAAE;EACrB,eAAe,EAAE,EAAE;AACnB,EAAA,eAAe,EAAE,EAAC;AACpB,CAAC,CAAA;AAEc,uCAAUC,OAAgB,EAAEC,MAAc,EAAEC,SAAc,EAAE;AACzE,EAAA,MAAMC,WAAW,GAAG/C,MAAM,CAACjE,IAAI,CAAC6G,OAAO,CAAC,CAAA;AACxC,EAAA,MAAMI,WAAW,GAAG,CAACD,WAAW,CAACE,MAAM,CAAA;EACvC,MAAMC,WAAW,GAAGH,WAAW,CAACnG,IAAI,CAAC5E,IAAI,IAAIA,IAAI,KAAK,MAAM,CAAC,CAAA;EAE7D,OAAO;AACL,IAAA,GAAG8K,SAAS;AACZ,IAAA,IAAID,MAAM,KAAK,YAAY,GAAGF,aAAa,GAAG,IAAI,CAAC;AACnD,IAAA,IAAIK,WAAW,IAAIE,WAAW,GAAGR,YAAY,GAAG,IAAI,CAAA;GACrD,CAAA;AACH;;ACtBO,SAASS,aAAaA,CAC3BC,UAA0B,EAC1BC,cAAuC,EACvC;AACA;AACA;AACA;AACA,EAAA,IAAI,CAACA,cAAc,IAAI,CAACD,UAAU,EAAE,OAAO,IAAI,CAAA;AAE/CC,EAAAA,cAAc,GAAGzB,MAAM,CAACyB,cAAc,CAAC,CAAA;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACA,IAAIC,MAAM,CAACC,KAAK,CAACF,cAAc,CAAC,EAAEA,cAAc,GAAG,CAAIA,CAAAA,EAAAA,cAAc,CAAE,CAAA,CAAA;EAEvE,OACE,CAACC,MAAM,CAACE,UAAU,CAAC,CAAIJ,CAAAA,EAAAA,UAAU,EAAE,EAAEC,cAAc,CAAC,IACpD,CAACC,MAAM,CAACE,UAAU,CAAC,CAAS,OAAA,CAAA,EAAEH,cAAc,CAAC,CAAA;AAEjD;;AC1BoE,MAAA;AAE3DI,EAAAA,KAAK,EAAIC,CAAAA;AAAC,CAAA,GAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA,CAAA;AAEnB,MAAME,aAAa,GAAG,wBAAwB,CAAA;AAE9C,MAAMC,eAAe,GAAG,iDAAiD,CAAA;AACzE,MAAMC,aAAa,GAAG,8CAA8C,CAAA;AAEpE,MAAMtC,GAAG,GAAGuC,QAAQ,CAACC,IAAI,CAACxJ,IAAI,CAACuF,MAAM,CAACkE,cAAc,CAAC,CAAA;AAcrD,YAAeC,cAAc,CAAU,UACrCC,GAAG,EACH;AACE,EAAA,CAACN,eAAe,GAAG;AACjBO,IAAAA,sBAAsB,GAAG,KAAK;AAC9BC,IAAAA,aAAa,GAAG,KAAA;GACjB,GAAG,EAAE;AACN,EAAA,CAACP,aAAa,GAAG;AACfQ,IAAAA,eAAe,GAAG,KAAK;AACvBlB,IAAAA,cAAc,GAAG,EAAE;AACnBmB,IAAAA,GAAG,GAAG,KAAA;AACR,GAAC,GAAG,EAAC;AACP,CAAC,EACD;AACA,EAAA,MAAMC,OAAO,GAAGL,GAAG,CAACM,kBAAkB,CAAC;AACrCxM,IAAAA,MAAM,EAAES,QAAQ;AAChBgM,IAAAA,MAAM,EAAE7G,gBAAgB;AACxB8G,IAAAA,QAAQ,EAAE1K,kBAAAA;AACZ,GAAC,CAAC,CAAA;EAEF,MAAM;IAAE2K,KAAK;IAAEC,oBAAoB;AAAEjC,IAAAA,MAAAA;AAAO,GAAC,GAAGuB,GAAG,CAAA;EAEnD,MAAMtB,SAAS,GAAGiC,4BAA4B,CAC5CX,GAAG,CAACxB,OAAO,EACXC,MAAM,EACNjF,gBACF,CAAC,CAAA;AAED,EAAA,MAAMoH,UAAU,GAAGT,eAAe,GAC9B,GAAGV,aAAa,CAAA,QAAA,CAAU,GAC1BhB,MAAM,KAAK,YAAY,GACrB,oBAAoB,GACpB,iBAAiB,CAAA;AAEvB,EAAA,SAASoC,MAAMA,CAACjN,IAAuB,EAAEkN,KAAK,EAAE;AAC9C,IAAA,IAAI,OAAOlN,IAAI,KAAK,QAAQ,EAAE;AAC5B;AACA;MACA,IAAIyJ,GAAG,CAACqB,SAAS,EAAE9K,IAAI,CAAC,IAAI8M,oBAAoB,CAAC9M,IAAI,CAAC,EAAE;QACtD6M,KAAK,CAAC7M,IAAI,CAAC,CAAA;QACXkN,KAAK,CAACC,kBAAkB,CAAC,CAAA,EAAGH,UAAU,CAAIhN,CAAAA,EAAAA,IAAI,KAAK,CAAC,CAAA;AACtD,OAAA;AACA,MAAA,OAAA;AACF,KAAA;IAEAA,IAAI,CAAC2D,OAAO,CAAC3D,IAAI,IAAIiN,MAAM,CAACjN,IAAI,EAAEkN,KAAK,CAAC,CAAC,CAAA;AAC3C,GAAA;AAEA,EAAA,SAASE,eAAeA,CAACC,IAAI,EAAEC,IAAI,EAAEJ,KAAK,EAAE;IAC1C,IAAI;MAAEjN,IAAI;MAAEE,IAAI;AAAEH,MAAAA,IAAAA;AAAK,KAAC,GAAGqN,IAAI,CAAA;IAE/B,IAAI,CAACpN,IAAI,IAAI,CAAC6M,oBAAoB,CAAC9M,IAAI,CAAC,EAAE,OAAA;AAE1C,IAAA,IACEqL,cAAc,IACdlL,IAAI,IACJA,IAAI,CAACE,iBAAiB,IACtB,CAAC8K,aAAa,CAAChL,IAAI,IAAIA,IAAI,CAACE,iBAAiB,EAAEgL,cAAc,CAAC,EAC9D;AACA,MAAA,OAAA;AACF,KAAA;;AAEA;AACA;IACA,IAAIkB,eAAe,IAAItM,IAAI,KAAK,cAAc,EAAEA,IAAI,GAAG,QAAQ,CAAA;AAE/D,IAAA,OAAOiN,KAAK,CAACK,mBAAmB,CAAC,CAAGP,EAAAA,UAAU,CAAI/M,CAAAA,EAAAA,IAAI,CAAGuM,EAAAA,GAAG,CAAE,CAAA,EAAEc,IAAI,CAAC,CAAA;AACvE,GAAA;EAEA,OAAO;AACLtN,IAAAA,IAAI,EAAE,SAAS;AAEfwN,IAAAA,WAAW,EAAElB,aAAa,GAAG,IAAI,GAAGT,aAAa;IAEjDf,SAAS;AAET2C,IAAAA,WAAWA,CAACtN,IAAI,EAAE+M,KAAK,EAAEQ,IAAI,EAAE;MAC7B,IAAIvN,IAAI,CAACwN,IAAI,KAAK,QAAQ,IAAIxN,IAAI,CAACyN,MAAM,KAAK,SAAS,EAAE;QACvDf,KAAK,CAAC,IAAI,CAAC,CAAA;QAEXI,MAAM,CAACjF,MAAM,CAACjE,IAAI,CAAC+G,SAAS,CAAC,EAAEoC,KAAK,CAAC,CAAA;AAErC,QAAA,IAAIb,sBAAsB,EAAE;AAC1Ba,UAAAA,KAAK,CAACC,kBAAkB,CAAC,gCAAgC,CAAC,CAAA;AAC5D,SAAA;QAEAO,IAAI,CAACG,MAAM,EAAE,CAAA;AACf,OAAA;KACD;AAEDC,IAAAA,WAAWA,CAAC3N,IAAI,EAAE+M,KAAK,EAAa;AAClC,MAAA,MAAMa,QAAQ,GAAGtB,OAAO,CAACtM,IAAI,CAAC,CAAA;MAC9B,IAAI,CAAC4N,QAAQ,EAAE,OAAA;AAEf,MAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACV,IAAI,CAACnN,MAAM,CAAA;AAE/B,MAAA,IACE6N,QAAQ,CAACJ,IAAI,KAAK,QAAQ,IAC1B,QAAQ,IAAIxN,IAAI,IAChBA,IAAI,CAAC8N,MAAM,IACX9N,IAAI,CAAC+N,SAAS,KAAK,WAAW,EAC9B;QACA,MAAMC,GAAG,GAAGhO,IAAI,CAAC8N,MAAM,CAACG,WAAW,EAAE,CAAA;AACrCJ,QAAAA,IAAI,GAAGA,IAAI,CAAC9K,MAAM,CAACmL,CAAC,IAAIA,CAAC,CAACzK,QAAQ,CAACuK,GAAG,CAAC,CAAC,CAAA;AAC1C,OAAA;AAEAlB,MAAAA,MAAM,CAACe,IAAI,EAAEd,KAAK,CAAC,CAAA;KACpB;AAEDoB,IAAAA,SAASA,CAACnO,IAAI,EAAE+M,KAAK,EAAEQ,IAAI,EAAE;AAC3B,MAAA,IAAIvN,IAAI,CAACwN,IAAI,KAAK,IAAI,EAAE;AACtB,QAAA,IAAIxN,IAAI,CAACoO,GAAG,KAAK,iBAAiB,EAAE;UAClCb,IAAI,CAACc,WAAW,CACd9C,CAAC,CAAC+C,cAAc,CACdvB,KAAK,CAACK,mBAAmB,CACvB,CAAGP,EAAAA,UAAU,CAAeR,YAAAA,EAAAA,GAAG,CAAE,CAAA,EACjC,YACF,CAAC,EACD,CAAEkB,IAAI,CAACgB,IAAI,CAAwBC,KAAK,CAAC;AAC3C,WACF,CAAC,CAAA;AACH,SAAA;AAEA,QAAA,OAAA;AACF,OAAA;AAEA,MAAA,IAAIjB,IAAI,CAACkB,UAAU,CAACC,iBAAiB,CAAC;AAAEC,QAAAA,QAAQ,EAAE,QAAA;AAAS,OAAC,CAAC,EAAE,OAAA;AAE/D,MAAA,IAAI3O,IAAI,CAACwN,IAAI,KAAK,UAAU,EAAE;AAC5B;AACA,QAAA,IAAI,CAACD,IAAI,CAACqB,kBAAkB,EAAE,EAAE,OAAA;AAChC,QAAA,IAAI,CAACrB,IAAI,CAACsB,YAAY,EAAE,EAAE,OAAA;AAE1B,QAAA,IACE7O,IAAI,CAACoO,GAAG,KAAK,iBAAiB,IAC9BzB,oBAAoB,CAAC,YAAY,CAAC,IAClCY,IAAI,CAACkB,UAAU,CAACK,gBAAgB,CAAC;UAAEC,MAAM,EAAExB,IAAI,CAACgB,IAAAA;AAAK,SAAC,CAAC,IACvDhB,IAAI,CAACkB,UAAU,CAACF,IAAI,CAACS,SAAS,CAAClE,MAAM,KAAK,CAAC,EAC3C;AACAyC,UAAAA,IAAI,CAACkB,UAAU,CAACJ,WAAW,CACzB9C,CAAC,CAAC+C,cAAc,CACdvB,KAAK,CAACK,mBAAmB,CACvB,CAAGP,EAAAA,UAAU,CAAgBR,aAAAA,EAAAA,GAAG,CAAE,CAAA,EAClC,aACF,CAAC,EACD,CAACkB,IAAI,CAACgB,IAAI,CAACT,MAAM,CACnB,CACF,CAAC,CAAA;UACDP,IAAI,CAAC0B,IAAI,EAAE,CAAA;AAEX,UAAA,OAAA;AACF,SAAA;AACF,OAAA;AAEA,MAAA,MAAMrB,QAAQ,GAAGtB,OAAO,CAACtM,IAAI,CAAC,CAAA;MAC9B,IAAI,CAAC4N,QAAQ,EAAE,OAAA;AAEf,MAAA,MAAMsB,EAAE,GAAGjC,eAAe,CAACW,QAAQ,CAACV,IAAI,EAAEU,QAAQ,CAAC/N,IAAI,EAAEkN,KAAK,CAAC,CAAA;AAC/D,MAAA,IAAImC,EAAE,EAAE3B,IAAI,CAACc,WAAW,CAACa,EAAE,CAAC,CAAA;KAC7B;AAEDC,IAAAA,OAAO,EAAEzE,MAAM,KAAK,cAAc,IAAI;AACpC;MACA0E,eAAeA,CAAC7B,IAAiC,EAAE;AACjD,QAAA,IAAIA,IAAI,CAACgB,IAAI,CAACc,QAAQ,EAAE;UACtBvC,MAAM,CAAC,kBAAkB,EAAEb,GAAG,CAACqD,QAAQ,CAAC/B,IAAI,CAAC,CAAC,CAAA;AAChD,SAAA;OACD;AAED;MACA,6BAA6BgC,CAC3BhC,IAAiD,EACjD;AACAjN,QAAAA,eAAe,CAACkD,OAAO,CAAC3D,IAAI,IAAIiN,MAAM,CAACjN,IAAI,EAAEoM,GAAG,CAACqD,QAAQ,CAAC/B,IAAI,CAAC,CAAC,CAAC,CAAA;AACnE,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs2/lib/add-platform-specific-polyfills.js b/node_modules/babel-plugin-polyfill-corejs2/lib/add-platform-specific-polyfills.js new file mode 100644 index 0000000000000000000000000000000000000000..4521c8516d900ca8c7e21516f975c77a34542dfb --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/lib/add-platform-specific-polyfills.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports.default = _default; +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const webPolyfills = { + "web.timers": {}, + "web.immediate": {}, + "web.dom.iterable": {} +}; +const purePolyfills = { + "es6.parse-float": {}, + "es6.parse-int": {}, + "es7.string.at": {} +}; +function _default(targets, method, polyfills) { + const targetNames = Object.keys(targets); + const isAnyTarget = !targetNames.length; + const isWebTarget = targetNames.some(name => name !== "node"); + return _extends({}, polyfills, method === "usage-pure" ? purePolyfills : null, isAnyTarget || isWebTarget ? webPolyfills : null); +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs2/lib/built-in-definitions.js b/node_modules/babel-plugin-polyfill-corejs2/lib/built-in-definitions.js new file mode 100644 index 0000000000000000000000000000000000000000..5d618695009b00af370c28a95474a7b695f34fab --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/lib/built-in-definitions.js @@ -0,0 +1,219 @@ +"use strict"; + +exports.__esModule = true; +exports.StaticProperties = exports.InstanceProperties = exports.CommonIterators = exports.BuiltIns = void 0; +var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const define = (name, pure, global = [], meta) => { + return { + name, + pure, + global, + meta + }; +}; +const pureAndGlobal = (pure, global, minRuntimeVersion = null) => define(global[0], pure, global, { + minRuntimeVersion +}); +const globalOnly = global => define(global[0], null, global); +const pureOnly = (pure, name) => define(name, pure, []); +const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"]; +const CommonIterators = exports.CommonIterators = ["es6.string.iterator", ...ArrayNatureIterators]; +const PromiseDependencies = ["es6.object.to-string", "es6.promise"]; +const BuiltIns = exports.BuiltIns = { + DataView: globalOnly(["es6.typed.data-view"]), + Float32Array: globalOnly(["es6.typed.float32-array"]), + Float64Array: globalOnly(["es6.typed.float64-array"]), + Int8Array: globalOnly(["es6.typed.int8-array"]), + Int16Array: globalOnly(["es6.typed.int16-array"]), + Int32Array: globalOnly(["es6.typed.int32-array"]), + Map: pureAndGlobal("map", ["es6.map", ...CommonIterators]), + Number: globalOnly(["es6.number.constructor"]), + Promise: pureAndGlobal("promise", PromiseDependencies), + RegExp: globalOnly(["es6.regexp.constructor"]), + Set: pureAndGlobal("set", ["es6.set", ...CommonIterators]), + Symbol: pureAndGlobal("symbol/index", ["es6.symbol"]), + Uint8Array: globalOnly(["es6.typed.uint8-array"]), + Uint8ClampedArray: globalOnly(["es6.typed.uint8-clamped-array"]), + Uint16Array: globalOnly(["es6.typed.uint16-array"]), + Uint32Array: globalOnly(["es6.typed.uint32-array"]), + WeakMap: pureAndGlobal("weak-map", ["es6.weak-map", ...CommonIterators]), + WeakSet: pureAndGlobal("weak-set", ["es6.weak-set", ...CommonIterators]), + setImmediate: pureOnly("set-immediate", "web.immediate"), + clearImmediate: pureOnly("clear-immediate", "web.immediate"), + parseFloat: pureOnly("parse-float", "es6.parse-float"), + parseInt: pureOnly("parse-int", "es6.parse-int") +}; +const InstanceProperties = exports.InstanceProperties = { + __defineGetter__: globalOnly(["es7.object.define-getter"]), + __defineSetter__: globalOnly(["es7.object.define-setter"]), + __lookupGetter__: globalOnly(["es7.object.lookup-getter"]), + __lookupSetter__: globalOnly(["es7.object.lookup-setter"]), + anchor: globalOnly(["es6.string.anchor"]), + big: globalOnly(["es6.string.big"]), + bind: globalOnly(["es6.function.bind"]), + blink: globalOnly(["es6.string.blink"]), + bold: globalOnly(["es6.string.bold"]), + codePointAt: globalOnly(["es6.string.code-point-at"]), + copyWithin: globalOnly(["es6.array.copy-within"]), + endsWith: globalOnly(["es6.string.ends-with"]), + entries: globalOnly(ArrayNatureIterators), + every: globalOnly(["es6.array.every"]), + fill: globalOnly(["es6.array.fill"]), + filter: globalOnly(["es6.array.filter"]), + finally: globalOnly(["es7.promise.finally", ...PromiseDependencies]), + find: globalOnly(["es6.array.find"]), + findIndex: globalOnly(["es6.array.find-index"]), + fixed: globalOnly(["es6.string.fixed"]), + flags: globalOnly(["es6.regexp.flags"]), + flatMap: globalOnly(["es7.array.flat-map"]), + fontcolor: globalOnly(["es6.string.fontcolor"]), + fontsize: globalOnly(["es6.string.fontsize"]), + forEach: globalOnly(["es6.array.for-each"]), + includes: globalOnly(["es6.string.includes", "es7.array.includes"]), + indexOf: globalOnly(["es6.array.index-of"]), + italics: globalOnly(["es6.string.italics"]), + keys: globalOnly(ArrayNatureIterators), + lastIndexOf: globalOnly(["es6.array.last-index-of"]), + link: globalOnly(["es6.string.link"]), + map: globalOnly(["es6.array.map"]), + match: globalOnly(["es6.regexp.match"]), + name: globalOnly(["es6.function.name"]), + padStart: globalOnly(["es7.string.pad-start"]), + padEnd: globalOnly(["es7.string.pad-end"]), + reduce: globalOnly(["es6.array.reduce"]), + reduceRight: globalOnly(["es6.array.reduce-right"]), + repeat: globalOnly(["es6.string.repeat"]), + replace: globalOnly(["es6.regexp.replace"]), + search: globalOnly(["es6.regexp.search"]), + small: globalOnly(["es6.string.small"]), + some: globalOnly(["es6.array.some"]), + sort: globalOnly(["es6.array.sort"]), + split: globalOnly(["es6.regexp.split"]), + startsWith: globalOnly(["es6.string.starts-with"]), + strike: globalOnly(["es6.string.strike"]), + sub: globalOnly(["es6.string.sub"]), + sup: globalOnly(["es6.string.sup"]), + toISOString: globalOnly(["es6.date.to-iso-string"]), + toJSON: globalOnly(["es6.date.to-json"]), + toString: globalOnly(["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"]), + trim: globalOnly(["es6.string.trim"]), + trimEnd: globalOnly(["es7.string.trim-right"]), + trimLeft: globalOnly(["es7.string.trim-left"]), + trimRight: globalOnly(["es7.string.trim-right"]), + trimStart: globalOnly(["es7.string.trim-left"]), + values: globalOnly(ArrayNatureIterators) +}; + +// This isn't present in older @babel/compat-data versions +if ("es6.array.slice" in _corejs2BuiltIns.default) { + InstanceProperties.slice = globalOnly(["es6.array.slice"]); +} +const StaticProperties = exports.StaticProperties = { + Array: { + from: pureAndGlobal("array/from", ["es6.symbol", "es6.array.from", ...CommonIterators]), + isArray: pureAndGlobal("array/is-array", ["es6.array.is-array"]), + of: pureAndGlobal("array/of", ["es6.array.of"]) + }, + Date: { + now: pureAndGlobal("date/now", ["es6.date.now"]) + }, + JSON: { + stringify: pureOnly("json/stringify", "es6.symbol") + }, + Math: { + // 'Math' was not included in the 7.0.0 + // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616. + acosh: pureAndGlobal("math/acosh", ["es6.math.acosh"], "7.0.1"), + asinh: pureAndGlobal("math/asinh", ["es6.math.asinh"], "7.0.1"), + atanh: pureAndGlobal("math/atanh", ["es6.math.atanh"], "7.0.1"), + cbrt: pureAndGlobal("math/cbrt", ["es6.math.cbrt"], "7.0.1"), + clz32: pureAndGlobal("math/clz32", ["es6.math.clz32"], "7.0.1"), + cosh: pureAndGlobal("math/cosh", ["es6.math.cosh"], "7.0.1"), + expm1: pureAndGlobal("math/expm1", ["es6.math.expm1"], "7.0.1"), + fround: pureAndGlobal("math/fround", ["es6.math.fround"], "7.0.1"), + hypot: pureAndGlobal("math/hypot", ["es6.math.hypot"], "7.0.1"), + imul: pureAndGlobal("math/imul", ["es6.math.imul"], "7.0.1"), + log1p: pureAndGlobal("math/log1p", ["es6.math.log1p"], "7.0.1"), + log10: pureAndGlobal("math/log10", ["es6.math.log10"], "7.0.1"), + log2: pureAndGlobal("math/log2", ["es6.math.log2"], "7.0.1"), + sign: pureAndGlobal("math/sign", ["es6.math.sign"], "7.0.1"), + sinh: pureAndGlobal("math/sinh", ["es6.math.sinh"], "7.0.1"), + tanh: pureAndGlobal("math/tanh", ["es6.math.tanh"], "7.0.1"), + trunc: pureAndGlobal("math/trunc", ["es6.math.trunc"], "7.0.1") + }, + Number: { + EPSILON: pureAndGlobal("number/epsilon", ["es6.number.epsilon"]), + MIN_SAFE_INTEGER: pureAndGlobal("number/min-safe-integer", ["es6.number.min-safe-integer"]), + MAX_SAFE_INTEGER: pureAndGlobal("number/max-safe-integer", ["es6.number.max-safe-integer"]), + isFinite: pureAndGlobal("number/is-finite", ["es6.number.is-finite"]), + isInteger: pureAndGlobal("number/is-integer", ["es6.number.is-integer"]), + isSafeInteger: pureAndGlobal("number/is-safe-integer", ["es6.number.is-safe-integer"]), + isNaN: pureAndGlobal("number/is-nan", ["es6.number.is-nan"]), + parseFloat: pureAndGlobal("number/parse-float", ["es6.number.parse-float"]), + parseInt: pureAndGlobal("number/parse-int", ["es6.number.parse-int"]) + }, + Object: { + assign: pureAndGlobal("object/assign", ["es6.object.assign"]), + create: pureAndGlobal("object/create", ["es6.object.create"]), + defineProperties: pureAndGlobal("object/define-properties", ["es6.object.define-properties"]), + defineProperty: pureAndGlobal("object/define-property", ["es6.object.define-property"]), + entries: pureAndGlobal("object/entries", ["es7.object.entries"]), + freeze: pureAndGlobal("object/freeze", ["es6.object.freeze"]), + getOwnPropertyDescriptor: pureAndGlobal("object/get-own-property-descriptor", ["es6.object.get-own-property-descriptor"]), + getOwnPropertyDescriptors: pureAndGlobal("object/get-own-property-descriptors", ["es7.object.get-own-property-descriptors"]), + getOwnPropertyNames: pureAndGlobal("object/get-own-property-names", ["es6.object.get-own-property-names"]), + getOwnPropertySymbols: pureAndGlobal("object/get-own-property-symbols", ["es6.symbol"]), + getPrototypeOf: pureAndGlobal("object/get-prototype-of", ["es6.object.get-prototype-of"]), + is: pureAndGlobal("object/is", ["es6.object.is"]), + isExtensible: pureAndGlobal("object/is-extensible", ["es6.object.is-extensible"]), + isFrozen: pureAndGlobal("object/is-frozen", ["es6.object.is-frozen"]), + isSealed: pureAndGlobal("object/is-sealed", ["es6.object.is-sealed"]), + keys: pureAndGlobal("object/keys", ["es6.object.keys"]), + preventExtensions: pureAndGlobal("object/prevent-extensions", ["es6.object.prevent-extensions"]), + seal: pureAndGlobal("object/seal", ["es6.object.seal"]), + setPrototypeOf: pureAndGlobal("object/set-prototype-of", ["es6.object.set-prototype-of"]), + values: pureAndGlobal("object/values", ["es7.object.values"]) + }, + Promise: { + all: globalOnly(CommonIterators), + race: globalOnly(CommonIterators) + }, + Reflect: { + apply: pureAndGlobal("reflect/apply", ["es6.reflect.apply"]), + construct: pureAndGlobal("reflect/construct", ["es6.reflect.construct"]), + defineProperty: pureAndGlobal("reflect/define-property", ["es6.reflect.define-property"]), + deleteProperty: pureAndGlobal("reflect/delete-property", ["es6.reflect.delete-property"]), + get: pureAndGlobal("reflect/get", ["es6.reflect.get"]), + getOwnPropertyDescriptor: pureAndGlobal("reflect/get-own-property-descriptor", ["es6.reflect.get-own-property-descriptor"]), + getPrototypeOf: pureAndGlobal("reflect/get-prototype-of", ["es6.reflect.get-prototype-of"]), + has: pureAndGlobal("reflect/has", ["es6.reflect.has"]), + isExtensible: pureAndGlobal("reflect/is-extensible", ["es6.reflect.is-extensible"]), + ownKeys: pureAndGlobal("reflect/own-keys", ["es6.reflect.own-keys"]), + preventExtensions: pureAndGlobal("reflect/prevent-extensions", ["es6.reflect.prevent-extensions"]), + set: pureAndGlobal("reflect/set", ["es6.reflect.set"]), + setPrototypeOf: pureAndGlobal("reflect/set-prototype-of", ["es6.reflect.set-prototype-of"]) + }, + String: { + at: pureOnly("string/at", "es7.string.at"), + fromCodePoint: pureAndGlobal("string/from-code-point", ["es6.string.from-code-point"]), + raw: pureAndGlobal("string/raw", ["es6.string.raw"]) + }, + Symbol: { + // FIXME: Pure disabled to work around zloirock/core-js#262. + asyncIterator: globalOnly(["es6.symbol", "es7.symbol.async-iterator"]), + for: pureOnly("symbol/for", "es6.symbol"), + hasInstance: pureOnly("symbol/has-instance", "es6.symbol"), + isConcatSpreadable: pureOnly("symbol/is-concat-spreadable", "es6.symbol"), + iterator: define("es6.symbol", "symbol/iterator", CommonIterators), + keyFor: pureOnly("symbol/key-for", "es6.symbol"), + match: pureAndGlobal("symbol/match", ["es6.regexp.match"]), + replace: pureOnly("symbol/replace", "es6.symbol"), + search: pureOnly("symbol/search", "es6.symbol"), + species: pureOnly("symbol/species", "es6.symbol"), + split: pureOnly("symbol/split", "es6.symbol"), + toPrimitive: pureOnly("symbol/to-primitive", "es6.symbol"), + toStringTag: pureOnly("symbol/to-string-tag", "es6.symbol"), + unscopables: pureOnly("symbol/unscopables", "es6.symbol") + } +}; \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs2/lib/helpers.js b/node_modules/babel-plugin-polyfill-corejs2/lib/helpers.js new file mode 100644 index 0000000000000000000000000000000000000000..c15b6e5f8b0812bfc16af0007c611c3ce3d1ef91 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/lib/helpers.js @@ -0,0 +1,33 @@ +"use strict"; + +exports.__esModule = true; +exports.hasMinVersion = hasMinVersion; +var _semver = _interopRequireDefault(require("semver")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function hasMinVersion(minVersion, runtimeVersion) { + // If the range is unavailable, we're running the script during Babel's + // build process, and we want to assume that all versions are satisfied so + // that the built output will include all definitions. + if (!runtimeVersion || !minVersion) return true; + runtimeVersion = String(runtimeVersion); + + // semver.intersects() has some surprising behavior with comparing ranges + // with preprelease versions. We add '^' to ensure that we are always + // comparing ranges with ranges, which sidesteps this logic. + // For example: + // + // semver.intersects(`<7.0.1`, "7.0.0-beta.0") // false - surprising + // semver.intersects(`<7.0.1`, "^7.0.0-beta.0") // true - expected + // + // This is because the first falls back to + // + // semver.satisfies("7.0.0-beta.0", `<7.0.1`) // false - surprising + // + // and this fails because a prerelease version can only satisfy a range + // if it is a prerelease within the same major/minor/patch range. + // + // Note: If this is found to have issues, please also revist the logic in + // babel-core's availableHelper() API. + if (_semver.default.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`; + return !_semver.default.intersects(`<${minVersion}`, runtimeVersion) && !_semver.default.intersects(`>=8.0.0`, runtimeVersion); +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs2/lib/index.js b/node_modules/babel-plugin-polyfill-corejs2/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d46d87badc9023d384d85f8417445abbff10e255 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/lib/index.js @@ -0,0 +1,136 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins")); +var _builtInDefinitions = require("./built-in-definitions"); +var _addPlatformSpecificPolyfills = _interopRequireDefault(require("./add-platform-specific-polyfills")); +var _helpers = require("./helpers"); +var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider")); +var _babel = _interopRequireWildcard(require("@babel/core")); +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const { + types: t +} = _babel.default || _babel; +const BABEL_RUNTIME = "@babel/runtime-corejs2"; +const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility"; +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +const has = Function.call.bind(Object.hasOwnProperty); +var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(function (api, { + [presetEnvCompat]: { + entryInjectRegenerator = false, + noRuntimeName = false + } = {}, + [runtimeCompat]: { + useBabelRuntime = false, + runtimeVersion = "", + ext = ".js" + } = {} +}) { + const resolve = api.createMetaResolver({ + global: _builtInDefinitions.BuiltIns, + static: _builtInDefinitions.StaticProperties, + instance: _builtInDefinitions.InstanceProperties + }); + const { + debug, + shouldInjectPolyfill, + method + } = api; + const polyfills = (0, _addPlatformSpecificPolyfills.default)(api.targets, method, _corejs2BuiltIns.default); + const coreJSBase = useBabelRuntime ? `${BABEL_RUNTIME}/core-js` : method === "usage-pure" ? "core-js/library/fn" : "core-js/modules"; + function inject(name, utils) { + if (typeof name === "string") { + // Some polyfills aren't always available, for example + // web.dom.iterable when targeting node + if (has(polyfills, name) && shouldInjectPolyfill(name)) { + debug(name); + utils.injectGlobalImport(`${coreJSBase}/${name}.js`); + } + return; + } + name.forEach(name => inject(name, utils)); + } + function maybeInjectPure(desc, hint, utils) { + let { + pure, + meta, + name + } = desc; + if (!pure || !shouldInjectPolyfill(name)) return; + if (runtimeVersion && meta && meta.minRuntimeVersion && !(0, _helpers.hasMinVersion)(meta && meta.minRuntimeVersion, runtimeVersion)) { + return; + } + + // Unfortunately core-js and @babel/runtime-corejs2 don't have the same + // directory structure, so we need to special case this. + if (useBabelRuntime && pure === "symbol/index") pure = "symbol"; + return utils.injectDefaultImport(`${coreJSBase}/${pure}${ext}`, hint); + } + return { + name: "corejs2", + runtimeName: noRuntimeName ? null : BABEL_RUNTIME, + polyfills, + entryGlobal(meta, utils, path) { + if (meta.kind === "import" && meta.source === "core-js") { + debug(null); + inject(Object.keys(polyfills), utils); + if (entryInjectRegenerator) { + utils.injectGlobalImport("regenerator-runtime/runtime.js"); + } + path.remove(); + } + }, + usageGlobal(meta, utils) { + const resolved = resolve(meta); + if (!resolved) return; + let deps = resolved.desc.global; + if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") { + const low = meta.object.toLowerCase(); + deps = deps.filter(m => m.includes(low)); + } + inject(deps, utils); + }, + usagePure(meta, utils, path) { + if (meta.kind === "in") { + if (meta.key === "Symbol.iterator") { + path.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/is-iterable${ext}`, "isIterable"), [path.node.right] // meta.kind === "in" narrows this + )); + } + return; + } + if (path.parentPath.isUnaryExpression({ + operator: "delete" + })) return; + if (meta.kind === "property") { + // We can't compile destructuring. + if (!path.isMemberExpression()) return; + if (!path.isReferenced()) return; + if (meta.key === "Symbol.iterator" && shouldInjectPolyfill("es6.symbol") && path.parentPath.isCallExpression({ + callee: path.node + }) && path.parentPath.node.arguments.length === 0) { + path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator${ext}`, "getIterator"), [path.node.object])); + path.skip(); + return; + } + } + const resolved = resolve(meta); + if (!resolved) return; + const id = maybeInjectPure(resolved.desc, resolved.name, utils); + if (id) path.replaceWith(id); + }, + visitor: method === "usage-global" && { + // yield* + YieldExpression(path) { + if (path.node.delegate) { + inject("web.dom.iterable", api.getUtils(path)); + } + }, + // for-of, [a, b] = c + "ForOfStatement|ArrayPattern"(path) { + _builtInDefinitions.CommonIterators.forEach(name => inject(name, api.getUtils(path))); + } + } + }; +}); \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs2/node_modules/.bin/semver b/node_modules/babel-plugin-polyfill-corejs2/node_modules/.bin/semver new file mode 100644 index 0000000000000000000000000000000000000000..666034a75d8442be9bb2d9c55c3909b55a093cb5 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/node_modules/.bin/semver @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/babel-plugin-polyfill-corejs2/package.json b/node_modules/babel-plugin-polyfill-corejs2/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ed06150af580507ef5c66a0028bcef4d6a2d25b6 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs2/package.json @@ -0,0 +1,43 @@ +{ + "name": "babel-plugin-polyfill-corejs2", + "version": "0.4.17", + "description": "A Babel plugin to inject imports to core-js@2 polyfills", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel-polyfills.git", + "directory": "packages/babel-plugin-polyfill-corejs2" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "exports": { + ".": [ + { + "import": "./esm/index.mjs", + "default": "./lib/index.js" + }, + "./lib/index.js" + ], + "./package.json": "./package.json" + }, + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-define-polyfill-provider": "^0.6.8", + "semver": "^6.3.1" + }, + "devDependencies": { + "@babel/core": "^7.28.6", + "@babel/helper-plugin-test-runner": "^7.27.1", + "@babel/plugin-transform-for-of": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.28.6" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + }, + "gitHead": "86eff78e98adc17cdf0eb9ba4d94140eb7cb0da0" +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/LICENSE b/node_modules/babel-plugin-polyfill-corejs3/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b74971fede812cae3d1b3d7db474db739fac2d53 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Nicolò Ribaudo and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/babel-plugin-polyfill-corejs3/README.md b/node_modules/babel-plugin-polyfill-corejs3/README.md new file mode 100644 index 0000000000000000000000000000000000000000..11f3e7c0232c9c1fc4b2981545ede7d80fcc8a9d --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/README.md @@ -0,0 +1,78 @@ +# babel-plugin-polyfill-corejs3 + +## Install + +Using npm: + +```sh +npm install --save-dev babel-plugin-polyfill-corejs3 +``` + +or using yarn: + +```sh +yarn add babel-plugin-polyfill-corejs3 --dev +``` + +## Usage + +Add this plugin to your Babel configuration: + +```json +{ + "plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.48" }]] +} +``` + +This package supports the `usage-pure`, `usage-global`, and `entry-global` methods. +When `entry-global` is used, it replaces imports to `core-js`. + +## Options + +See [here](../../docs/usage.md#options) for a list of options supported by every polyfill provider. + +### `version` + +`string`, defaults to `"3.0"`. + +This option only has an effect when used alongside `"method": "usage-global"` or `"method": "usage-pure"`. It is recommended to specify the minor version you are using as `core-js@3.0` may not include polyfills for the latest features. If you are bundling an app, you can provide the version directly from your node modules: + +```js +{ + plugins: [ + ["polyfill-corejs3", { + "method": "usage-pure", + // use `core-js/package.json` if you are using `usage-global` + "version": require("core-js-pure/package.json").version + }] + ] +} +``` + +If you are a library author, specify a reasonably modern `core-js` version in your +`package.json` and provide the plugin the minimal supported version. + +```json +{ + "dependencies": { + "core-js": "^3.48.0" + } +} +``` +```js +{ + plugins: [ + ["polyfill-corejs3", { + "method": "usage-global", + // improvise if you have more complicated version spec, e.g. > 3.1.4 + "version": require("./package.json").dependencies["core-js"] + }] + ] +} +``` + +### `proposals` + +`boolean`, defaults to `false`. + +This option only has an effect when used alongside `"method": "usage-global"` or `"method": "usage-pure"`. When `proposals` are `true`, any ES proposal supported by core-js will be polyfilled as well. \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/README.md b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ba110c8500fdb7fde96b5fefd19bdef9be0c7f9f --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/README.md @@ -0,0 +1,4 @@ +`core-js-compat` exposes some files as JSON, and they cannot be +imported by Node.js ESM files. +This folder proxies `core-js-compat` to ensure that every entry +is CJS and can be safely imported. \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/data.js b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b525c34b54c3335abe9ee08718ec34a9922c4720 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/data.js @@ -0,0 +1 @@ +module.exports = require("core-js-compat/data"); diff --git a/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/entries.js b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/entries.js new file mode 100644 index 0000000000000000000000000000000000000000..1afc97e37e597ab329564280fccfbdb08395764c --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/entries.js @@ -0,0 +1 @@ +module.exports = require("core-js-compat/entries"); diff --git a/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/get-modules-list-for-target-version.js b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/get-modules-list-for-target-version.js new file mode 100644 index 0000000000000000000000000000000000000000..35d1fb3457feb9444da9dc91570f2d2ff3712395 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/core-js-compat/get-modules-list-for-target-version.js @@ -0,0 +1 @@ +module.exports = require("core-js-compat/get-modules-list-for-target-version"); diff --git a/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs b/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..847a763eda4f87be6437d0a6a73073c0266313c8 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs @@ -0,0 +1,855 @@ +import corejs3Polyfills from '../core-js-compat/data.js'; +import getModulesListForTargetVersion from '../core-js-compat/get-modules-list-for-target-version.js'; +import * as _babel from '@babel/core'; +import corejsEntries from '../core-js-compat/entries.js'; +import defineProvider from '@babel/helper-define-polyfill-provider'; + +// This file is automatically generated by scripts/build-corejs3-shipped-proposals.mjs + +var corejs3ShippedProposalsList = new Set(["esnext.array.group", "esnext.array.group-to-map", "esnext.iterator.zip", "esnext.iterator.zip-keyed", "esnext.symbol.metadata"]); + +const polyfillsOrder = {}; +Object.keys(corejs3Polyfills).forEach((name, index) => { + polyfillsOrder[name] = index; +}); +const define = (pure, global, name = global[0], exclude) => { + return { + name, + pure, + global: global.sort((a, b) => polyfillsOrder[a] - polyfillsOrder[b]), + exclude + }; +}; +const typed = (...modules) => define(null, [...modules, ...TypedArrayDependencies]); +const ArrayNatureIterators = ["es.array.iterator", "web.dom-collections.iterator"]; +const CommonIterators = ["es.string.iterator", ...ArrayNatureIterators]; +const ArrayNatureIteratorsWithTag = ["es.object.to-string", ...ArrayNatureIterators]; +const CommonIteratorsWithTag = ["es.object.to-string", ...CommonIterators]; +const ErrorDependencies = ["es.error.cause", "es.error.to-string"]; +const SuppressedErrorDependencies = ["es.suppressed-error.constructor", ...ErrorDependencies]; +const ArrayBufferDependencies = ["es.array-buffer.constructor", "es.array-buffer.slice", "es.data-view", "es.array-buffer.detached", "es.array-buffer.transfer", "es.array-buffer.transfer-to-fixed-length", "es.object.to-string"]; +const TypedArrayDependencies = ["es.typed-array.at", "es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.find-last", "es.typed-array.find-last-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-reversed", "es.typed-array.to-sorted", "es.typed-array.to-string", "es.typed-array.with", "es.object.to-string", "es.array.iterator", "esnext.typed-array.filter-reject", "esnext.typed-array.group-by", "esnext.typed-array.to-spliced", "esnext.typed-array.unique-by", ...ArrayBufferDependencies]; +const PromiseDependencies = ["es.promise", "es.object.to-string"]; +const PromiseDependenciesWithIterators = [...PromiseDependencies, ...CommonIterators]; +const SymbolDependencies = ["es.symbol", "es.symbol.description", "es.object.to-string"]; +const MapDependencies = ["es.map", "es.map.get-or-insert", "es.map.get-or-insert-computed", "esnext.map.delete-all", "esnext.map.emplace", "esnext.map.every", "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", "esnext.map.map-values", "esnext.map.merge", "esnext.map.reduce", "esnext.map.some", "esnext.map.update", ...CommonIteratorsWithTag]; +const SetDependencies = ["es.set", "es.set.difference.v2", "es.set.intersection.v2", "es.set.is-disjoint-from.v2", "es.set.is-subset-of.v2", "es.set.is-superset-of.v2", "es.set.symmetric-difference.v2", "es.set.union.v2", "esnext.set.add-all", "esnext.set.delete-all", "esnext.set.difference", "esnext.set.every", "esnext.set.filter", "esnext.set.find", "esnext.set.intersection", "esnext.set.is-disjoint-from", "esnext.set.is-subset-of", "esnext.set.is-superset-of", "esnext.set.join", "esnext.set.map", "esnext.set.reduce", "esnext.set.some", "esnext.set.symmetric-difference", "esnext.set.union", ...CommonIteratorsWithTag]; +const WeakMapDependencies = ["es.weak-map", "es.weak-map.get-or-insert", "es.weak-map.get-or-insert-computed", "esnext.weak-map.delete-all", "esnext.weak-map.emplace", ...CommonIteratorsWithTag]; +const WeakSetDependencies = ["es.weak-set", "esnext.weak-set.add-all", "esnext.weak-set.delete-all", ...CommonIteratorsWithTag]; +const DOMExceptionDependencies = ["web.dom-exception.constructor", "web.dom-exception.stack", "web.dom-exception.to-string-tag", "es.error.to-string"]; +const URLSearchParamsDependencies = ["web.url-search-params", "web.url-search-params.delete", "web.url-search-params.has", "web.url-search-params.size", ...CommonIteratorsWithTag]; +const AsyncIteratorDependencies = ["esnext.async-iterator.constructor", ...PromiseDependencies]; +const AsyncIteratorProblemMethods = ["esnext.async-iterator.every", "esnext.async-iterator.filter", "esnext.async-iterator.find", "esnext.async-iterator.flat-map", "esnext.async-iterator.for-each", "esnext.async-iterator.map", "esnext.async-iterator.reduce", "esnext.async-iterator.some"]; +const IteratorDependencies = ["es.iterator.constructor", "es.object.to-string"]; +const DecoratorMetadataDependencies = ["esnext.symbol.metadata", "esnext.function.metadata"]; +const TypedArrayStaticMethods = base => ({ + from: define(null, ["es.typed-array.from", base, ...TypedArrayDependencies]), + fromAsync: define(null, ["esnext.typed-array.from-async", base, ...PromiseDependenciesWithIterators, ...TypedArrayDependencies]), + of: define(null, ["es.typed-array.of", base, ...TypedArrayDependencies]) +}); +const DataViewDependencies = ["es.data-view", ...ArrayBufferDependencies]; +const BuiltIns = { + AsyncDisposableStack: define("async-disposable-stack/index", ["es.async-disposable-stack.constructor", "es.object.to-string", "es.async-iterator.async-dispose", "es.iterator.dispose", ...PromiseDependencies, ...SuppressedErrorDependencies]), + AsyncIterator: define("async-iterator/index", AsyncIteratorDependencies), + AggregateError: define("aggregate-error", ["es.aggregate-error", ...ErrorDependencies, ...CommonIteratorsWithTag, "es.aggregate-error.cause"]), + ArrayBuffer: define(null, ArrayBufferDependencies), + DataView: define(null, DataViewDependencies), + Date: define(null, ["es.date.to-string"]), + DOMException: define("dom-exception/index", DOMExceptionDependencies), + DisposableStack: define("disposable-stack/index", ["es.disposable-stack.constructor", "es.object.to-string", "es.iterator.dispose", ...SuppressedErrorDependencies]), + Error: define(null, ErrorDependencies), + EvalError: define(null, ErrorDependencies), + Float32Array: typed("es.typed-array.float32-array"), + Float64Array: typed("es.typed-array.float64-array"), + Int8Array: typed("es.typed-array.int8-array"), + Int16Array: typed("es.typed-array.int16-array"), + Int32Array: typed("es.typed-array.int32-array"), + Iterator: define("iterator/index", IteratorDependencies), + Uint8Array: typed("es.typed-array.uint8-array", "es.uint8-array.set-from-base64", "es.uint8-array.set-from-hex", "es.uint8-array.to-base64", "es.uint8-array.to-hex"), + Uint8ClampedArray: typed("es.typed-array.uint8-clamped-array"), + Uint16Array: typed("es.typed-array.uint16-array"), + Uint32Array: typed("es.typed-array.uint32-array"), + Map: define("map/index", MapDependencies), + Number: define(null, ["es.number.constructor"]), + Observable: define("observable/index", ["esnext.observable", "esnext.symbol.observable", "es.object.to-string", ...CommonIteratorsWithTag]), + Promise: define("promise/index", PromiseDependencies), + RangeError: define(null, ErrorDependencies), + ReferenceError: define(null, ErrorDependencies), + Reflect: define(null, ["es.reflect.to-string-tag", "es.object.to-string"]), + RegExp: define(null, ["es.regexp.constructor", "es.regexp.dot-all", "es.regexp.exec", "es.regexp.sticky", "es.regexp.to-string"]), + Set: define("set/index", SetDependencies), + SuppressedError: define("suppressed-error", SuppressedErrorDependencies), + Symbol: define("symbol/index", SymbolDependencies), + SyntaxError: define(null, ErrorDependencies), + TypeError: define(null, ErrorDependencies), + URIError: define(null, ErrorDependencies), + URL: define("url/index", ["web.url", "web.url.to-json", ...URLSearchParamsDependencies]), + URLSearchParams: define("url-search-params/index", URLSearchParamsDependencies), + WeakMap: define("weak-map/index", WeakMapDependencies), + WeakSet: define("weak-set/index", WeakSetDependencies), + atob: define("atob", ["web.atob", ...DOMExceptionDependencies]), + btoa: define("btoa", ["web.btoa", ...DOMExceptionDependencies]), + clearImmediate: define("clear-immediate", ["web.immediate"]), + compositeKey: define("composite-key", ["esnext.composite-key"]), + compositeSymbol: define("composite-symbol", ["esnext.composite-symbol"]), + escape: define("escape", ["es.escape"]), + fetch: define(null, PromiseDependencies), + globalThis: define("global-this", ["es.global-this"]), + parseFloat: define("parse-float", ["es.parse-float"]), + parseInt: define("parse-int", ["es.parse-int"]), + queueMicrotask: define("queue-microtask", ["web.queue-microtask"]), + self: define("self", ["web.self"]), + setImmediate: define("set-immediate", ["web.immediate"]), + setInterval: define("set-interval", ["web.timers"]), + setTimeout: define("set-timeout", ["web.timers"]), + structuredClone: define("structured-clone", ["web.structured-clone", ...DOMExceptionDependencies, "es.array.iterator", "es.object.keys", "es.object.to-string", "es.map", "es.set"]), + unescape: define("unescape", ["es.unescape"]) +}; +const StaticProperties = { + AsyncIterator: { + from: define("async-iterator/from", ["esnext.async-iterator.from", ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods, ...CommonIterators]) + }, + Array: { + from: define("array/from", ["es.array.from", "es.string.iterator"]), + fromAsync: define("array/from-async", ["es.array.from-async", ...PromiseDependenciesWithIterators]), + isArray: define("array/is-array", ["es.array.is-array"]), + isTemplateObject: define("array/is-template-object", ["esnext.array.is-template-object"]), + of: define("array/of", ["es.array.of"]) + }, + ArrayBuffer: { + isView: define(null, ["es.array-buffer.is-view"]) + }, + BigInt: { + range: define("bigint/range", ["esnext.bigint.range", "es.object.to-string"]) + }, + Date: { + now: define("date/now", ["es.date.now"]) + }, + Error: { + isError: define("error/is-error", ["es.error.is-error", "es.object.create"]) + }, + Function: { + isCallable: define("function/is-callable", ["esnext.function.is-callable"]), + isConstructor: define("function/is-constructor", ["esnext.function.is-constructor"]) + }, + Iterator: { + concat: define("iterator/concat", ["es.iterator.concat", ...IteratorDependencies, ...CommonIterators]), + from: define("iterator/from", ["es.iterator.from", ...IteratorDependencies, ...CommonIterators]), + range: define("iterator/range", ["esnext.iterator.range", ...IteratorDependencies]), + zip: define("iterator/zip", ["esnext.iterator.zip", ...IteratorDependencies, ...CommonIterators]), + zipKeyed: define("iterator/zip-keyed", ["esnext.iterator.zip-keyed", "es.object.create", "es.reflect.own-keys", ...IteratorDependencies, ...CommonIterators]) + }, + JSON: { + isRawJSON: define("json/is-raw-json", ["es.json.is-raw-json"]), + parse: define("json/parse", ["es.json.parse", "es.object.keys"]), + rawJSON: define("json/raw-json", ["es.json.raw-json", "es.object.create", "es.object.freeze"]), + stringify: define("json/stringify", ["es.json.stringify", "es.date.to-json"]) + }, + Math: { + DEG_PER_RAD: define("math/deg-per-rad", ["esnext.math.deg-per-rad"]), + RAD_PER_DEG: define("math/rad-per-deg", ["esnext.math.rad-per-deg"]), + acosh: define("math/acosh", ["es.math.acosh"]), + asinh: define("math/asinh", ["es.math.asinh"]), + atanh: define("math/atanh", ["es.math.atanh"]), + cbrt: define("math/cbrt", ["es.math.cbrt"]), + clamp: define("math/clamp", ["esnext.math.clamp"]), + clz32: define("math/clz32", ["es.math.clz32"]), + cosh: define("math/cosh", ["es.math.cosh"]), + degrees: define("math/degrees", ["esnext.math.degrees"]), + expm1: define("math/expm1", ["es.math.expm1"]), + fround: define("math/fround", ["es.math.fround"]), + f16round: define("math/f16round", ["es.math.f16round"]), + fscale: define("math/fscale", ["esnext.math.fscale"]), + hypot: define("math/hypot", ["es.math.hypot"]), + iaddh: define("math/iaddh", ["esnext.math.iaddh"]), + imul: define("math/imul", ["es.math.imul"]), + imulh: define("math/imulh", ["esnext.math.imulh"]), + isubh: define("math/isubh", ["esnext.math.isubh"]), + log10: define("math/log10", ["es.math.log10"]), + log1p: define("math/log1p", ["es.math.log1p"]), + log2: define("math/log2", ["es.math.log2"]), + radians: define("math/radians", ["esnext.math.radians"]), + scale: define("math/scale", ["esnext.math.scale"]), + seededPRNG: define("math/seeded-prng", ["esnext.math.seeded-prng"]), + sign: define("math/sign", ["es.math.sign"]), + signbit: define("math/signbit", ["esnext.math.signbit"]), + sinh: define("math/sinh", ["es.math.sinh"]), + sumPrecise: define("math/sum-precise", ["es.math.sum-precise", "es.array.iterator"]), + tanh: define("math/tanh", ["es.math.tanh"]), + trunc: define("math/trunc", ["es.math.trunc"]), + umulh: define("math/umulh", ["esnext.math.umulh"]) + }, + Map: { + from: define("map/from", ["esnext.map.from", ...MapDependencies]), + groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]), + keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]), + of: define("map/of", ["esnext.map.of", ...MapDependencies]) + }, + Number: { + EPSILON: define("number/epsilon", ["es.number.epsilon"]), + MAX_SAFE_INTEGER: define("number/max-safe-integer", ["es.number.max-safe-integer"]), + MIN_SAFE_INTEGER: define("number/min-safe-integer", ["es.number.min-safe-integer"]), + fromString: define("number/from-string", ["esnext.number.from-string"]), + isFinite: define("number/is-finite", ["es.number.is-finite"]), + isInteger: define("number/is-integer", ["es.number.is-integer"]), + isNaN: define("number/is-nan", ["es.number.is-nan"]), + isSafeInteger: define("number/is-safe-integer", ["es.number.is-safe-integer"]), + parseFloat: define("number/parse-float", ["es.number.parse-float"]), + parseInt: define("number/parse-int", ["es.number.parse-int"]), + range: define("number/range", ["esnext.number.range", "es.object.to-string"]) + }, + Object: { + assign: define("object/assign", ["es.object.assign"]), + create: define("object/create", ["es.object.create"]), + defineProperties: define("object/define-properties", ["es.object.define-properties"]), + defineProperty: define("object/define-property", ["es.object.define-property"]), + entries: define("object/entries", ["es.object.entries"]), + freeze: define("object/freeze", ["es.object.freeze"]), + fromEntries: define("object/from-entries", ["es.object.from-entries", "es.array.iterator"]), + getOwnPropertyDescriptor: define("object/get-own-property-descriptor", ["es.object.get-own-property-descriptor"]), + getOwnPropertyDescriptors: define("object/get-own-property-descriptors", ["es.object.get-own-property-descriptors"]), + getOwnPropertyNames: define("object/get-own-property-names", ["es.object.get-own-property-names"]), + getOwnPropertySymbols: define("object/get-own-property-symbols", ["es.symbol"]), + getPrototypeOf: define("object/get-prototype-of", ["es.object.get-prototype-of"]), + groupBy: define("object/group-by", ["es.object.group-by", "es.object.create"]), + hasOwn: define("object/has-own", ["es.object.has-own"]), + is: define("object/is", ["es.object.is"]), + isExtensible: define("object/is-extensible", ["es.object.is-extensible"]), + isFrozen: define("object/is-frozen", ["es.object.is-frozen"]), + isSealed: define("object/is-sealed", ["es.object.is-sealed"]), + keys: define("object/keys", ["es.object.keys"]), + preventExtensions: define("object/prevent-extensions", ["es.object.prevent-extensions"]), + seal: define("object/seal", ["es.object.seal"]), + setPrototypeOf: define("object/set-prototype-of", ["es.object.set-prototype-of"]), + values: define("object/values", ["es.object.values"]) + }, + Promise: { + all: define(null, PromiseDependenciesWithIterators), + allSettled: define("promise/all-settled", ["es.promise.all-settled", ...PromiseDependenciesWithIterators]), + any: define("promise/any", ["es.promise.any", "es.aggregate-error", ...PromiseDependenciesWithIterators]), + race: define(null, PromiseDependenciesWithIterators), + try: define("promise/try", ["es.promise.try", ...PromiseDependencies]), + withResolvers: define("promise/with-resolvers", ["es.promise.with-resolvers", ...PromiseDependencies]) + }, + Reflect: { + apply: define("reflect/apply", ["es.reflect.apply"]), + construct: define("reflect/construct", ["es.reflect.construct"]), + defineMetadata: define("reflect/define-metadata", ["esnext.reflect.define-metadata"]), + defineProperty: define("reflect/define-property", ["es.reflect.define-property"]), + deleteMetadata: define("reflect/delete-metadata", ["esnext.reflect.delete-metadata"]), + deleteProperty: define("reflect/delete-property", ["es.reflect.delete-property"]), + get: define("reflect/get", ["es.reflect.get"]), + getMetadata: define("reflect/get-metadata", ["esnext.reflect.get-metadata"]), + getMetadataKeys: define("reflect/get-metadata-keys", ["esnext.reflect.get-metadata-keys"]), + getOwnMetadata: define("reflect/get-own-metadata", ["esnext.reflect.get-own-metadata"]), + getOwnMetadataKeys: define("reflect/get-own-metadata-keys", ["esnext.reflect.get-own-metadata-keys"]), + getOwnPropertyDescriptor: define("reflect/get-own-property-descriptor", ["es.reflect.get-own-property-descriptor"]), + getPrototypeOf: define("reflect/get-prototype-of", ["es.reflect.get-prototype-of"]), + has: define("reflect/has", ["es.reflect.has"]), + hasMetadata: define("reflect/has-metadata", ["esnext.reflect.has-metadata"]), + hasOwnMetadata: define("reflect/has-own-metadata", ["esnext.reflect.has-own-metadata"]), + isExtensible: define("reflect/is-extensible", ["es.reflect.is-extensible"]), + metadata: define("reflect/metadata", ["esnext.reflect.metadata"]), + ownKeys: define("reflect/own-keys", ["es.reflect.own-keys"]), + preventExtensions: define("reflect/prevent-extensions", ["es.reflect.prevent-extensions"]), + set: define("reflect/set", ["es.reflect.set"]), + setPrototypeOf: define("reflect/set-prototype-of", ["es.reflect.set-prototype-of"]) + }, + RegExp: { + escape: define("regexp/escape", ["es.regexp.escape"]) + }, + Set: { + from: define("set/from", ["esnext.set.from", ...SetDependencies]), + of: define("set/of", ["esnext.set.of", ...SetDependencies]) + }, + String: { + cooked: define("string/cooked", ["esnext.string.cooked"]), + dedent: define("string/dedent", ["esnext.string.dedent", "es.string.from-code-point", "es.weak-map"]), + fromCodePoint: define("string/from-code-point", ["es.string.from-code-point"]), + raw: define("string/raw", ["es.string.raw"]) + }, + Symbol: { + asyncDispose: define("symbol/async-dispose", ["es.symbol.async-dispose", "es.async-iterator.async-dispose"]), + asyncIterator: define("symbol/async-iterator", ["es.symbol.async-iterator"]), + customMatcher: define("symbol/custom-matcher", ["esnext.symbol.custom-matcher"]), + dispose: define("symbol/dispose", ["es.symbol.dispose", "es.iterator.dispose"]), + for: define("symbol/for", [], "es.symbol"), + hasInstance: define("symbol/has-instance", ["es.symbol.has-instance", "es.function.has-instance"]), + isConcatSpreadable: define("symbol/is-concat-spreadable", ["es.symbol.is-concat-spreadable", "es.array.concat"]), + isRegistered: define("symbol/is-registered", ["esnext.symbol.is-registered", "es.symbol"]), + isRegisteredSymbol: define("symbol/is-registered-symbol", ["esnext.symbol.is-registered-symbol", "es.symbol"]), + isWellKnown: define("symbol/is-well-known", ["esnext.symbol.is-well-known", "es.symbol"]), + isWellKnownSymbol: define("symbol/is-well-known-symbol", ["esnext.symbol.is-well-known-symbol", "es.symbol"]), + iterator: define("symbol/iterator", ["es.symbol.iterator", ...CommonIteratorsWithTag]), + keyFor: define("symbol/key-for", [], "es.symbol"), + match: define("symbol/match", ["es.symbol.match", "es.string.match"]), + matcher: define("symbol/matcher", ["esnext.symbol.matcher"]), + matchAll: define("symbol/match-all", ["es.symbol.match-all", "es.string.match-all"]), + metadata: define("symbol/metadata", DecoratorMetadataDependencies), + metadataKey: define("symbol/metadata-key", ["esnext.symbol.metadata-key"]), + observable: define("symbol/observable", ["esnext.symbol.observable"]), + patternMatch: define("symbol/pattern-match", ["esnext.symbol.pattern-match"]), + replace: define("symbol/replace", ["es.symbol.replace", "es.string.replace"]), + search: define("symbol/search", ["es.symbol.search", "es.string.search"]), + species: define("symbol/species", ["es.symbol.species", "es.array.species"]), + split: define("symbol/split", ["es.symbol.split", "es.string.split"]), + toPrimitive: define("symbol/to-primitive", ["es.symbol.to-primitive", "es.date.to-primitive"]), + toStringTag: define("symbol/to-string-tag", ["es.symbol.to-string-tag", "es.object.to-string", "es.math.to-string-tag", "es.json.to-string-tag"]), + unscopables: define("symbol/unscopables", ["es.symbol.unscopables"]) + }, + URL: { + canParse: define("url/can-parse", ["web.url.can-parse", "web.url"]), + parse: define("url/parse", ["web.url.parse", "web.url"]) + }, + WeakMap: { + from: define("weak-map/from", ["esnext.weak-map.from", ...WeakMapDependencies]), + of: define("weak-map/of", ["esnext.weak-map.of", ...WeakMapDependencies]) + }, + WeakSet: { + from: define("weak-set/from", ["esnext.weak-set.from", ...WeakSetDependencies]), + of: define("weak-set/of", ["esnext.weak-set.of", ...WeakSetDependencies]) + }, + Int8Array: TypedArrayStaticMethods("es.typed-array.int8-array"), + Uint8Array: { + fromBase64: define(null, ["es.uint8-array.from-base64", ...TypedArrayDependencies]), + fromHex: define(null, ["es.uint8-array.from-hex", ...TypedArrayDependencies]), + ...TypedArrayStaticMethods("es.typed-array.uint8-array") + }, + Uint8ClampedArray: TypedArrayStaticMethods("es.typed-array.uint8-clamped-array"), + Int16Array: TypedArrayStaticMethods("es.typed-array.int16-array"), + Uint16Array: TypedArrayStaticMethods("es.typed-array.uint16-array"), + Int32Array: TypedArrayStaticMethods("es.typed-array.int32-array"), + Uint32Array: TypedArrayStaticMethods("es.typed-array.uint32-array"), + Float32Array: TypedArrayStaticMethods("es.typed-array.float32-array"), + Float64Array: TypedArrayStaticMethods("es.typed-array.float64-array"), + WebAssembly: { + CompileError: define(null, ErrorDependencies), + LinkError: define(null, ErrorDependencies), + RuntimeError: define(null, ErrorDependencies) + } +}; +["AggregateError", "EvalError", "RangeError", "ReferenceError", "SuppressedError", "SyntaxError", "TypeError", "URIError"].forEach(ERROR_SUBCLASS => { + StaticProperties[ERROR_SUBCLASS] = StaticProperties.Error; +}); +const InstanceProperties = { + asIndexedPairs: define(null, ["esnext.async-iterator.as-indexed-pairs", ...AsyncIteratorDependencies, "esnext.iterator.as-indexed-pairs", ...IteratorDependencies]), + at: define("instance/at", [ + // TODO: We should introduce overloaded instance methods definition + // Before that is implemented, the `esnext.string.at` must be the first + // In pure mode, the provider resolves the descriptor as a "pure" `esnext.string.at` + // and treats the compat-data of `esnext.string.at` as the compat-data of + // pure import `instance/at`. The first polyfill here should have the lowest corejs + // supported versions. + "esnext.string.at", "es.string.at-alternative", "es.array.at"]), + anchor: define(null, ["es.string.anchor"]), + big: define(null, ["es.string.big"]), + bind: define("instance/bind", ["es.function.bind"]), + blink: define(null, ["es.string.blink"]), + bold: define(null, ["es.string.bold"]), + chunks: define(null, ["esnext.iterator.chunks", ...IteratorDependencies]), + clamp: define("instance/clamp", ["esnext.number.clamp"]), + codePointAt: define("instance/code-point-at", ["es.string.code-point-at"]), + codePoints: define("instance/code-points", ["esnext.string.code-points"]), + concat: define("instance/concat", ["es.array.concat"], undefined, ["String"]), + copyWithin: define("instance/copy-within", ["es.array.copy-within"]), + demethodize: define("instance/demethodize", ["esnext.function.demethodize"]), + description: define(null, ["es.symbol", "es.symbol.description"]), + dotAll: define(null, ["es.regexp.dot-all"]), + drop: define(null, ["es.iterator.drop", ...IteratorDependencies, "esnext.async-iterator.drop", ...AsyncIteratorDependencies]), + endsWith: define("instance/ends-with", ["es.string.ends-with"]), + entries: define("instance/entries", ArrayNatureIteratorsWithTag), + every: define("instance/every", ["es.array.every", "es.iterator.every", ...IteratorDependencies + // TODO: add async iterator dependencies when we support sub-dependencies + // esnext.async-iterator.every depends on es.promise + // but we don't want to pull es.promise when esnext.async-iterator is disabled + // + // "esnext.async-iterator.every", + // ...AsyncIteratorDependencies + ]), + exec: define(null, ["es.regexp.exec"]), + fill: define("instance/fill", ["es.array.fill"]), + filter: define("instance/filter", ["es.array.filter", "es.iterator.filter", ...IteratorDependencies + // "esnext.async-iterator.filter", + ]), + filterReject: define("instance/filter-reject", ["esnext.array.filter-reject"]), + finally: define(null, ["es.promise.finally", ...PromiseDependencies]), + find: define("instance/find", ["es.array.find", "es.iterator.find", ...IteratorDependencies + // "esnext.async-iterator.find", + ]), + findIndex: define("instance/find-index", ["es.array.find-index"]), + findLast: define("instance/find-last", ["es.array.find-last"]), + findLastIndex: define("instance/find-last-index", ["es.array.find-last-index"]), + fixed: define(null, ["es.string.fixed"]), + flags: define("instance/flags", ["es.regexp.flags"]), + flatMap: define("instance/flat-map", ["es.array.flat-map", "es.array.unscopables.flat-map", "es.iterator.flat-map", ...IteratorDependencies + // "esnext.async-iterator.flat-map", + ]), + flat: define("instance/flat", ["es.array.flat", "es.array.unscopables.flat"]), + getFloat16: define(null, ["es.data-view.get-float16", ...DataViewDependencies]), + getUint8Clamped: define(null, ["esnext.data-view.get-uint8-clamped", ...DataViewDependencies]), + getYear: define(null, ["es.date.get-year"]), + group: define("instance/group", ["esnext.array.group"]), + groupBy: define("instance/group-by", ["esnext.array.group-by"]), + groupByToMap: define("instance/group-by-to-map", ["esnext.array.group-by-to-map", "es.map", "es.object.to-string"]), + groupToMap: define("instance/group-to-map", ["esnext.array.group-to-map", "es.map", "es.object.to-string"]), + fontcolor: define(null, ["es.string.fontcolor"]), + fontsize: define(null, ["es.string.fontsize"]), + forEach: define("instance/for-each", ["es.array.for-each", "es.iterator.for-each", ...IteratorDependencies, + // "esnext.async-iterator.for-each", + "web.dom-collections.for-each"]), + includes: define("instance/includes", ["es.array.includes", "es.string.includes"]), + indexed: define(null, ["esnext.async-iterator.indexed", ...AsyncIteratorDependencies, "esnext.iterator.indexed", ...IteratorDependencies]), + indexOf: define("instance/index-of", ["es.array.index-of"]), + isWellFormed: define("instance/is-well-formed", ["es.string.is-well-formed"]), + italics: define(null, ["es.string.italics"]), + join: define(null, ["es.array.join"]), + keys: define("instance/keys", ArrayNatureIteratorsWithTag), + lastIndex: define(null, ["esnext.array.last-index"]), + lastIndexOf: define("instance/last-index-of", ["es.array.last-index-of"]), + lastItem: define(null, ["esnext.array.last-item"]), + link: define(null, ["es.string.link"]), + map: define("instance/map", ["es.array.map", "es.iterator.map", ...IteratorDependencies + // "esnext.async-iterator.map", + ]), + match: define(null, ["es.string.match", "es.regexp.exec"]), + matchAll: define("instance/match-all", ["es.string.match-all", "es.regexp.exec"]), + name: define(null, ["es.function.name"]), + padEnd: define("instance/pad-end", ["es.string.pad-end"]), + padStart: define("instance/pad-start", ["es.string.pad-start"]), + push: define("instance/push", ["es.array.push"]), + reduce: define("instance/reduce", ["es.array.reduce", "es.iterator.reduce", ...IteratorDependencies + // "esnext.async-iterator.reduce", + ]), + reduceRight: define("instance/reduce-right", ["es.array.reduce-right"]), + repeat: define("instance/repeat", ["es.string.repeat"]), + replace: define(null, ["es.string.replace", "es.regexp.exec"]), + replaceAll: define("instance/replace-all", ["es.string.replace-all", "es.string.replace", "es.regexp.exec"]), + reverse: define("instance/reverse", ["es.array.reverse"]), + search: define(null, ["es.string.search", "es.regexp.exec"]), + setFloat16: define(null, ["es.data-view.set-float16", ...DataViewDependencies]), + setUint8Clamped: define(null, ["esnext.data-view.set-uint8-clamped", ...DataViewDependencies]), + setYear: define(null, ["es.date.set-year"]), + slice: define("instance/slice", ["es.array.slice"]), + sliding: define(null, ["esnext.iterator.sliding", ...IteratorDependencies]), + small: define(null, ["es.string.small"]), + some: define("instance/some", ["es.array.some", "es.iterator.some", ...IteratorDependencies + // "esnext.async-iterator.some", + ]), + sort: define("instance/sort", ["es.array.sort"]), + splice: define("instance/splice", ["es.array.splice"]), + split: define(null, ["es.string.split", "es.regexp.exec"]), + startsWith: define("instance/starts-with", ["es.string.starts-with"]), + sticky: define(null, ["es.regexp.sticky"]), + strike: define(null, ["es.string.strike"]), + sub: define(null, ["es.string.sub"]), + substr: define(null, ["es.string.substr"]), + sup: define(null, ["es.string.sup"]), + take: define(null, ["es.iterator.take", ...IteratorDependencies, "esnext.async-iterator.take", ...AsyncIteratorDependencies]), + test: define(null, ["es.regexp.test", "es.regexp.exec"]), + toArray: define(null, ["es.iterator.to-array", ...IteratorDependencies, "esnext.async-iterator.to-array", ...AsyncIteratorDependencies]), + toAsync: define(null, ["esnext.iterator.to-async", ...IteratorDependencies, ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods]), + toExponential: define(null, ["es.number.to-exponential"]), + toFixed: define(null, ["es.number.to-fixed"]), + toGMTString: define(null, ["es.date.to-gmt-string"]), + toISOString: define(null, ["es.date.to-iso-string"]), + toJSON: define(null, ["es.date.to-json"]), + toPrecision: define(null, ["es.number.to-precision"]), + toReversed: define("instance/to-reversed", ["es.array.to-reversed"]), + toSorted: define("instance/to-sorted", ["es.array.to-sorted", "es.array.sort"]), + toSpliced: define("instance/to-spliced", ["es.array.to-spliced"]), + toString: define(null, ["es.object.to-string", "es.error.to-string", "es.date.to-string", "es.regexp.to-string"]), + toWellFormed: define("instance/to-well-formed", ["es.string.to-well-formed"]), + trim: define("instance/trim", ["es.string.trim"]), + trimEnd: define("instance/trim-end", ["es.string.trim-end"]), + trimLeft: define("instance/trim-left", ["es.string.trim-start"]), + trimRight: define("instance/trim-right", ["es.string.trim-end"]), + trimStart: define("instance/trim-start", ["es.string.trim-start"]), + uniqueBy: define("instance/unique-by", ["esnext.array.unique-by", "es.map"]), + unshift: define("instance/unshift", ["es.array.unshift"]), + unThis: define("instance/un-this", ["esnext.function.un-this"]), + values: define("instance/values", ArrayNatureIteratorsWithTag), + windows: define(null, ["esnext.iterator.windows", ...IteratorDependencies]), + with: define("instance/with", ["es.array.with"]), + __defineGetter__: define(null, ["es.object.define-getter"]), + __defineSetter__: define(null, ["es.object.define-setter"]), + __lookupGetter__: define(null, ["es.object.lookup-getter"]), + __lookupSetter__: define(null, ["es.object.lookup-setter"]), + ["__proto__"]: define(null, ["es.object.proto"]) +}; + +// This file contains the list of paths supported by @babel/runtime-corejs3. +// It must _not_ be edited, as all new features should go through direct +// injection of core-js-pure imports. + +const stable = new Set(["array", "array/from", "array/is-array", "array/of", "clear-immediate", "date/now", "instance/bind", "instance/code-point-at", "instance/concat", "instance/copy-within", "instance/ends-with", "instance/entries", "instance/every", "instance/fill", "instance/filter", "instance/find", "instance/find-index", "instance/flags", "instance/flat", "instance/flat-map", "instance/for-each", "instance/includes", "instance/index-of", "instance/keys", "instance/last-index-of", "instance/map", "instance/pad-end", "instance/pad-start", "instance/reduce", "instance/reduce-right", "instance/repeat", "instance/reverse", "instance/slice", "instance/some", "instance/sort", "instance/splice", "instance/starts-with", "instance/trim", "instance/trim-end", "instance/trim-left", "instance/trim-right", "instance/trim-start", "instance/values", "json/stringify", "map", "math/acosh", "math/asinh", "math/atanh", "math/cbrt", "math/clz32", "math/cosh", "math/expm1", "math/fround", "math/hypot", "math/imul", "math/log10", "math/log1p", "math/log2", "math/sign", "math/sinh", "math/tanh", "math/trunc", "number/epsilon", "number/is-finite", "number/is-integer", "number/is-nan", "number/is-safe-integer", "number/max-safe-integer", "number/min-safe-integer", "number/parse-float", "number/parse-int", "object/assign", "object/create", "object/define-properties", "object/define-property", "object/entries", "object/freeze", "object/from-entries", "object/get-own-property-descriptor", "object/get-own-property-descriptors", "object/get-own-property-names", "object/get-own-property-symbols", "object/get-prototype-of", "object/is", "object/is-extensible", "object/is-frozen", "object/is-sealed", "object/keys", "object/prevent-extensions", "object/seal", "object/set-prototype-of", "object/values", "parse-float", "parse-int", "promise", "queue-microtask", "reflect/apply", "reflect/construct", "reflect/define-property", "reflect/delete-property", "reflect/get", "reflect/get-own-property-descriptor", "reflect/get-prototype-of", "reflect/has", "reflect/is-extensible", "reflect/own-keys", "reflect/prevent-extensions", "reflect/set", "reflect/set-prototype-of", "set", "set-immediate", "set-interval", "set-timeout", "string/from-code-point", "string/raw", "symbol", "symbol/async-iterator", "symbol/for", "symbol/has-instance", "symbol/is-concat-spreadable", "symbol/iterator", "symbol/key-for", "symbol/match", "symbol/replace", "symbol/search", "symbol/species", "symbol/split", "symbol/to-primitive", "symbol/to-string-tag", "symbol/unscopables", "url", "url-search-params", "weak-map", "weak-set"]); +const proposals = new Set([...stable, "aggregate-error", "composite-key", "composite-symbol", "global-this", "instance/at", "instance/code-points", "instance/match-all", "instance/replace-all", "math/clamp", "math/degrees", "math/deg-per-rad", "math/fscale", "math/iaddh", "math/imulh", "math/isubh", "math/rad-per-deg", "math/radians", "math/scale", "math/seeded-prng", "math/signbit", "math/umulh", "number/from-string", "observable", "reflect/define-metadata", "reflect/delete-metadata", "reflect/get-metadata", "reflect/get-metadata-keys", "reflect/get-own-metadata", "reflect/get-own-metadata-keys", "reflect/has-metadata", "reflect/has-own-metadata", "reflect/metadata", "symbol/dispose", "symbol/observable", "symbol/pattern-match"]); + +const { + types: t$2 +} = _babel.default || _babel; +function canSkipPolyfill(desc, path) { + const { + node, + parent + } = path; + switch (desc.name) { + case "es.string.split": + { + if (!t$2.isCallExpression(parent, { + callee: node + })) return false; + if (parent.arguments.length < 1) return true; + const splitter = parent.arguments[0]; + return t$2.isStringLiteral(splitter) || t$2.isTemplateLiteral(splitter); + } + } +} + +const { + types: t$1 +} = _babel.default || _babel; +const BABEL_RUNTIME = "@babel/runtime-corejs3"; +function callMethod(path, id, optionalCall, wrapCallee) { + const [context1, context2] = maybeMemoizeContext(path.node, path.scope); + let callee = t$1.callExpression(id, [context1]); + if (wrapCallee) callee = wrapCallee(callee); + const call = t$1.identifier("call"); + path.replaceWith(optionalCall ? t$1.optionalMemberExpression(callee, call, false, true) : t$1.memberExpression(callee, call)); + path.parentPath.unshiftContainer("arguments", context2); +} +function maybeMemoizeContext(node, scope) { + const { + object + } = node; + let context1, context2; + if (t$1.isIdentifier(object)) { + context2 = object; + context1 = t$1.cloneNode(object); + } else { + context2 = scope.generateDeclaredUidIdentifier("context"); + context1 = t$1.assignmentExpression("=", t$1.cloneNode(context2), object); + } + return [context1, context2]; +} +function extractOptionalCheck(scope, node) { + let optionalNode = node; + while (!optionalNode.optional && t$1.isOptionalMemberExpression(optionalNode.object)) { + optionalNode = optionalNode.object; + } + optionalNode.optional = false; + const ctx = scope.generateDeclaredUidIdentifier("context"); + const assign = t$1.assignmentExpression("=", ctx, optionalNode.object); + optionalNode.object = t$1.cloneNode(ctx); + return ifNotNullish => t$1.conditionalExpression(t$1.binaryExpression("==", assign, t$1.nullLiteral()), t$1.unaryExpression("void", t$1.numericLiteral(0)), ifNotNullish); +} +function isCoreJSSource(source) { + if (typeof source === "string") { + source = source.replace(/\\/g, "/").replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase(); + } + return Object.prototype.hasOwnProperty.call(corejsEntries, source) && corejsEntries[source]; +} +function coreJSModule(name) { + return `core-js/modules/${name}.js`; +} +function coreJSPureHelper(name, useBabelRuntime, ext) { + return useBabelRuntime ? `${BABEL_RUNTIME}/core-js/${name}${ext}` : `core-js-pure/features/${name}.js`; +} + +const { + types: t, + template: template +} = _babel.default || _babel; +const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility"; +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +const uniqueObjects = ["array", "string", "iterator", "async-iterator", "dom-collections"].map(v => new RegExp(`[a-z]*\\.${v}\\..*`)); +const esnextFallback = (name, cb) => { + if (cb(name)) return true; + if (!name.startsWith("es.")) return false; + const fallback = `esnext.${name.slice(3)}`; + if (!corejs3Polyfills[fallback]) return false; + return cb(fallback); +}; +var index = defineProvider(function ({ + getUtils, + method, + shouldInjectPolyfill, + createMetaResolver, + debug, + babel +}, { + version = 3, + proposals: proposals$1, + shippedProposals, + [presetEnvCompat]: { + noRuntimeName = false + } = {}, + [runtimeCompat]: { + useBabelRuntime = false, + ext = ".js" + } = {} +}) { + const isWebpack = babel.caller(caller => (caller == null ? void 0 : caller.name) === "babel-loader"); + const resolve = createMetaResolver({ + global: BuiltIns, + static: StaticProperties, + instance: InstanceProperties + }); + const available = new Set(getModulesListForTargetVersion(version)); + function getCoreJSPureBase(useProposalBase) { + return useBabelRuntime ? useProposalBase ? `${BABEL_RUNTIME}/core-js` : `${BABEL_RUNTIME}/core-js-stable` : useProposalBase ? "core-js-pure/features" : "core-js-pure/stable"; + } + function maybeInjectGlobalImpl(name, utils) { + if (shouldInjectPolyfill(name)) { + debug(name); + utils.injectGlobalImport(coreJSModule(name), name); + return true; + } + return false; + } + function maybeInjectGlobal(names, utils, fallback = true) { + for (const name of names) { + if (fallback) { + esnextFallback(name, name => maybeInjectGlobalImpl(name, utils)); + } else { + maybeInjectGlobalImpl(name, utils); + } + } + } + function maybeInjectPure(desc, hint, utils, object) { + if (desc.pure && !(object && desc.exclude && desc.exclude.includes(object)) && esnextFallback(desc.name, shouldInjectPolyfill)) { + const { + name + } = desc; + let useProposalBase = false; + if (proposals$1 || shippedProposals && name.startsWith("esnext.")) { + useProposalBase = true; + } else if (name.startsWith("es.") && !available.has(name)) { + useProposalBase = true; + } + if (useBabelRuntime && !(useProposalBase ? proposals : stable).has(desc.pure)) { + return; + } + const coreJSPureBase = getCoreJSPureBase(useProposalBase); + return utils.injectDefaultImport(`${coreJSPureBase}/${desc.pure}${ext}`, hint); + } + } + function isFeatureStable(name) { + if (name.startsWith("esnext.")) { + const esName = `es.${name.slice(7)}`; + // If its imaginative esName is not in latest compat data, it means + // the proposal is not stage 4 + return esName in corejs3Polyfills; + } + return true; + } + return { + name: "corejs3", + runtimeName: noRuntimeName ? null : BABEL_RUNTIME, + polyfills: corejs3Polyfills, + filterPolyfills(name) { + if (!available.has(name)) return false; + if (proposals$1 || method === "entry-global") return true; + if (shippedProposals && corejs3ShippedProposalsList.has(name)) { + return true; + } + return isFeatureStable(name); + }, + entryGlobal(meta, utils, path) { + if (meta.kind !== "import") return; + const modules = isCoreJSSource(meta.source); + if (!modules) return; + if (modules.length === 1 && meta.source === coreJSModule(modules[0]) && shouldInjectPolyfill(modules[0])) { + // Avoid infinite loop: do not replace imports with a new copy of + // themselves. + debug(null); + return; + } + const modulesSet = new Set(modules); + const filteredModules = modules.filter(module => { + if (!module.startsWith("esnext.")) return true; + const stable = module.replace("esnext.", "es."); + if (modulesSet.has(stable) && shouldInjectPolyfill(stable)) { + return false; + } + return true; + }); + maybeInjectGlobal(filteredModules, utils, false); + path.remove(); + }, + usageGlobal(meta, utils, path) { + const resolved = resolve(meta); + if (!resolved) return; + if (canSkipPolyfill(resolved.desc, path)) return; + let deps = resolved.desc.global; + if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") { + const low = meta.object.toLowerCase(); + deps = deps.filter(m => uniqueObjects.some(v => v.test(m)) ? m.includes(low) : true); + } + maybeInjectGlobal(deps, utils); + return true; + }, + usagePure(meta, utils, path) { + if (meta.kind === "in") { + if (meta.key === "Symbol.iterator") { + path.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("is-iterable", useBabelRuntime, ext), "isIterable"), [path.node.right] // meta.kind === "in" narrows this + )); + } + return; + } + if (path.parentPath.isUnaryExpression({ + operator: "delete" + })) return; + if (meta.kind === "property") { + // We can't compile destructuring and updateExpression. + if (!path.isMemberExpression() && !path.isOptionalMemberExpression()) { + return; + } + if (!path.isReferenced()) return; + if (path.parentPath.isUpdateExpression()) return; + if (t.isSuper(path.node.object)) { + return; + } + if (meta.key === "Symbol.iterator") { + if (!shouldInjectPolyfill("es.symbol.iterator")) return; + const { + parent, + node + } = path; + if (t.isCallExpression(parent, { + callee: node + })) { + if (parent.arguments.length === 0) { + path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("get-iterator", useBabelRuntime, ext), "getIterator"), [node.object])); + path.skip(); + } else { + callMethod(path, utils.injectDefaultImport(coreJSPureHelper("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod")); + } + } else { + path.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod"), [path.node.object])); + } + return; + } + } + let resolved = resolve(meta); + if (!resolved) return; + if (canSkipPolyfill(resolved.desc, path)) return; + if (useBabelRuntime && resolved.desc.pure && resolved.desc.pure.slice(-6) === "/index") { + // Remove /index, since it doesn't exist in @babel/runtime-corejs3s + resolved = { + ...resolved, + desc: { + ...resolved.desc, + pure: resolved.desc.pure.slice(0, -6) + } + }; + } + if (resolved.kind === "global") { + const id = maybeInjectPure(resolved.desc, resolved.name, utils); + if (id) path.replaceWith(id); + } else if (resolved.kind === "static") { + const id = maybeInjectPure(resolved.desc, resolved.name, utils, + // @ts-expect-error + meta.object); + if (id) { + path.replaceWith(id); + let { + parentPath + } = path; + if (parentPath.isOptionalMemberExpression() || parentPath.isOptionalCallExpression()) { + do { + const parentAsNotOptional = parentPath; + parentAsNotOptional.type = parentAsNotOptional.node.type = parentPath.type === "OptionalMemberExpression" ? "MemberExpression" : "CallExpression"; + delete parentAsNotOptional.node.optional; + ({ + parentPath + } = parentPath); + } while ((parentPath.isOptionalMemberExpression() || parentPath.isOptionalCallExpression()) && !parentPath.node.optional); + } + } + } else if (resolved.kind === "instance") { + const id = maybeInjectPure(resolved.desc, `${resolved.name}InstanceProperty`, utils, + // @ts-expect-error + meta.object); + if (!id) return; + const { + node, + parent + } = path; + if (t.isOptionalCallExpression(parent) && parent.callee === node) { + const wasOptional = parent.optional; + parent.optional = !wasOptional; + if (!wasOptional) { + const check = extractOptionalCheck(path.scope, node); + const [thisArg, thisArg2] = maybeMemoizeContext(node, path.scope); + path.replaceWith(check(template.expression.ast` + Function.call.bind(${id}(${thisArg}), ${thisArg2}) + `)); + } else if (t.isOptionalMemberExpression(node)) { + const check = extractOptionalCheck(path.scope, node); + callMethod(path, id, true, check); + } else { + callMethod(path, id, true); + } + } else if (t.isCallExpression(parent) && parent.callee === node) { + callMethod(path, id, false); + } else if (t.isOptionalMemberExpression(node)) { + const check = extractOptionalCheck(path.scope, node); + path.replaceWith(check(t.callExpression(id, [node.object]))); + if (t.isOptionalMemberExpression(parent)) parent.optional = true; + } else { + path.replaceWith(t.callExpression(id, [node.object])); + } + } + }, + visitor: method === "usage-global" && { + // import("foo") + CallExpression(path) { + if (path.get("callee").isImport()) { + const utils = getUtils(path); + if (isWebpack) { + // Webpack uses Promise.all to handle dynamic import. + maybeInjectGlobal(PromiseDependenciesWithIterators, utils); + } else { + maybeInjectGlobal(PromiseDependencies, utils); + } + } + }, + // (async function () { }).finally(...) + Function(path) { + if (path.node.async) { + maybeInjectGlobal(PromiseDependencies, getUtils(path)); + } + }, + // for-of, [a, b] = c + "ForOfStatement|ArrayPattern"(path) { + maybeInjectGlobal(CommonIterators, getUtils(path)); + }, + // [...spread] + SpreadElement(path) { + if (!path.parentPath.isObjectExpression()) { + maybeInjectGlobal(CommonIterators, getUtils(path)); + } + }, + // yield* + YieldExpression(path) { + if (path.node.delegate) { + maybeInjectGlobal(CommonIterators, getUtils(path)); + } + }, + // Decorators metadata + Class(path) { + var _path$node$decorators; + const hasDecorators = ((_path$node$decorators = path.node.decorators) == null ? void 0 : _path$node$decorators.length) || path.node.body.body.some(el => { + var _decorators; + return (_decorators = el.decorators) == null ? void 0 : _decorators.length; + }); + if (hasDecorators) { + maybeInjectGlobal(DecoratorMetadataDependencies, getUtils(path)); + } + } + } + }; +}); + +export { index as default }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs.map b/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..9112c1ead27d262d52b1e7cdc933cc3e2848dc5f --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/esm/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../src/shipped-proposals.ts","../src/built-in-definitions.ts","../src/babel-runtime-corejs3-paths.ts","../src/usage-filters.ts","../src/utils.ts","../src/index.ts"],"sourcesContent":["// This file is automatically generated by scripts/build-corejs3-shipped-proposals.mjs\n\nexport default new Set([\n \"esnext.array.group\",\n \"esnext.array.group-to-map\",\n \"esnext.iterator.zip\",\n \"esnext.iterator.zip-keyed\",\n \"esnext.symbol.metadata\",\n]);\n","import corejs3Polyfills from \"../core-js-compat/data.js\";\n\ntype ObjectMap = { [name: string]: V };\ntype ObjectMap2 = ObjectMap>;\n\nexport type CoreJSPolyfillDescriptor = {\n name: string;\n pure: string | null;\n global: string[];\n exclude: string[] | null;\n};\n\nconst polyfillsOrder = {};\nObject.keys(corejs3Polyfills).forEach((name, index) => {\n polyfillsOrder[name] = index;\n});\n\nconst define = (\n pure,\n global,\n name = global[0],\n exclude?,\n): CoreJSPolyfillDescriptor => {\n return {\n name,\n pure,\n global: global.sort((a, b) => polyfillsOrder[a] - polyfillsOrder[b]),\n exclude,\n };\n};\n\nconst typed = (...modules) =>\n define(null, [...modules, ...TypedArrayDependencies]);\n\nconst ArrayNatureIterators = [\n \"es.array.iterator\",\n \"web.dom-collections.iterator\",\n];\n\nexport const CommonIterators = [\"es.string.iterator\", ...ArrayNatureIterators];\n\nconst ArrayNatureIteratorsWithTag = [\n \"es.object.to-string\",\n ...ArrayNatureIterators,\n];\n\nconst CommonIteratorsWithTag = [\"es.object.to-string\", ...CommonIterators];\n\nconst ErrorDependencies = [\"es.error.cause\", \"es.error.to-string\"];\n\nconst SuppressedErrorDependencies = [\n \"es.suppressed-error.constructor\",\n ...ErrorDependencies,\n];\n\nconst ArrayBufferDependencies = [\n \"es.array-buffer.constructor\",\n \"es.array-buffer.slice\",\n \"es.data-view\",\n \"es.array-buffer.detached\",\n \"es.array-buffer.transfer\",\n \"es.array-buffer.transfer-to-fixed-length\",\n \"es.object.to-string\",\n];\n\nconst TypedArrayDependencies = [\n \"es.typed-array.at\",\n \"es.typed-array.copy-within\",\n \"es.typed-array.every\",\n \"es.typed-array.fill\",\n \"es.typed-array.filter\",\n \"es.typed-array.find\",\n \"es.typed-array.find-index\",\n \"es.typed-array.find-last\",\n \"es.typed-array.find-last-index\",\n \"es.typed-array.for-each\",\n \"es.typed-array.includes\",\n \"es.typed-array.index-of\",\n \"es.typed-array.iterator\",\n \"es.typed-array.join\",\n \"es.typed-array.last-index-of\",\n \"es.typed-array.map\",\n \"es.typed-array.reduce\",\n \"es.typed-array.reduce-right\",\n \"es.typed-array.reverse\",\n \"es.typed-array.set\",\n \"es.typed-array.slice\",\n \"es.typed-array.some\",\n \"es.typed-array.sort\",\n \"es.typed-array.subarray\",\n \"es.typed-array.to-locale-string\",\n \"es.typed-array.to-reversed\",\n \"es.typed-array.to-sorted\",\n \"es.typed-array.to-string\",\n \"es.typed-array.with\",\n \"es.object.to-string\",\n \"es.array.iterator\",\n \"esnext.typed-array.filter-reject\",\n \"esnext.typed-array.group-by\",\n \"esnext.typed-array.to-spliced\",\n \"esnext.typed-array.unique-by\",\n ...ArrayBufferDependencies,\n];\n\nexport const PromiseDependencies = [\"es.promise\", \"es.object.to-string\"];\n\nexport const PromiseDependenciesWithIterators = [\n ...PromiseDependencies,\n ...CommonIterators,\n];\n\nconst SymbolDependencies = [\n \"es.symbol\",\n \"es.symbol.description\",\n \"es.object.to-string\",\n];\n\nconst MapDependencies = [\n \"es.map\",\n \"es.map.get-or-insert\",\n \"es.map.get-or-insert-computed\",\n \"esnext.map.delete-all\",\n \"esnext.map.emplace\",\n \"esnext.map.every\",\n \"esnext.map.filter\",\n \"esnext.map.find\",\n \"esnext.map.find-key\",\n \"esnext.map.includes\",\n \"esnext.map.key-of\",\n \"esnext.map.map-keys\",\n \"esnext.map.map-values\",\n \"esnext.map.merge\",\n \"esnext.map.reduce\",\n \"esnext.map.some\",\n \"esnext.map.update\",\n ...CommonIteratorsWithTag,\n];\n\nconst SetDependencies = [\n \"es.set\",\n \"es.set.difference.v2\",\n \"es.set.intersection.v2\",\n \"es.set.is-disjoint-from.v2\",\n \"es.set.is-subset-of.v2\",\n \"es.set.is-superset-of.v2\",\n \"es.set.symmetric-difference.v2\",\n \"es.set.union.v2\",\n \"esnext.set.add-all\",\n \"esnext.set.delete-all\",\n \"esnext.set.difference\",\n \"esnext.set.every\",\n \"esnext.set.filter\",\n \"esnext.set.find\",\n \"esnext.set.intersection\",\n \"esnext.set.is-disjoint-from\",\n \"esnext.set.is-subset-of\",\n \"esnext.set.is-superset-of\",\n \"esnext.set.join\",\n \"esnext.set.map\",\n \"esnext.set.reduce\",\n \"esnext.set.some\",\n \"esnext.set.symmetric-difference\",\n \"esnext.set.union\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakMapDependencies = [\n \"es.weak-map\",\n \"es.weak-map.get-or-insert\",\n \"es.weak-map.get-or-insert-computed\",\n \"esnext.weak-map.delete-all\",\n \"esnext.weak-map.emplace\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakSetDependencies = [\n \"es.weak-set\",\n \"esnext.weak-set.add-all\",\n \"esnext.weak-set.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst DOMExceptionDependencies = [\n \"web.dom-exception.constructor\",\n \"web.dom-exception.stack\",\n \"web.dom-exception.to-string-tag\",\n \"es.error.to-string\",\n];\n\nconst URLSearchParamsDependencies = [\n \"web.url-search-params\",\n \"web.url-search-params.delete\",\n \"web.url-search-params.has\",\n \"web.url-search-params.size\",\n ...CommonIteratorsWithTag,\n];\n\nconst AsyncIteratorDependencies = [\n \"esnext.async-iterator.constructor\",\n ...PromiseDependencies,\n];\n\nconst AsyncIteratorProblemMethods = [\n \"esnext.async-iterator.every\",\n \"esnext.async-iterator.filter\",\n \"esnext.async-iterator.find\",\n \"esnext.async-iterator.flat-map\",\n \"esnext.async-iterator.for-each\",\n \"esnext.async-iterator.map\",\n \"esnext.async-iterator.reduce\",\n \"esnext.async-iterator.some\",\n];\n\nconst IteratorDependencies = [\"es.iterator.constructor\", \"es.object.to-string\"];\n\nexport const DecoratorMetadataDependencies = [\n \"esnext.symbol.metadata\",\n \"esnext.function.metadata\",\n];\n\nconst TypedArrayStaticMethods = (base: string) => ({\n from: define(null, [\"es.typed-array.from\", base, ...TypedArrayDependencies]),\n fromAsync: define(null, [\n \"esnext.typed-array.from-async\",\n base,\n ...PromiseDependenciesWithIterators,\n ...TypedArrayDependencies,\n ]),\n of: define(null, [\"es.typed-array.of\", base, ...TypedArrayDependencies]),\n});\n\nconst DataViewDependencies = [\"es.data-view\", ...ArrayBufferDependencies];\n\nexport const BuiltIns: ObjectMap = {\n AsyncDisposableStack: define(\"async-disposable-stack/index\", [\n \"es.async-disposable-stack.constructor\",\n \"es.object.to-string\",\n \"es.async-iterator.async-dispose\",\n \"es.iterator.dispose\",\n ...PromiseDependencies,\n ...SuppressedErrorDependencies,\n ]),\n AsyncIterator: define(\"async-iterator/index\", AsyncIteratorDependencies),\n AggregateError: define(\"aggregate-error\", [\n \"es.aggregate-error\",\n ...ErrorDependencies,\n ...CommonIteratorsWithTag,\n \"es.aggregate-error.cause\",\n ]),\n ArrayBuffer: define(null, ArrayBufferDependencies),\n DataView: define(null, DataViewDependencies),\n Date: define(null, [\"es.date.to-string\"]),\n DOMException: define(\"dom-exception/index\", DOMExceptionDependencies),\n DisposableStack: define(\"disposable-stack/index\", [\n \"es.disposable-stack.constructor\",\n \"es.object.to-string\",\n \"es.iterator.dispose\",\n ...SuppressedErrorDependencies,\n ]),\n Error: define(null, ErrorDependencies),\n EvalError: define(null, ErrorDependencies),\n Float32Array: typed(\"es.typed-array.float32-array\"),\n Float64Array: typed(\"es.typed-array.float64-array\"),\n Int8Array: typed(\"es.typed-array.int8-array\"),\n Int16Array: typed(\"es.typed-array.int16-array\"),\n Int32Array: typed(\"es.typed-array.int32-array\"),\n Iterator: define(\"iterator/index\", IteratorDependencies),\n Uint8Array: typed(\n \"es.typed-array.uint8-array\",\n \"es.uint8-array.set-from-base64\",\n \"es.uint8-array.set-from-hex\",\n \"es.uint8-array.to-base64\",\n \"es.uint8-array.to-hex\",\n ),\n Uint8ClampedArray: typed(\"es.typed-array.uint8-clamped-array\"),\n Uint16Array: typed(\"es.typed-array.uint16-array\"),\n Uint32Array: typed(\"es.typed-array.uint32-array\"),\n Map: define(\"map/index\", MapDependencies),\n Number: define(null, [\"es.number.constructor\"]),\n Observable: define(\"observable/index\", [\n \"esnext.observable\",\n \"esnext.symbol.observable\",\n \"es.object.to-string\",\n ...CommonIteratorsWithTag,\n ]),\n Promise: define(\"promise/index\", PromiseDependencies),\n RangeError: define(null, ErrorDependencies),\n ReferenceError: define(null, ErrorDependencies),\n Reflect: define(null, [\"es.reflect.to-string-tag\", \"es.object.to-string\"]),\n RegExp: define(null, [\n \"es.regexp.constructor\",\n \"es.regexp.dot-all\",\n \"es.regexp.exec\",\n \"es.regexp.sticky\",\n \"es.regexp.to-string\",\n ]),\n Set: define(\"set/index\", SetDependencies),\n SuppressedError: define(\"suppressed-error\", SuppressedErrorDependencies),\n Symbol: define(\"symbol/index\", SymbolDependencies),\n SyntaxError: define(null, ErrorDependencies),\n TypeError: define(null, ErrorDependencies),\n URIError: define(null, ErrorDependencies),\n URL: define(\"url/index\", [\n \"web.url\",\n \"web.url.to-json\",\n ...URLSearchParamsDependencies,\n ]),\n URLSearchParams: define(\n \"url-search-params/index\",\n URLSearchParamsDependencies,\n ),\n WeakMap: define(\"weak-map/index\", WeakMapDependencies),\n WeakSet: define(\"weak-set/index\", WeakSetDependencies),\n\n atob: define(\"atob\", [\"web.atob\", ...DOMExceptionDependencies]),\n btoa: define(\"btoa\", [\"web.btoa\", ...DOMExceptionDependencies]),\n clearImmediate: define(\"clear-immediate\", [\"web.immediate\"]),\n compositeKey: define(\"composite-key\", [\"esnext.composite-key\"]),\n compositeSymbol: define(\"composite-symbol\", [\"esnext.composite-symbol\"]),\n escape: define(\"escape\", [\"es.escape\"]),\n fetch: define(null, PromiseDependencies),\n globalThis: define(\"global-this\", [\"es.global-this\"]),\n parseFloat: define(\"parse-float\", [\"es.parse-float\"]),\n parseInt: define(\"parse-int\", [\"es.parse-int\"]),\n queueMicrotask: define(\"queue-microtask\", [\"web.queue-microtask\"]),\n self: define(\"self\", [\"web.self\"]),\n setImmediate: define(\"set-immediate\", [\"web.immediate\"]),\n setInterval: define(\"set-interval\", [\"web.timers\"]),\n setTimeout: define(\"set-timeout\", [\"web.timers\"]),\n structuredClone: define(\"structured-clone\", [\n \"web.structured-clone\",\n ...DOMExceptionDependencies,\n \"es.array.iterator\",\n \"es.object.keys\",\n \"es.object.to-string\",\n \"es.map\",\n \"es.set\",\n ]),\n unescape: define(\"unescape\", [\"es.unescape\"]),\n};\n\nexport const StaticProperties: ObjectMap2 = {\n AsyncIterator: {\n from: define(\"async-iterator/from\", [\n \"esnext.async-iterator.from\",\n ...AsyncIteratorDependencies,\n ...AsyncIteratorProblemMethods,\n ...CommonIterators,\n ]),\n },\n Array: {\n from: define(\"array/from\", [\"es.array.from\", \"es.string.iterator\"]),\n fromAsync: define(\"array/from-async\", [\n \"es.array.from-async\",\n ...PromiseDependenciesWithIterators,\n ]),\n isArray: define(\"array/is-array\", [\"es.array.is-array\"]),\n isTemplateObject: define(\"array/is-template-object\", [\n \"esnext.array.is-template-object\",\n ]),\n of: define(\"array/of\", [\"es.array.of\"]),\n },\n\n ArrayBuffer: {\n isView: define(null, [\"es.array-buffer.is-view\"]),\n },\n\n BigInt: {\n range: define(\"bigint/range\", [\n \"esnext.bigint.range\",\n \"es.object.to-string\",\n ]),\n },\n\n Date: {\n now: define(\"date/now\", [\"es.date.now\"]),\n },\n\n Error: {\n isError: define(\"error/is-error\", [\n \"es.error.is-error\",\n \"es.object.create\",\n ]),\n },\n\n Function: {\n isCallable: define(\"function/is-callable\", [\"esnext.function.is-callable\"]),\n isConstructor: define(\"function/is-constructor\", [\n \"esnext.function.is-constructor\",\n ]),\n },\n\n Iterator: {\n concat: define(\"iterator/concat\", [\n \"es.iterator.concat\",\n ...IteratorDependencies,\n ...CommonIterators,\n ]),\n from: define(\"iterator/from\", [\n \"es.iterator.from\",\n ...IteratorDependencies,\n ...CommonIterators,\n ]),\n range: define(\"iterator/range\", [\n \"esnext.iterator.range\",\n ...IteratorDependencies,\n ]),\n zip: define(\"iterator/zip\", [\n \"esnext.iterator.zip\",\n ...IteratorDependencies,\n ...CommonIterators,\n ]),\n zipKeyed: define(\"iterator/zip-keyed\", [\n \"esnext.iterator.zip-keyed\",\n \"es.object.create\",\n \"es.reflect.own-keys\",\n ...IteratorDependencies,\n ...CommonIterators,\n ]),\n },\n\n JSON: {\n isRawJSON: define(\"json/is-raw-json\", [\"es.json.is-raw-json\"]),\n parse: define(\"json/parse\", [\"es.json.parse\", \"es.object.keys\"]),\n rawJSON: define(\"json/raw-json\", [\n \"es.json.raw-json\",\n \"es.object.create\",\n \"es.object.freeze\",\n ]),\n stringify: define(\"json/stringify\", [\n \"es.json.stringify\",\n \"es.date.to-json\",\n ]),\n },\n\n Math: {\n DEG_PER_RAD: define(\"math/deg-per-rad\", [\"esnext.math.deg-per-rad\"]),\n RAD_PER_DEG: define(\"math/rad-per-deg\", [\"esnext.math.rad-per-deg\"]),\n acosh: define(\"math/acosh\", [\"es.math.acosh\"]),\n asinh: define(\"math/asinh\", [\"es.math.asinh\"]),\n atanh: define(\"math/atanh\", [\"es.math.atanh\"]),\n cbrt: define(\"math/cbrt\", [\"es.math.cbrt\"]),\n clamp: define(\"math/clamp\", [\"esnext.math.clamp\"]),\n clz32: define(\"math/clz32\", [\"es.math.clz32\"]),\n cosh: define(\"math/cosh\", [\"es.math.cosh\"]),\n degrees: define(\"math/degrees\", [\"esnext.math.degrees\"]),\n expm1: define(\"math/expm1\", [\"es.math.expm1\"]),\n fround: define(\"math/fround\", [\"es.math.fround\"]),\n f16round: define(\"math/f16round\", [\"es.math.f16round\"]),\n fscale: define(\"math/fscale\", [\"esnext.math.fscale\"]),\n hypot: define(\"math/hypot\", [\"es.math.hypot\"]),\n iaddh: define(\"math/iaddh\", [\"esnext.math.iaddh\"]),\n imul: define(\"math/imul\", [\"es.math.imul\"]),\n imulh: define(\"math/imulh\", [\"esnext.math.imulh\"]),\n isubh: define(\"math/isubh\", [\"esnext.math.isubh\"]),\n log10: define(\"math/log10\", [\"es.math.log10\"]),\n log1p: define(\"math/log1p\", [\"es.math.log1p\"]),\n log2: define(\"math/log2\", [\"es.math.log2\"]),\n radians: define(\"math/radians\", [\"esnext.math.radians\"]),\n scale: define(\"math/scale\", [\"esnext.math.scale\"]),\n seededPRNG: define(\"math/seeded-prng\", [\"esnext.math.seeded-prng\"]),\n sign: define(\"math/sign\", [\"es.math.sign\"]),\n signbit: define(\"math/signbit\", [\"esnext.math.signbit\"]),\n sinh: define(\"math/sinh\", [\"es.math.sinh\"]),\n sumPrecise: define(\"math/sum-precise\", [\n \"es.math.sum-precise\",\n \"es.array.iterator\",\n ]),\n tanh: define(\"math/tanh\", [\"es.math.tanh\"]),\n trunc: define(\"math/trunc\", [\"es.math.trunc\"]),\n umulh: define(\"math/umulh\", [\"esnext.math.umulh\"]),\n },\n\n Map: {\n from: define(\"map/from\", [\"esnext.map.from\", ...MapDependencies]),\n groupBy: define(\"map/group-by\", [\"es.map.group-by\", ...MapDependencies]),\n keyBy: define(\"map/key-by\", [\"esnext.map.key-by\", ...MapDependencies]),\n of: define(\"map/of\", [\"esnext.map.of\", ...MapDependencies]),\n },\n\n Number: {\n EPSILON: define(\"number/epsilon\", [\"es.number.epsilon\"]),\n MAX_SAFE_INTEGER: define(\"number/max-safe-integer\", [\n \"es.number.max-safe-integer\",\n ]),\n MIN_SAFE_INTEGER: define(\"number/min-safe-integer\", [\n \"es.number.min-safe-integer\",\n ]),\n fromString: define(\"number/from-string\", [\"esnext.number.from-string\"]),\n isFinite: define(\"number/is-finite\", [\"es.number.is-finite\"]),\n isInteger: define(\"number/is-integer\", [\"es.number.is-integer\"]),\n isNaN: define(\"number/is-nan\", [\"es.number.is-nan\"]),\n isSafeInteger: define(\"number/is-safe-integer\", [\n \"es.number.is-safe-integer\",\n ]),\n parseFloat: define(\"number/parse-float\", [\"es.number.parse-float\"]),\n parseInt: define(\"number/parse-int\", [\"es.number.parse-int\"]),\n range: define(\"number/range\", [\n \"esnext.number.range\",\n \"es.object.to-string\",\n ]),\n },\n\n Object: {\n assign: define(\"object/assign\", [\"es.object.assign\"]),\n create: define(\"object/create\", [\"es.object.create\"]),\n defineProperties: define(\"object/define-properties\", [\n \"es.object.define-properties\",\n ]),\n defineProperty: define(\"object/define-property\", [\n \"es.object.define-property\",\n ]),\n entries: define(\"object/entries\", [\"es.object.entries\"]),\n freeze: define(\"object/freeze\", [\"es.object.freeze\"]),\n fromEntries: define(\"object/from-entries\", [\n \"es.object.from-entries\",\n \"es.array.iterator\",\n ]),\n getOwnPropertyDescriptor: define(\"object/get-own-property-descriptor\", [\n \"es.object.get-own-property-descriptor\",\n ]),\n getOwnPropertyDescriptors: define(\"object/get-own-property-descriptors\", [\n \"es.object.get-own-property-descriptors\",\n ]),\n getOwnPropertyNames: define(\"object/get-own-property-names\", [\n \"es.object.get-own-property-names\",\n ]),\n getOwnPropertySymbols: define(\"object/get-own-property-symbols\", [\n \"es.symbol\",\n ]),\n getPrototypeOf: define(\"object/get-prototype-of\", [\n \"es.object.get-prototype-of\",\n ]),\n groupBy: define(\"object/group-by\", [\n \"es.object.group-by\",\n \"es.object.create\",\n ]),\n hasOwn: define(\"object/has-own\", [\"es.object.has-own\"]),\n is: define(\"object/is\", [\"es.object.is\"]),\n isExtensible: define(\"object/is-extensible\", [\"es.object.is-extensible\"]),\n isFrozen: define(\"object/is-frozen\", [\"es.object.is-frozen\"]),\n isSealed: define(\"object/is-sealed\", [\"es.object.is-sealed\"]),\n keys: define(\"object/keys\", [\"es.object.keys\"]),\n preventExtensions: define(\"object/prevent-extensions\", [\n \"es.object.prevent-extensions\",\n ]),\n seal: define(\"object/seal\", [\"es.object.seal\"]),\n setPrototypeOf: define(\"object/set-prototype-of\", [\n \"es.object.set-prototype-of\",\n ]),\n values: define(\"object/values\", [\"es.object.values\"]),\n },\n\n Promise: {\n all: define(null, PromiseDependenciesWithIterators),\n allSettled: define(\"promise/all-settled\", [\n \"es.promise.all-settled\",\n ...PromiseDependenciesWithIterators,\n ]),\n any: define(\"promise/any\", [\n \"es.promise.any\",\n \"es.aggregate-error\",\n ...PromiseDependenciesWithIterators,\n ]),\n race: define(null, PromiseDependenciesWithIterators),\n try: define(\"promise/try\", [\"es.promise.try\", ...PromiseDependencies]),\n withResolvers: define(\"promise/with-resolvers\", [\n \"es.promise.with-resolvers\",\n ...PromiseDependencies,\n ]),\n },\n\n Reflect: {\n apply: define(\"reflect/apply\", [\"es.reflect.apply\"]),\n construct: define(\"reflect/construct\", [\"es.reflect.construct\"]),\n defineMetadata: define(\"reflect/define-metadata\", [\n \"esnext.reflect.define-metadata\",\n ]),\n defineProperty: define(\"reflect/define-property\", [\n \"es.reflect.define-property\",\n ]),\n deleteMetadata: define(\"reflect/delete-metadata\", [\n \"esnext.reflect.delete-metadata\",\n ]),\n deleteProperty: define(\"reflect/delete-property\", [\n \"es.reflect.delete-property\",\n ]),\n get: define(\"reflect/get\", [\"es.reflect.get\"]),\n getMetadata: define(\"reflect/get-metadata\", [\n \"esnext.reflect.get-metadata\",\n ]),\n getMetadataKeys: define(\"reflect/get-metadata-keys\", [\n \"esnext.reflect.get-metadata-keys\",\n ]),\n getOwnMetadata: define(\"reflect/get-own-metadata\", [\n \"esnext.reflect.get-own-metadata\",\n ]),\n getOwnMetadataKeys: define(\"reflect/get-own-metadata-keys\", [\n \"esnext.reflect.get-own-metadata-keys\",\n ]),\n getOwnPropertyDescriptor: define(\"reflect/get-own-property-descriptor\", [\n \"es.reflect.get-own-property-descriptor\",\n ]),\n getPrototypeOf: define(\"reflect/get-prototype-of\", [\n \"es.reflect.get-prototype-of\",\n ]),\n has: define(\"reflect/has\", [\"es.reflect.has\"]),\n hasMetadata: define(\"reflect/has-metadata\", [\n \"esnext.reflect.has-metadata\",\n ]),\n hasOwnMetadata: define(\"reflect/has-own-metadata\", [\n \"esnext.reflect.has-own-metadata\",\n ]),\n isExtensible: define(\"reflect/is-extensible\", [\"es.reflect.is-extensible\"]),\n metadata: define(\"reflect/metadata\", [\"esnext.reflect.metadata\"]),\n ownKeys: define(\"reflect/own-keys\", [\"es.reflect.own-keys\"]),\n preventExtensions: define(\"reflect/prevent-extensions\", [\n \"es.reflect.prevent-extensions\",\n ]),\n set: define(\"reflect/set\", [\"es.reflect.set\"]),\n setPrototypeOf: define(\"reflect/set-prototype-of\", [\n \"es.reflect.set-prototype-of\",\n ]),\n },\n\n RegExp: {\n escape: define(\"regexp/escape\", [\"es.regexp.escape\"]),\n },\n\n Set: {\n from: define(\"set/from\", [\"esnext.set.from\", ...SetDependencies]),\n of: define(\"set/of\", [\"esnext.set.of\", ...SetDependencies]),\n },\n\n String: {\n cooked: define(\"string/cooked\", [\"esnext.string.cooked\"]),\n dedent: define(\"string/dedent\", [\n \"esnext.string.dedent\",\n \"es.string.from-code-point\",\n \"es.weak-map\",\n ]),\n fromCodePoint: define(\"string/from-code-point\", [\n \"es.string.from-code-point\",\n ]),\n raw: define(\"string/raw\", [\"es.string.raw\"]),\n },\n\n Symbol: {\n asyncDispose: define(\"symbol/async-dispose\", [\n \"es.symbol.async-dispose\",\n \"es.async-iterator.async-dispose\",\n ]),\n asyncIterator: define(\"symbol/async-iterator\", [\n \"es.symbol.async-iterator\",\n ]),\n customMatcher: define(\"symbol/custom-matcher\", [\n \"esnext.symbol.custom-matcher\",\n ]),\n dispose: define(\"symbol/dispose\", [\n \"es.symbol.dispose\",\n \"es.iterator.dispose\",\n ]),\n for: define(\"symbol/for\", [], \"es.symbol\"),\n hasInstance: define(\"symbol/has-instance\", [\n \"es.symbol.has-instance\",\n \"es.function.has-instance\",\n ]),\n isConcatSpreadable: define(\"symbol/is-concat-spreadable\", [\n \"es.symbol.is-concat-spreadable\",\n \"es.array.concat\",\n ]),\n isRegistered: define(\"symbol/is-registered\", [\n \"esnext.symbol.is-registered\",\n \"es.symbol\",\n ]),\n isRegisteredSymbol: define(\"symbol/is-registered-symbol\", [\n \"esnext.symbol.is-registered-symbol\",\n \"es.symbol\",\n ]),\n isWellKnown: define(\"symbol/is-well-known\", [\n \"esnext.symbol.is-well-known\",\n \"es.symbol\",\n ]),\n isWellKnownSymbol: define(\"symbol/is-well-known-symbol\", [\n \"esnext.symbol.is-well-known-symbol\",\n \"es.symbol\",\n ]),\n iterator: define(\"symbol/iterator\", [\n \"es.symbol.iterator\",\n ...CommonIteratorsWithTag,\n ]),\n keyFor: define(\"symbol/key-for\", [], \"es.symbol\"),\n match: define(\"symbol/match\", [\"es.symbol.match\", \"es.string.match\"]),\n matcher: define(\"symbol/matcher\", [\"esnext.symbol.matcher\"]),\n matchAll: define(\"symbol/match-all\", [\n \"es.symbol.match-all\",\n \"es.string.match-all\",\n ]),\n metadata: define(\"symbol/metadata\", DecoratorMetadataDependencies),\n metadataKey: define(\"symbol/metadata-key\", [\"esnext.symbol.metadata-key\"]),\n observable: define(\"symbol/observable\", [\"esnext.symbol.observable\"]),\n patternMatch: define(\"symbol/pattern-match\", [\n \"esnext.symbol.pattern-match\",\n ]),\n replace: define(\"symbol/replace\", [\n \"es.symbol.replace\",\n \"es.string.replace\",\n ]),\n search: define(\"symbol/search\", [\"es.symbol.search\", \"es.string.search\"]),\n species: define(\"symbol/species\", [\n \"es.symbol.species\",\n \"es.array.species\",\n ]),\n split: define(\"symbol/split\", [\"es.symbol.split\", \"es.string.split\"]),\n toPrimitive: define(\"symbol/to-primitive\", [\n \"es.symbol.to-primitive\",\n \"es.date.to-primitive\",\n ]),\n toStringTag: define(\"symbol/to-string-tag\", [\n \"es.symbol.to-string-tag\",\n \"es.object.to-string\",\n \"es.math.to-string-tag\",\n \"es.json.to-string-tag\",\n ]),\n unscopables: define(\"symbol/unscopables\", [\"es.symbol.unscopables\"]),\n },\n\n URL: {\n canParse: define(\"url/can-parse\", [\"web.url.can-parse\", \"web.url\"]),\n parse: define(\"url/parse\", [\"web.url.parse\", \"web.url\"]),\n },\n\n WeakMap: {\n from: define(\"weak-map/from\", [\n \"esnext.weak-map.from\",\n ...WeakMapDependencies,\n ]),\n of: define(\"weak-map/of\", [\"esnext.weak-map.of\", ...WeakMapDependencies]),\n },\n\n WeakSet: {\n from: define(\"weak-set/from\", [\n \"esnext.weak-set.from\",\n ...WeakSetDependencies,\n ]),\n of: define(\"weak-set/of\", [\"esnext.weak-set.of\", ...WeakSetDependencies]),\n },\n\n Int8Array: TypedArrayStaticMethods(\"es.typed-array.int8-array\"),\n Uint8Array: {\n fromBase64: define(null, [\n \"es.uint8-array.from-base64\",\n ...TypedArrayDependencies,\n ]),\n fromHex: define(null, [\n \"es.uint8-array.from-hex\",\n ...TypedArrayDependencies,\n ]),\n ...TypedArrayStaticMethods(\"es.typed-array.uint8-array\"),\n },\n Uint8ClampedArray: TypedArrayStaticMethods(\n \"es.typed-array.uint8-clamped-array\",\n ),\n Int16Array: TypedArrayStaticMethods(\"es.typed-array.int16-array\"),\n Uint16Array: TypedArrayStaticMethods(\"es.typed-array.uint16-array\"),\n Int32Array: TypedArrayStaticMethods(\"es.typed-array.int32-array\"),\n Uint32Array: TypedArrayStaticMethods(\"es.typed-array.uint32-array\"),\n Float32Array: TypedArrayStaticMethods(\"es.typed-array.float32-array\"),\n Float64Array: TypedArrayStaticMethods(\"es.typed-array.float64-array\"),\n\n WebAssembly: {\n CompileError: define(null, ErrorDependencies),\n LinkError: define(null, ErrorDependencies),\n RuntimeError: define(null, ErrorDependencies),\n },\n};\n\n[\n \"AggregateError\",\n \"EvalError\",\n \"RangeError\",\n \"ReferenceError\",\n \"SuppressedError\",\n \"SyntaxError\",\n \"TypeError\",\n \"URIError\",\n].forEach(ERROR_SUBCLASS => {\n StaticProperties[ERROR_SUBCLASS] = StaticProperties.Error;\n});\n\nexport const InstanceProperties = {\n asIndexedPairs: define(null, [\n \"esnext.async-iterator.as-indexed-pairs\",\n ...AsyncIteratorDependencies,\n \"esnext.iterator.as-indexed-pairs\",\n ...IteratorDependencies,\n ]),\n at: define(\"instance/at\", [\n // TODO: We should introduce overloaded instance methods definition\n // Before that is implemented, the `esnext.string.at` must be the first\n // In pure mode, the provider resolves the descriptor as a \"pure\" `esnext.string.at`\n // and treats the compat-data of `esnext.string.at` as the compat-data of\n // pure import `instance/at`. The first polyfill here should have the lowest corejs\n // supported versions.\n \"esnext.string.at\",\n \"es.string.at-alternative\",\n \"es.array.at\",\n ]),\n anchor: define(null, [\"es.string.anchor\"]),\n big: define(null, [\"es.string.big\"]),\n bind: define(\"instance/bind\", [\"es.function.bind\"]),\n blink: define(null, [\"es.string.blink\"]),\n bold: define(null, [\"es.string.bold\"]),\n chunks: define(null, [\"esnext.iterator.chunks\", ...IteratorDependencies]),\n clamp: define(\"instance/clamp\", [\"esnext.number.clamp\"]),\n codePointAt: define(\"instance/code-point-at\", [\"es.string.code-point-at\"]),\n codePoints: define(\"instance/code-points\", [\"esnext.string.code-points\"]),\n concat: define(\"instance/concat\", [\"es.array.concat\"], undefined, [\"String\"]),\n copyWithin: define(\"instance/copy-within\", [\"es.array.copy-within\"]),\n demethodize: define(\"instance/demethodize\", [\"esnext.function.demethodize\"]),\n description: define(null, [\"es.symbol\", \"es.symbol.description\"]),\n dotAll: define(null, [\"es.regexp.dot-all\"]),\n drop: define(null, [\n \"es.iterator.drop\",\n ...IteratorDependencies,\n \"esnext.async-iterator.drop\",\n ...AsyncIteratorDependencies,\n ]),\n endsWith: define(\"instance/ends-with\", [\"es.string.ends-with\"]),\n entries: define(\"instance/entries\", ArrayNatureIteratorsWithTag),\n every: define(\"instance/every\", [\n \"es.array.every\",\n \"es.iterator.every\",\n ...IteratorDependencies,\n // TODO: add async iterator dependencies when we support sub-dependencies\n // esnext.async-iterator.every depends on es.promise\n // but we don't want to pull es.promise when esnext.async-iterator is disabled\n //\n // \"esnext.async-iterator.every\",\n // ...AsyncIteratorDependencies\n ]),\n exec: define(null, [\"es.regexp.exec\"]),\n fill: define(\"instance/fill\", [\"es.array.fill\"]),\n filter: define(\"instance/filter\", [\n \"es.array.filter\",\n \"es.iterator.filter\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.filter\",\n ]),\n filterReject: define(\"instance/filter-reject\", [\n \"esnext.array.filter-reject\",\n ]),\n finally: define(null, [\"es.promise.finally\", ...PromiseDependencies]),\n find: define(\"instance/find\", [\n \"es.array.find\",\n \"es.iterator.find\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.find\",\n ]),\n findIndex: define(\"instance/find-index\", [\"es.array.find-index\"]),\n findLast: define(\"instance/find-last\", [\"es.array.find-last\"]),\n findLastIndex: define(\"instance/find-last-index\", [\n \"es.array.find-last-index\",\n ]),\n fixed: define(null, [\"es.string.fixed\"]),\n flags: define(\"instance/flags\", [\"es.regexp.flags\"]),\n flatMap: define(\"instance/flat-map\", [\n \"es.array.flat-map\",\n \"es.array.unscopables.flat-map\",\n \"es.iterator.flat-map\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.flat-map\",\n ]),\n flat: define(\"instance/flat\", [\"es.array.flat\", \"es.array.unscopables.flat\"]),\n getFloat16: define(null, [\n \"es.data-view.get-float16\",\n ...DataViewDependencies,\n ]),\n getUint8Clamped: define(null, [\n \"esnext.data-view.get-uint8-clamped\",\n ...DataViewDependencies,\n ]),\n getYear: define(null, [\"es.date.get-year\"]),\n group: define(\"instance/group\", [\"esnext.array.group\"]),\n groupBy: define(\"instance/group-by\", [\"esnext.array.group-by\"]),\n groupByToMap: define(\"instance/group-by-to-map\", [\n \"esnext.array.group-by-to-map\",\n \"es.map\",\n \"es.object.to-string\",\n ]),\n groupToMap: define(\"instance/group-to-map\", [\n \"esnext.array.group-to-map\",\n \"es.map\",\n \"es.object.to-string\",\n ]),\n fontcolor: define(null, [\"es.string.fontcolor\"]),\n fontsize: define(null, [\"es.string.fontsize\"]),\n forEach: define(\"instance/for-each\", [\n \"es.array.for-each\",\n \"es.iterator.for-each\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.for-each\",\n \"web.dom-collections.for-each\",\n ]),\n includes: define(\"instance/includes\", [\n \"es.array.includes\",\n \"es.string.includes\",\n ]),\n indexed: define(null, [\n \"esnext.async-iterator.indexed\",\n ...AsyncIteratorDependencies,\n \"esnext.iterator.indexed\",\n ...IteratorDependencies,\n ]),\n indexOf: define(\"instance/index-of\", [\"es.array.index-of\"]),\n isWellFormed: define(\"instance/is-well-formed\", [\"es.string.is-well-formed\"]),\n italics: define(null, [\"es.string.italics\"]),\n join: define(null, [\"es.array.join\"]),\n keys: define(\"instance/keys\", ArrayNatureIteratorsWithTag),\n lastIndex: define(null, [\"esnext.array.last-index\"]),\n lastIndexOf: define(\"instance/last-index-of\", [\"es.array.last-index-of\"]),\n lastItem: define(null, [\"esnext.array.last-item\"]),\n link: define(null, [\"es.string.link\"]),\n map: define(\"instance/map\", [\n \"es.array.map\",\n \"es.iterator.map\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.map\",\n ]),\n match: define(null, [\"es.string.match\", \"es.regexp.exec\"]),\n matchAll: define(\"instance/match-all\", [\n \"es.string.match-all\",\n \"es.regexp.exec\",\n ]),\n name: define(null, [\"es.function.name\"]),\n padEnd: define(\"instance/pad-end\", [\"es.string.pad-end\"]),\n padStart: define(\"instance/pad-start\", [\"es.string.pad-start\"]),\n push: define(\"instance/push\", [\"es.array.push\"]),\n reduce: define(\"instance/reduce\", [\n \"es.array.reduce\",\n \"es.iterator.reduce\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.reduce\",\n ]),\n reduceRight: define(\"instance/reduce-right\", [\"es.array.reduce-right\"]),\n repeat: define(\"instance/repeat\", [\"es.string.repeat\"]),\n replace: define(null, [\"es.string.replace\", \"es.regexp.exec\"]),\n replaceAll: define(\"instance/replace-all\", [\n \"es.string.replace-all\",\n \"es.string.replace\",\n \"es.regexp.exec\",\n ]),\n reverse: define(\"instance/reverse\", [\"es.array.reverse\"]),\n search: define(null, [\"es.string.search\", \"es.regexp.exec\"]),\n setFloat16: define(null, [\n \"es.data-view.set-float16\",\n ...DataViewDependencies,\n ]),\n setUint8Clamped: define(null, [\n \"esnext.data-view.set-uint8-clamped\",\n ...DataViewDependencies,\n ]),\n setYear: define(null, [\"es.date.set-year\"]),\n slice: define(\"instance/slice\", [\"es.array.slice\"]),\n sliding: define(null, [\"esnext.iterator.sliding\", ...IteratorDependencies]),\n small: define(null, [\"es.string.small\"]),\n some: define(\"instance/some\", [\n \"es.array.some\",\n \"es.iterator.some\",\n ...IteratorDependencies,\n // \"esnext.async-iterator.some\",\n ]),\n sort: define(\"instance/sort\", [\"es.array.sort\"]),\n splice: define(\"instance/splice\", [\"es.array.splice\"]),\n split: define(null, [\"es.string.split\", \"es.regexp.exec\"]),\n startsWith: define(\"instance/starts-with\", [\"es.string.starts-with\"]),\n sticky: define(null, [\"es.regexp.sticky\"]),\n strike: define(null, [\"es.string.strike\"]),\n sub: define(null, [\"es.string.sub\"]),\n substr: define(null, [\"es.string.substr\"]),\n sup: define(null, [\"es.string.sup\"]),\n take: define(null, [\n \"es.iterator.take\",\n ...IteratorDependencies,\n \"esnext.async-iterator.take\",\n ...AsyncIteratorDependencies,\n ]),\n test: define(null, [\"es.regexp.test\", \"es.regexp.exec\"]),\n toArray: define(null, [\n \"es.iterator.to-array\",\n ...IteratorDependencies,\n \"esnext.async-iterator.to-array\",\n ...AsyncIteratorDependencies,\n ]),\n toAsync: define(null, [\n \"esnext.iterator.to-async\",\n ...IteratorDependencies,\n ...AsyncIteratorDependencies,\n ...AsyncIteratorProblemMethods,\n ]),\n toExponential: define(null, [\"es.number.to-exponential\"]),\n toFixed: define(null, [\"es.number.to-fixed\"]),\n toGMTString: define(null, [\"es.date.to-gmt-string\"]),\n toISOString: define(null, [\"es.date.to-iso-string\"]),\n toJSON: define(null, [\"es.date.to-json\"]),\n toPrecision: define(null, [\"es.number.to-precision\"]),\n toReversed: define(\"instance/to-reversed\", [\"es.array.to-reversed\"]),\n toSorted: define(\"instance/to-sorted\", [\n \"es.array.to-sorted\",\n \"es.array.sort\",\n ]),\n toSpliced: define(\"instance/to-spliced\", [\"es.array.to-spliced\"]),\n toString: define(null, [\n \"es.object.to-string\",\n \"es.error.to-string\",\n \"es.date.to-string\",\n \"es.regexp.to-string\",\n ]),\n toWellFormed: define(\"instance/to-well-formed\", [\"es.string.to-well-formed\"]),\n trim: define(\"instance/trim\", [\"es.string.trim\"]),\n trimEnd: define(\"instance/trim-end\", [\"es.string.trim-end\"]),\n trimLeft: define(\"instance/trim-left\", [\"es.string.trim-start\"]),\n trimRight: define(\"instance/trim-right\", [\"es.string.trim-end\"]),\n trimStart: define(\"instance/trim-start\", [\"es.string.trim-start\"]),\n uniqueBy: define(\"instance/unique-by\", [\"esnext.array.unique-by\", \"es.map\"]),\n unshift: define(\"instance/unshift\", [\"es.array.unshift\"]),\n unThis: define(\"instance/un-this\", [\"esnext.function.un-this\"]),\n values: define(\"instance/values\", ArrayNatureIteratorsWithTag),\n windows: define(null, [\"esnext.iterator.windows\", ...IteratorDependencies]),\n with: define(\"instance/with\", [\"es.array.with\"]),\n __defineGetter__: define(null, [\"es.object.define-getter\"]),\n __defineSetter__: define(null, [\"es.object.define-setter\"]),\n __lookupGetter__: define(null, [\"es.object.lookup-getter\"]),\n __lookupSetter__: define(null, [\"es.object.lookup-setter\"]),\n [\"__proto__\"]: define(null, [\"es.object.proto\"]),\n};\n","// This file contains the list of paths supported by @babel/runtime-corejs3.\n// It must _not_ be edited, as all new features should go through direct\n// injection of core-js-pure imports.\n\nexport const stable = new Set([\n \"array\",\n \"array/from\",\n \"array/is-array\",\n \"array/of\",\n \"clear-immediate\",\n \"date/now\",\n \"instance/bind\",\n \"instance/code-point-at\",\n \"instance/concat\",\n \"instance/copy-within\",\n \"instance/ends-with\",\n \"instance/entries\",\n \"instance/every\",\n \"instance/fill\",\n \"instance/filter\",\n \"instance/find\",\n \"instance/find-index\",\n \"instance/flags\",\n \"instance/flat\",\n \"instance/flat-map\",\n \"instance/for-each\",\n \"instance/includes\",\n \"instance/index-of\",\n \"instance/keys\",\n \"instance/last-index-of\",\n \"instance/map\",\n \"instance/pad-end\",\n \"instance/pad-start\",\n \"instance/reduce\",\n \"instance/reduce-right\",\n \"instance/repeat\",\n \"instance/reverse\",\n \"instance/slice\",\n \"instance/some\",\n \"instance/sort\",\n \"instance/splice\",\n \"instance/starts-with\",\n \"instance/trim\",\n \"instance/trim-end\",\n \"instance/trim-left\",\n \"instance/trim-right\",\n \"instance/trim-start\",\n \"instance/values\",\n \"json/stringify\",\n \"map\",\n \"math/acosh\",\n \"math/asinh\",\n \"math/atanh\",\n \"math/cbrt\",\n \"math/clz32\",\n \"math/cosh\",\n \"math/expm1\",\n \"math/fround\",\n \"math/hypot\",\n \"math/imul\",\n \"math/log10\",\n \"math/log1p\",\n \"math/log2\",\n \"math/sign\",\n \"math/sinh\",\n \"math/tanh\",\n \"math/trunc\",\n \"number/epsilon\",\n \"number/is-finite\",\n \"number/is-integer\",\n \"number/is-nan\",\n \"number/is-safe-integer\",\n \"number/max-safe-integer\",\n \"number/min-safe-integer\",\n \"number/parse-float\",\n \"number/parse-int\",\n \"object/assign\",\n \"object/create\",\n \"object/define-properties\",\n \"object/define-property\",\n \"object/entries\",\n \"object/freeze\",\n \"object/from-entries\",\n \"object/get-own-property-descriptor\",\n \"object/get-own-property-descriptors\",\n \"object/get-own-property-names\",\n \"object/get-own-property-symbols\",\n \"object/get-prototype-of\",\n \"object/is\",\n \"object/is-extensible\",\n \"object/is-frozen\",\n \"object/is-sealed\",\n \"object/keys\",\n \"object/prevent-extensions\",\n \"object/seal\",\n \"object/set-prototype-of\",\n \"object/values\",\n \"parse-float\",\n \"parse-int\",\n \"promise\",\n \"queue-microtask\",\n \"reflect/apply\",\n \"reflect/construct\",\n \"reflect/define-property\",\n \"reflect/delete-property\",\n \"reflect/get\",\n \"reflect/get-own-property-descriptor\",\n \"reflect/get-prototype-of\",\n \"reflect/has\",\n \"reflect/is-extensible\",\n \"reflect/own-keys\",\n \"reflect/prevent-extensions\",\n \"reflect/set\",\n \"reflect/set-prototype-of\",\n \"set\",\n \"set-immediate\",\n \"set-interval\",\n \"set-timeout\",\n \"string/from-code-point\",\n \"string/raw\",\n \"symbol\",\n \"symbol/async-iterator\",\n \"symbol/for\",\n \"symbol/has-instance\",\n \"symbol/is-concat-spreadable\",\n \"symbol/iterator\",\n \"symbol/key-for\",\n \"symbol/match\",\n \"symbol/replace\",\n \"symbol/search\",\n \"symbol/species\",\n \"symbol/split\",\n \"symbol/to-primitive\",\n \"symbol/to-string-tag\",\n \"symbol/unscopables\",\n \"url\",\n \"url-search-params\",\n \"weak-map\",\n \"weak-set\",\n]);\n\nexport const proposals = new Set([\n ...stable,\n \"aggregate-error\",\n \"composite-key\",\n \"composite-symbol\",\n \"global-this\",\n \"instance/at\",\n \"instance/code-points\",\n \"instance/match-all\",\n \"instance/replace-all\",\n \"math/clamp\",\n \"math/degrees\",\n \"math/deg-per-rad\",\n \"math/fscale\",\n \"math/iaddh\",\n \"math/imulh\",\n \"math/isubh\",\n \"math/rad-per-deg\",\n \"math/radians\",\n \"math/scale\",\n \"math/seeded-prng\",\n \"math/signbit\",\n \"math/umulh\",\n \"number/from-string\",\n \"observable\",\n \"reflect/define-metadata\",\n \"reflect/delete-metadata\",\n \"reflect/get-metadata\",\n \"reflect/get-metadata-keys\",\n \"reflect/get-own-metadata\",\n \"reflect/get-own-metadata-keys\",\n \"reflect/has-metadata\",\n \"reflect/has-own-metadata\",\n \"reflect/metadata\",\n \"symbol/dispose\",\n \"symbol/observable\",\n \"symbol/pattern-match\",\n]);\n","import type { CoreJSPolyfillDescriptor } from \"./built-in-definitions\";\nimport { types as t, type NodePath } from \"@babel/core\";\n\nexport default function canSkipPolyfill(\n desc: CoreJSPolyfillDescriptor,\n path: NodePath,\n) {\n const { node, parent } = path;\n switch (desc.name) {\n case \"es.string.split\": {\n if (!t.isCallExpression(parent, { callee: node })) return false;\n if (parent.arguments.length < 1) return true;\n const splitter = parent.arguments[0];\n return t.isStringLiteral(splitter) || t.isTemplateLiteral(splitter);\n }\n }\n}\n","import { types as t, type NodePath } from \"@babel/core\";\nimport corejsEntries from \"../core-js-compat/entries.js\";\n\nexport const BABEL_RUNTIME = \"@babel/runtime-corejs3\";\n\nexport function callMethod(\n path: any,\n id: t.Identifier,\n optionalCall?: boolean,\n wrapCallee?: (callee: t.Expression) => t.Expression,\n) {\n const [context1, context2] = maybeMemoizeContext(path.node, path.scope);\n\n let callee: t.Expression = t.callExpression(id, [context1]);\n if (wrapCallee) callee = wrapCallee(callee);\n\n const call = t.identifier(\"call\");\n\n path.replaceWith(\n optionalCall\n ? t.optionalMemberExpression(callee, call, false, true)\n : t.memberExpression(callee, call),\n );\n\n path.parentPath.unshiftContainer(\"arguments\", context2);\n}\n\nexport function maybeMemoizeContext(\n node: t.MemberExpression | t.OptionalMemberExpression,\n scope: NodePath[\"scope\"],\n) {\n const { object } = node;\n\n let context1, context2;\n if (t.isIdentifier(object)) {\n context2 = object;\n context1 = t.cloneNode(object);\n } else {\n context2 = scope.generateDeclaredUidIdentifier(\"context\");\n context1 = t.assignmentExpression(\"=\", t.cloneNode(context2), object);\n }\n\n return [context1, context2];\n}\n\nexport function extractOptionalCheck(\n scope: NodePath[\"scope\"],\n node: t.OptionalMemberExpression,\n) {\n let optionalNode = node;\n while (\n !optionalNode.optional &&\n t.isOptionalMemberExpression(optionalNode.object)\n ) {\n optionalNode = optionalNode.object;\n }\n optionalNode.optional = false;\n\n const ctx = scope.generateDeclaredUidIdentifier(\"context\");\n const assign = t.assignmentExpression(\"=\", ctx, optionalNode.object);\n optionalNode.object = t.cloneNode(ctx);\n\n return ifNotNullish =>\n t.conditionalExpression(\n t.binaryExpression(\"==\", assign, t.nullLiteral()),\n t.unaryExpression(\"void\", t.numericLiteral(0)),\n ifNotNullish,\n );\n}\n\nexport function isCoreJSSource(source: string) {\n if (typeof source === \"string\") {\n source = source\n .replace(/\\\\/g, \"/\")\n .replace(/(\\/(index)?)?(\\.js)?$/i, \"\")\n .toLowerCase();\n }\n\n return (\n Object.prototype.hasOwnProperty.call(corejsEntries, source) &&\n corejsEntries[source]\n );\n}\n\nexport function coreJSModule(name: string) {\n return `core-js/modules/${name}.js`;\n}\n\nexport function coreJSPureHelper(\n name: string,\n useBabelRuntime: boolean,\n ext: string,\n) {\n return useBabelRuntime\n ? `${BABEL_RUNTIME}/core-js/${name}${ext}`\n : `core-js-pure/features/${name}.js`;\n}\n","import corejs3Polyfills from \"../core-js-compat/data.js\";\nimport corejs3ShippedProposalsList from \"./shipped-proposals\";\nimport getModulesListForTargetVersion from \"../core-js-compat/get-modules-list-for-target-version.js\";\nimport {\n BuiltIns,\n CommonIterators,\n PromiseDependencies,\n PromiseDependenciesWithIterators,\n StaticProperties,\n InstanceProperties,\n DecoratorMetadataDependencies,\n type CoreJSPolyfillDescriptor,\n} from \"./built-in-definitions\";\nimport * as BabelRuntimePaths from \"./babel-runtime-corejs3-paths\";\nimport canSkipPolyfill from \"./usage-filters\";\n\nimport type { NodePath } from \"@babel/traverse\";\nimport { types as t, template } from \"@babel/core\";\nimport {\n callMethod,\n coreJSModule,\n isCoreJSSource,\n coreJSPureHelper,\n BABEL_RUNTIME,\n extractOptionalCheck,\n maybeMemoizeContext,\n} from \"./utils\";\n\nimport defineProvider from \"@babel/helper-define-polyfill-provider\";\n\nconst presetEnvCompat = \"#__secret_key__@babel/preset-env__compatibility\";\nconst runtimeCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\ntype Options = {\n version?: number | string;\n proposals?: boolean;\n shippedProposals?: boolean;\n [presetEnvCompat]?: { noRuntimeName: boolean };\n [runtimeCompat]: {\n useBabelRuntime: boolean;\n ext: string;\n };\n};\n\nconst uniqueObjects = [\n \"array\",\n \"string\",\n\n \"iterator\",\n \"async-iterator\",\n \"dom-collections\",\n].map(v => new RegExp(`[a-z]*\\\\.${v}\\\\..*`));\n\nconst esnextFallback = (\n name: string,\n cb: (name: string) => boolean,\n): boolean => {\n if (cb(name)) return true;\n if (!name.startsWith(\"es.\")) return false;\n const fallback = `esnext.${name.slice(3)}`;\n if (!corejs3Polyfills[fallback]) return false;\n return cb(fallback);\n};\n\nexport default defineProvider(function (\n { getUtils, method, shouldInjectPolyfill, createMetaResolver, debug, babel },\n {\n version = 3,\n proposals,\n shippedProposals,\n [presetEnvCompat]: { noRuntimeName = false } = {},\n [runtimeCompat]: { useBabelRuntime = false, ext = \".js\" } = {},\n },\n) {\n const isWebpack = babel.caller(caller => caller?.name === \"babel-loader\");\n\n const resolve = createMetaResolver({\n global: BuiltIns,\n static: StaticProperties,\n instance: InstanceProperties,\n });\n\n const available = new Set(getModulesListForTargetVersion(version));\n\n function getCoreJSPureBase(useProposalBase) {\n return useBabelRuntime\n ? useProposalBase\n ? `${BABEL_RUNTIME}/core-js`\n : `${BABEL_RUNTIME}/core-js-stable`\n : useProposalBase\n ? \"core-js-pure/features\"\n : \"core-js-pure/stable\";\n }\n\n function maybeInjectGlobalImpl(name: string, utils) {\n if (shouldInjectPolyfill(name)) {\n debug(name);\n utils.injectGlobalImport(coreJSModule(name), name);\n return true;\n }\n return false;\n }\n\n function maybeInjectGlobal(names: string[], utils, fallback = true) {\n for (const name of names) {\n if (fallback) {\n esnextFallback(name, name => maybeInjectGlobalImpl(name, utils));\n } else {\n maybeInjectGlobalImpl(name, utils);\n }\n }\n }\n\n function maybeInjectPure(\n desc: CoreJSPolyfillDescriptor,\n hint: string,\n utils: ReturnType,\n object?: string,\n ) {\n if (\n desc.pure &&\n !(object && desc.exclude && desc.exclude.includes(object)) &&\n esnextFallback(desc.name, shouldInjectPolyfill)\n ) {\n const { name } = desc;\n let useProposalBase = false;\n if (proposals || (shippedProposals && name.startsWith(\"esnext.\"))) {\n useProposalBase = true;\n } else if (name.startsWith(\"es.\") && !available.has(name)) {\n useProposalBase = true;\n }\n if (\n useBabelRuntime &&\n !(\n useProposalBase\n ? BabelRuntimePaths.proposals\n : BabelRuntimePaths.stable\n ).has(desc.pure)\n ) {\n return;\n }\n const coreJSPureBase = getCoreJSPureBase(useProposalBase);\n return utils.injectDefaultImport(\n `${coreJSPureBase}/${desc.pure}${ext}`,\n hint,\n );\n }\n }\n\n function isFeatureStable(name) {\n if (name.startsWith(\"esnext.\")) {\n const esName = `es.${name.slice(7)}`;\n // If its imaginative esName is not in latest compat data, it means\n // the proposal is not stage 4\n return esName in corejs3Polyfills;\n }\n return true;\n }\n\n return {\n name: \"corejs3\",\n\n runtimeName: noRuntimeName ? null : BABEL_RUNTIME,\n\n polyfills: corejs3Polyfills,\n\n filterPolyfills(name) {\n if (!available.has(name)) return false;\n if (proposals || method === \"entry-global\") return true;\n if (shippedProposals && corejs3ShippedProposalsList.has(name)) {\n return true;\n }\n return isFeatureStable(name);\n },\n\n entryGlobal(meta, utils, path) {\n if (meta.kind !== \"import\") return;\n\n const modules = isCoreJSSource(meta.source);\n if (!modules) return;\n\n if (\n modules.length === 1 &&\n meta.source === coreJSModule(modules[0]) &&\n shouldInjectPolyfill(modules[0])\n ) {\n // Avoid infinite loop: do not replace imports with a new copy of\n // themselves.\n debug(null);\n return;\n }\n\n const modulesSet = new Set(modules);\n const filteredModules = modules.filter(module => {\n if (!module.startsWith(\"esnext.\")) return true;\n const stable = module.replace(\"esnext.\", \"es.\");\n if (modulesSet.has(stable) && shouldInjectPolyfill(stable)) {\n return false;\n }\n return true;\n });\n\n maybeInjectGlobal(filteredModules, utils, false);\n path.remove();\n },\n\n usageGlobal(meta, utils, path) {\n const resolved = resolve(meta);\n if (!resolved) return;\n\n if (canSkipPolyfill(resolved.desc, path)) return;\n\n let deps = resolved.desc.global;\n\n if (\n resolved.kind !== \"global\" &&\n \"object\" in meta &&\n meta.object &&\n meta.placement === \"prototype\"\n ) {\n const low = meta.object.toLowerCase();\n deps = deps.filter(m =>\n uniqueObjects.some(v => v.test(m)) ? m.includes(low) : true,\n );\n }\n\n maybeInjectGlobal(deps, utils);\n\n return true;\n },\n\n usagePure(meta, utils, path) {\n if (meta.kind === \"in\") {\n if (meta.key === \"Symbol.iterator\") {\n path.replaceWith(\n t.callExpression(\n utils.injectDefaultImport(\n coreJSPureHelper(\"is-iterable\", useBabelRuntime, ext),\n \"isIterable\",\n ),\n [(path.node as t.BinaryExpression).right], // meta.kind === \"in\" narrows this\n ),\n );\n }\n return;\n }\n\n if (path.parentPath.isUnaryExpression({ operator: \"delete\" })) return;\n\n if (meta.kind === \"property\") {\n // We can't compile destructuring and updateExpression.\n if (!path.isMemberExpression() && !path.isOptionalMemberExpression()) {\n return;\n }\n if (!path.isReferenced()) return;\n if (path.parentPath.isUpdateExpression()) return;\n if (t.isSuper(path.node.object)) {\n return;\n }\n\n if (meta.key === \"Symbol.iterator\") {\n if (!shouldInjectPolyfill(\"es.symbol.iterator\")) return;\n\n const { parent, node } = path;\n if (t.isCallExpression(parent, { callee: node })) {\n if (parent.arguments.length === 0) {\n path.parentPath.replaceWith(\n t.callExpression(\n utils.injectDefaultImport(\n coreJSPureHelper(\"get-iterator\", useBabelRuntime, ext),\n \"getIterator\",\n ),\n [node.object],\n ),\n );\n path.skip();\n } else {\n callMethod(\n path,\n utils.injectDefaultImport(\n coreJSPureHelper(\"get-iterator-method\", useBabelRuntime, ext),\n \"getIteratorMethod\",\n ),\n );\n }\n } else {\n path.replaceWith(\n t.callExpression(\n utils.injectDefaultImport(\n coreJSPureHelper(\"get-iterator-method\", useBabelRuntime, ext),\n \"getIteratorMethod\",\n ),\n [path.node.object],\n ),\n );\n }\n\n return;\n }\n }\n\n let resolved = resolve(meta);\n if (!resolved) return;\n\n if (canSkipPolyfill(resolved.desc, path)) return;\n\n if (\n useBabelRuntime &&\n resolved.desc.pure &&\n resolved.desc.pure.slice(-6) === \"/index\"\n ) {\n // Remove /index, since it doesn't exist in @babel/runtime-corejs3s\n resolved = {\n ...resolved,\n desc: {\n ...resolved.desc,\n pure: resolved.desc.pure.slice(0, -6),\n },\n };\n }\n\n if (resolved.kind === \"global\") {\n const id = maybeInjectPure(resolved.desc, resolved.name, utils);\n if (id) path.replaceWith(id);\n } else if (resolved.kind === \"static\") {\n const id = maybeInjectPure(\n resolved.desc,\n resolved.name,\n utils,\n // @ts-expect-error\n meta.object,\n );\n if (id) {\n path.replaceWith(id);\n let { parentPath } = path;\n if (\n parentPath.isOptionalMemberExpression() ||\n parentPath.isOptionalCallExpression()\n ) {\n do {\n const parentAsNotOptional = parentPath as NodePath as NodePath<\n t.MemberExpression | t.CallExpression\n >;\n parentAsNotOptional.type = parentAsNotOptional.node.type =\n parentPath.type === \"OptionalMemberExpression\"\n ? \"MemberExpression\"\n : \"CallExpression\";\n delete parentAsNotOptional.node.optional;\n\n ({ parentPath } = parentPath);\n } while (\n (parentPath.isOptionalMemberExpression() ||\n parentPath.isOptionalCallExpression()) &&\n !parentPath.node.optional\n );\n }\n }\n } else if (resolved.kind === \"instance\") {\n const id = maybeInjectPure(\n resolved.desc,\n `${resolved.name}InstanceProperty`,\n utils,\n // @ts-expect-error\n meta.object,\n );\n if (!id) return;\n\n const { node, parent } = path as NodePath<\n t.MemberExpression | t.OptionalMemberExpression\n >;\n\n if (t.isOptionalCallExpression(parent) && parent.callee === node) {\n const wasOptional = parent.optional;\n parent.optional = !wasOptional;\n\n if (!wasOptional) {\n const check = extractOptionalCheck(\n path.scope,\n node as t.OptionalMemberExpression,\n );\n const [thisArg, thisArg2] = maybeMemoizeContext(node, path.scope);\n\n path.replaceWith(\n check(\n template.expression.ast`\n Function.call.bind(${id}(${thisArg}), ${thisArg2})\n `,\n ),\n );\n } else if (t.isOptionalMemberExpression(node)) {\n const check = extractOptionalCheck(path.scope, node);\n callMethod(path, id, true, check);\n } else {\n callMethod(path, id, true);\n }\n } else if (t.isCallExpression(parent) && parent.callee === node) {\n callMethod(path, id, false);\n } else if (t.isOptionalMemberExpression(node)) {\n const check = extractOptionalCheck(path.scope, node);\n path.replaceWith(check(t.callExpression(id, [node.object])));\n if (t.isOptionalMemberExpression(parent)) parent.optional = true;\n } else {\n path.replaceWith(t.callExpression(id, [node.object]));\n }\n }\n },\n\n visitor: method === \"usage-global\" && {\n // import(\"foo\")\n CallExpression(path: NodePath) {\n if (path.get(\"callee\").isImport()) {\n const utils = getUtils(path);\n\n if (isWebpack) {\n // Webpack uses Promise.all to handle dynamic import.\n maybeInjectGlobal(PromiseDependenciesWithIterators, utils);\n } else {\n maybeInjectGlobal(PromiseDependencies, utils);\n }\n }\n },\n\n // (async function () { }).finally(...)\n Function(path: NodePath) {\n if (path.node.async) {\n maybeInjectGlobal(PromiseDependencies, getUtils(path));\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"(\n path: NodePath,\n ) {\n maybeInjectGlobal(CommonIterators, getUtils(path));\n },\n\n // [...spread]\n SpreadElement(path: NodePath) {\n if (!path.parentPath.isObjectExpression()) {\n maybeInjectGlobal(CommonIterators, getUtils(path));\n }\n },\n\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n maybeInjectGlobal(CommonIterators, getUtils(path));\n }\n },\n\n // Decorators metadata\n Class(path: NodePath) {\n const hasDecorators =\n path.node.decorators?.length ||\n path.node.body.body.some(\n el => (el as t.ClassMethod).decorators?.length,\n );\n if (hasDecorators) {\n maybeInjectGlobal(DecoratorMetadataDependencies, getUtils(path));\n }\n },\n },\n };\n});\n"],"names":["Set","polyfillsOrder","Object","keys","corejs3Polyfills","forEach","name","index","define","pure","global","exclude","sort","a","b","typed","modules","TypedArrayDependencies","ArrayNatureIterators","CommonIterators","ArrayNatureIteratorsWithTag","CommonIteratorsWithTag","ErrorDependencies","SuppressedErrorDependencies","ArrayBufferDependencies","PromiseDependencies","PromiseDependenciesWithIterators","SymbolDependencies","MapDependencies","SetDependencies","WeakMapDependencies","WeakSetDependencies","DOMExceptionDependencies","URLSearchParamsDependencies","AsyncIteratorDependencies","AsyncIteratorProblemMethods","IteratorDependencies","DecoratorMetadataDependencies","TypedArrayStaticMethods","base","from","fromAsync","of","DataViewDependencies","BuiltIns","AsyncDisposableStack","AsyncIterator","AggregateError","ArrayBuffer","DataView","Date","DOMException","DisposableStack","Error","EvalError","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Iterator","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Map","Number","Observable","Promise","RangeError","ReferenceError","Reflect","RegExp","SuppressedError","Symbol","SyntaxError","TypeError","URIError","URL","URLSearchParams","WeakMap","WeakSet","atob","btoa","clearImmediate","compositeKey","compositeSymbol","escape","fetch","globalThis","parseFloat","parseInt","queueMicrotask","self","setImmediate","setInterval","setTimeout","structuredClone","unescape","StaticProperties","Array","isArray","isTemplateObject","isView","BigInt","range","now","isError","Function","isCallable","isConstructor","concat","zip","zipKeyed","JSON","isRawJSON","parse","rawJSON","stringify","Math","DEG_PER_RAD","RAD_PER_DEG","acosh","asinh","atanh","cbrt","clamp","clz32","cosh","degrees","expm1","fround","f16round","fscale","hypot","iaddh","imul","imulh","isubh","log10","log1p","log2","radians","scale","seededPRNG","sign","signbit","sinh","sumPrecise","tanh","trunc","umulh","groupBy","keyBy","EPSILON","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","fromString","isFinite","isInteger","isNaN","isSafeInteger","assign","create","defineProperties","defineProperty","entries","freeze","fromEntries","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","hasOwn","is","isExtensible","isFrozen","isSealed","preventExtensions","seal","setPrototypeOf","values","all","allSettled","any","race","try","withResolvers","apply","construct","defineMetadata","deleteMetadata","deleteProperty","get","getMetadata","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","has","hasMetadata","hasOwnMetadata","metadata","ownKeys","set","String","cooked","dedent","fromCodePoint","raw","asyncDispose","asyncIterator","customMatcher","dispose","for","hasInstance","isConcatSpreadable","isRegistered","isRegisteredSymbol","isWellKnown","isWellKnownSymbol","iterator","keyFor","match","matcher","matchAll","metadataKey","observable","patternMatch","replace","search","species","split","toPrimitive","toStringTag","unscopables","canParse","fromBase64","fromHex","WebAssembly","CompileError","LinkError","RuntimeError","ERROR_SUBCLASS","InstanceProperties","asIndexedPairs","at","anchor","big","bind","blink","bold","chunks","codePointAt","codePoints","undefined","copyWithin","demethodize","description","dotAll","drop","endsWith","every","exec","fill","filter","filterReject","finally","find","findIndex","findLast","findLastIndex","fixed","flags","flatMap","flat","getFloat16","getUint8Clamped","getYear","group","groupByToMap","groupToMap","fontcolor","fontsize","includes","indexed","indexOf","isWellFormed","italics","join","lastIndex","lastIndexOf","lastItem","link","map","padEnd","padStart","push","reduce","reduceRight","repeat","replaceAll","reverse","setFloat16","setUint8Clamped","setYear","slice","sliding","small","some","splice","startsWith","sticky","strike","sub","substr","sup","take","test","toArray","toAsync","toExponential","toFixed","toGMTString","toISOString","toJSON","toPrecision","toReversed","toSorted","toSpliced","toString","toWellFormed","trim","trimEnd","trimLeft","trimRight","trimStart","uniqueBy","unshift","unThis","windows","with","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","stable","proposals","types","t","_babel","default","canSkipPolyfill","desc","path","node","parent","isCallExpression","callee","arguments","length","splitter","isStringLiteral","isTemplateLiteral","BABEL_RUNTIME","callMethod","id","optionalCall","wrapCallee","context1","context2","maybeMemoizeContext","scope","callExpression","call","identifier","replaceWith","optionalMemberExpression","memberExpression","parentPath","unshiftContainer","object","isIdentifier","cloneNode","generateDeclaredUidIdentifier","assignmentExpression","extractOptionalCheck","optionalNode","optional","isOptionalMemberExpression","ctx","ifNotNullish","conditionalExpression","binaryExpression","nullLiteral","unaryExpression","numericLiteral","isCoreJSSource","source","toLowerCase","prototype","hasOwnProperty","corejsEntries","coreJSModule","coreJSPureHelper","useBabelRuntime","ext","template","presetEnvCompat","runtimeCompat","uniqueObjects","v","esnextFallback","cb","fallback","defineProvider","getUtils","method","shouldInjectPolyfill","createMetaResolver","debug","babel","version","shippedProposals","noRuntimeName","isWebpack","caller","resolve","static","instance","available","getModulesListForTargetVersion","getCoreJSPureBase","useProposalBase","maybeInjectGlobalImpl","utils","injectGlobalImport","maybeInjectGlobal","names","maybeInjectPure","hint","BabelRuntimePaths","coreJSPureBase","injectDefaultImport","isFeatureStable","esName","runtimeName","polyfills","filterPolyfills","corejs3ShippedProposalsList","entryGlobal","meta","kind","modulesSet","filteredModules","module","remove","usageGlobal","resolved","deps","placement","low","m","usagePure","key","right","isUnaryExpression","operator","isMemberExpression","isReferenced","isUpdateExpression","isSuper","skip","isOptionalCallExpression","parentAsNotOptional","type","wasOptional","check","thisArg","thisArg2","expression","ast","visitor","CallExpression","isImport","async","ForOfStatement|ArrayPattern","SpreadElement","isObjectExpression","YieldExpression","delegate","Class","_path$node$decorators","hasDecorators","decorators","body","el","_decorators"],"mappings":";;;;;;AAAA;;AAEA,kCAAe,IAAIA,GAAG,CAAS,CAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,CACzB,CAAC;;ACIF,MAAMC,cAAc,GAAG,EAAE,CAAA;AACzBC,MAAM,CAACC,IAAI,CAACC,gBAAgB,CAAC,CAACC,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;AACrDN,EAAAA,cAAc,CAACK,IAAI,CAAC,GAAGC,KAAK,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,MAAMC,MAAM,GAAGA,CACbC,IAAI,EACJC,MAAM,EACNJ,IAAI,GAAGI,MAAM,CAAC,CAAC,CAAC,EAChBC,OAAQ,KACqB;EAC7B,OAAO;IACLL,IAAI;IACJG,IAAI;AACJC,IAAAA,MAAM,EAAEA,MAAM,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKb,cAAc,CAACY,CAAC,CAAC,GAAGZ,cAAc,CAACa,CAAC,CAAC,CAAC;AACpEH,IAAAA,OAAAA;GACD,CAAA;AACH,CAAC,CAAA;AAED,MAAMI,KAAK,GAAGA,CAAC,GAAGC,OAAO,KACvBR,MAAM,CAAC,IAAI,EAAE,CAAC,GAAGQ,OAAO,EAAE,GAAGC,sBAAsB,CAAC,CAAC,CAAA;AAEvD,MAAMC,oBAAoB,GAAG,CAC3B,mBAAmB,EACnB,8BAA8B,CAC/B,CAAA;AAEM,MAAMC,eAAe,GAAG,CAAC,oBAAoB,EAAE,GAAGD,oBAAoB,CAAC,CAAA;AAE9E,MAAME,2BAA2B,GAAG,CAClC,qBAAqB,EACrB,GAAGF,oBAAoB,CACxB,CAAA;AAED,MAAMG,sBAAsB,GAAG,CAAC,qBAAqB,EAAE,GAAGF,eAAe,CAAC,CAAA;AAE1E,MAAMG,iBAAiB,GAAG,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;AAElE,MAAMC,2BAA2B,GAAG,CAClC,iCAAiC,EACjC,GAAGD,iBAAiB,CACrB,CAAA;AAED,MAAME,uBAAuB,GAAG,CAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,cAAc,EACd,0BAA0B,EAC1B,0BAA0B,EAC1B,0CAA0C,EAC1C,qBAAqB,CACtB,CAAA;AAED,MAAMP,sBAAsB,GAAG,CAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,iCAAiC,EACjC,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,kCAAkC,EAClC,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,GAAGO,uBAAuB,CAC3B,CAAA;AAEM,MAAMC,mBAAmB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAA;AAEjE,MAAMC,gCAAgC,GAAG,CAC9C,GAAGD,mBAAmB,EACtB,GAAGN,eAAe,CACnB,CAAA;AAED,MAAMQ,kBAAkB,GAAG,CACzB,WAAW,EACX,uBAAuB,EACvB,qBAAqB,CACtB,CAAA;AAED,MAAMC,eAAe,GAAG,CACtB,QAAQ,EACR,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,GAAGP,sBAAsB,CAC1B,CAAA;AAED,MAAMQ,eAAe,GAAG,CACtB,QAAQ,EACR,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iCAAiC,EACjC,kBAAkB,EAClB,GAAGR,sBAAsB,CAC1B,CAAA;AAED,MAAMS,mBAAmB,GAAG,CAC1B,aAAa,EACb,2BAA2B,EAC3B,oCAAoC,EACpC,4BAA4B,EAC5B,yBAAyB,EACzB,GAAGT,sBAAsB,CAC1B,CAAA;AAED,MAAMU,mBAAmB,GAAG,CAC1B,aAAa,EACb,yBAAyB,EACzB,4BAA4B,EAC5B,GAAGV,sBAAsB,CAC1B,CAAA;AAED,MAAMW,wBAAwB,GAAG,CAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,iCAAiC,EACjC,oBAAoB,CACrB,CAAA;AAED,MAAMC,2BAA2B,GAAG,CAClC,uBAAuB,EACvB,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,GAAGZ,sBAAsB,CAC1B,CAAA;AAED,MAAMa,yBAAyB,GAAG,CAChC,mCAAmC,EACnC,GAAGT,mBAAmB,CACvB,CAAA;AAED,MAAMU,2BAA2B,GAAG,CAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,CAC7B,CAAA;AAED,MAAMC,oBAAoB,GAAG,CAAC,yBAAyB,EAAE,qBAAqB,CAAC,CAAA;AAExE,MAAMC,6BAA6B,GAAG,CAC3C,wBAAwB,EACxB,0BAA0B,CAC3B,CAAA;AAED,MAAMC,uBAAuB,GAAIC,IAAY,KAAM;AACjDC,EAAAA,IAAI,EAAEhC,MAAM,CAAC,IAAI,EAAE,CAAC,qBAAqB,EAAE+B,IAAI,EAAE,GAAGtB,sBAAsB,CAAC,CAAC;AAC5EwB,EAAAA,SAAS,EAAEjC,MAAM,CAAC,IAAI,EAAE,CACtB,+BAA+B,EAC/B+B,IAAI,EACJ,GAAGb,gCAAgC,EACnC,GAAGT,sBAAsB,CAC1B,CAAC;AACFyB,EAAAA,EAAE,EAAElC,MAAM,CAAC,IAAI,EAAE,CAAC,mBAAmB,EAAE+B,IAAI,EAAE,GAAGtB,sBAAsB,CAAC,CAAA;AACzE,CAAC,CAAC,CAAA;AAEF,MAAM0B,oBAAoB,GAAG,CAAC,cAAc,EAAE,GAAGnB,uBAAuB,CAAC,CAAA;AAElE,MAAMoB,QAA6C,GAAG;EAC3DC,oBAAoB,EAAErC,MAAM,CAAC,8BAA8B,EAAE,CAC3D,uCAAuC,EACvC,qBAAqB,EACrB,iCAAiC,EACjC,qBAAqB,EACrB,GAAGiB,mBAAmB,EACtB,GAAGF,2BAA2B,CAC/B,CAAC;AACFuB,EAAAA,aAAa,EAAEtC,MAAM,CAAC,sBAAsB,EAAE0B,yBAAyB,CAAC;AACxEa,EAAAA,cAAc,EAAEvC,MAAM,CAAC,iBAAiB,EAAE,CACxC,oBAAoB,EACpB,GAAGc,iBAAiB,EACpB,GAAGD,sBAAsB,EACzB,0BAA0B,CAC3B,CAAC;AACF2B,EAAAA,WAAW,EAAExC,MAAM,CAAC,IAAI,EAAEgB,uBAAuB,CAAC;AAClDyB,EAAAA,QAAQ,EAAEzC,MAAM,CAAC,IAAI,EAAEmC,oBAAoB,CAAC;EAC5CO,IAAI,EAAE1C,MAAM,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC;AACzC2C,EAAAA,YAAY,EAAE3C,MAAM,CAAC,qBAAqB,EAAEwB,wBAAwB,CAAC;AACrEoB,EAAAA,eAAe,EAAE5C,MAAM,CAAC,wBAAwB,EAAE,CAChD,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACrB,GAAGe,2BAA2B,CAC/B,CAAC;AACF8B,EAAAA,KAAK,EAAE7C,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AACtCgC,EAAAA,SAAS,EAAE9C,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC1CiC,EAAAA,YAAY,EAAExC,KAAK,CAAC,8BAA8B,CAAC;AACnDyC,EAAAA,YAAY,EAAEzC,KAAK,CAAC,8BAA8B,CAAC;AACnD0C,EAAAA,SAAS,EAAE1C,KAAK,CAAC,2BAA2B,CAAC;AAC7C2C,EAAAA,UAAU,EAAE3C,KAAK,CAAC,4BAA4B,CAAC;AAC/C4C,EAAAA,UAAU,EAAE5C,KAAK,CAAC,4BAA4B,CAAC;AAC/C6C,EAAAA,QAAQ,EAAEpD,MAAM,CAAC,gBAAgB,EAAE4B,oBAAoB,CAAC;AACxDyB,EAAAA,UAAU,EAAE9C,KAAK,CACf,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,EAC7B,0BAA0B,EAC1B,uBACF,CAAC;AACD+C,EAAAA,iBAAiB,EAAE/C,KAAK,CAAC,oCAAoC,CAAC;AAC9DgD,EAAAA,WAAW,EAAEhD,KAAK,CAAC,6BAA6B,CAAC;AACjDiD,EAAAA,WAAW,EAAEjD,KAAK,CAAC,6BAA6B,CAAC;AACjDkD,EAAAA,GAAG,EAAEzD,MAAM,CAAC,WAAW,EAAEoB,eAAe,CAAC;EACzCsC,MAAM,EAAE1D,MAAM,CAAC,IAAI,EAAE,CAAC,uBAAuB,CAAC,CAAC;AAC/C2D,EAAAA,UAAU,EAAE3D,MAAM,CAAC,kBAAkB,EAAE,CACrC,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,GAAGa,sBAAsB,CAC1B,CAAC;AACF+C,EAAAA,OAAO,EAAE5D,MAAM,CAAC,eAAe,EAAEiB,mBAAmB,CAAC;AACrD4C,EAAAA,UAAU,EAAE7D,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC3CgD,EAAAA,cAAc,EAAE9D,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;EAC/CiD,OAAO,EAAE/D,MAAM,CAAC,IAAI,EAAE,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CAAC;AAC1EgE,EAAAA,MAAM,EAAEhE,MAAM,CAAC,IAAI,EAAE,CACnB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,CACtB,CAAC;AACFR,EAAAA,GAAG,EAAEQ,MAAM,CAAC,WAAW,EAAEqB,eAAe,CAAC;AACzC4C,EAAAA,eAAe,EAAEjE,MAAM,CAAC,kBAAkB,EAAEe,2BAA2B,CAAC;AACxEmD,EAAAA,MAAM,EAAElE,MAAM,CAAC,cAAc,EAAEmB,kBAAkB,CAAC;AAClDgD,EAAAA,WAAW,EAAEnE,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC5CsD,EAAAA,SAAS,EAAEpE,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC1CuD,EAAAA,QAAQ,EAAErE,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AACzCwD,EAAAA,GAAG,EAAEtE,MAAM,CAAC,WAAW,EAAE,CACvB,SAAS,EACT,iBAAiB,EACjB,GAAGyB,2BAA2B,CAC/B,CAAC;AACF8C,EAAAA,eAAe,EAAEvE,MAAM,CACrB,yBAAyB,EACzByB,2BACF,CAAC;AACD+C,EAAAA,OAAO,EAAExE,MAAM,CAAC,gBAAgB,EAAEsB,mBAAmB,CAAC;AACtDmD,EAAAA,OAAO,EAAEzE,MAAM,CAAC,gBAAgB,EAAEuB,mBAAmB,CAAC;EAEtDmD,IAAI,EAAE1E,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,GAAGwB,wBAAwB,CAAC,CAAC;EAC/DmD,IAAI,EAAE3E,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,GAAGwB,wBAAwB,CAAC,CAAC;EAC/DoD,cAAc,EAAE5E,MAAM,CAAC,iBAAiB,EAAE,CAAC,eAAe,CAAC,CAAC;EAC5D6E,YAAY,EAAE7E,MAAM,CAAC,eAAe,EAAE,CAAC,sBAAsB,CAAC,CAAC;EAC/D8E,eAAe,EAAE9E,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;EACxE+E,MAAM,EAAE/E,MAAM,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC;AACvCgF,EAAAA,KAAK,EAAEhF,MAAM,CAAC,IAAI,EAAEiB,mBAAmB,CAAC;EACxCgE,UAAU,EAAEjF,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACrDkF,UAAU,EAAElF,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACrDmF,QAAQ,EAAEnF,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;EAC/CoF,cAAc,EAAEpF,MAAM,CAAC,iBAAiB,EAAE,CAAC,qBAAqB,CAAC,CAAC;EAClEqF,IAAI,EAAErF,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC;EAClCsF,YAAY,EAAEtF,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC;EACxDuF,WAAW,EAAEvF,MAAM,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC;EACnDwF,UAAU,EAAExF,MAAM,CAAC,aAAa,EAAE,CAAC,YAAY,CAAC,CAAC;EACjDyF,eAAe,EAAEzF,MAAM,CAAC,kBAAkB,EAAE,CAC1C,sBAAsB,EACtB,GAAGwB,wBAAwB,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,QAAQ,CACT,CAAC;AACFkE,EAAAA,QAAQ,EAAE1F,MAAM,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAA;AAC9C,CAAC,CAAA;AAEM,MAAM2F,gBAAsD,GAAG;AACpErD,EAAAA,aAAa,EAAE;AACbN,IAAAA,IAAI,EAAEhC,MAAM,CAAC,qBAAqB,EAAE,CAClC,4BAA4B,EAC5B,GAAG0B,yBAAyB,EAC5B,GAAGC,2BAA2B,EAC9B,GAAGhB,eAAe,CACnB,CAAA;GACF;AACDiF,EAAAA,KAAK,EAAE;IACL5D,IAAI,EAAEhC,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC;IACnEiC,SAAS,EAAEjC,MAAM,CAAC,kBAAkB,EAAE,CACpC,qBAAqB,EACrB,GAAGkB,gCAAgC,CACpC,CAAC;IACF2E,OAAO,EAAE7F,MAAM,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACxD8F,gBAAgB,EAAE9F,MAAM,CAAC,0BAA0B,EAAE,CACnD,iCAAiC,CAClC,CAAC;AACFkC,IAAAA,EAAE,EAAElC,MAAM,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAA;GACvC;AAEDwC,EAAAA,WAAW,EAAE;AACXuD,IAAAA,MAAM,EAAE/F,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAA;GACjD;AAEDgG,EAAAA,MAAM,EAAE;IACNC,KAAK,EAAEjG,MAAM,CAAC,cAAc,EAAE,CAC5B,qBAAqB,EACrB,qBAAqB,CACtB,CAAA;GACF;AAED0C,EAAAA,IAAI,EAAE;AACJwD,IAAAA,GAAG,EAAElG,MAAM,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAA;GACxC;AAED6C,EAAAA,KAAK,EAAE;IACLsD,OAAO,EAAEnG,MAAM,CAAC,gBAAgB,EAAE,CAChC,mBAAmB,EACnB,kBAAkB,CACnB,CAAA;GACF;AAEDoG,EAAAA,QAAQ,EAAE;IACRC,UAAU,EAAErG,MAAM,CAAC,sBAAsB,EAAE,CAAC,6BAA6B,CAAC,CAAC;AAC3EsG,IAAAA,aAAa,EAAEtG,MAAM,CAAC,yBAAyB,EAAE,CAC/C,gCAAgC,CACjC,CAAA;GACF;AAEDoD,EAAAA,QAAQ,EAAE;AACRmD,IAAAA,MAAM,EAAEvG,MAAM,CAAC,iBAAiB,EAAE,CAChC,oBAAoB,EACpB,GAAG4B,oBAAoB,EACvB,GAAGjB,eAAe,CACnB,CAAC;AACFqB,IAAAA,IAAI,EAAEhC,MAAM,CAAC,eAAe,EAAE,CAC5B,kBAAkB,EAClB,GAAG4B,oBAAoB,EACvB,GAAGjB,eAAe,CACnB,CAAC;IACFsF,KAAK,EAAEjG,MAAM,CAAC,gBAAgB,EAAE,CAC9B,uBAAuB,EACvB,GAAG4B,oBAAoB,CACxB,CAAC;AACF4E,IAAAA,GAAG,EAAExG,MAAM,CAAC,cAAc,EAAE,CAC1B,qBAAqB,EACrB,GAAG4B,oBAAoB,EACvB,GAAGjB,eAAe,CACnB,CAAC;AACF8F,IAAAA,QAAQ,EAAEzG,MAAM,CAAC,oBAAoB,EAAE,CACrC,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,GAAG4B,oBAAoB,EACvB,GAAGjB,eAAe,CACnB,CAAA;GACF;AAED+F,EAAAA,IAAI,EAAE;IACJC,SAAS,EAAE3G,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC9D4G,KAAK,EAAE5G,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAChE6G,IAAAA,OAAO,EAAE7G,MAAM,CAAC,eAAe,EAAE,CAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,CACnB,CAAC;IACF8G,SAAS,EAAE9G,MAAM,CAAC,gBAAgB,EAAE,CAClC,mBAAmB,EACnB,iBAAiB,CAClB,CAAA;GACF;AAED+G,EAAAA,IAAI,EAAE;IACJC,WAAW,EAAEhH,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACpEiH,WAAW,EAAEjH,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACpEkH,KAAK,EAAElH,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CmH,KAAK,EAAEnH,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CoH,KAAK,EAAEpH,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CqH,IAAI,EAAErH,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3CsH,KAAK,EAAEtH,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAClDuH,KAAK,EAAEvH,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CwH,IAAI,EAAExH,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3CyH,OAAO,EAAEzH,MAAM,CAAC,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACxD0H,KAAK,EAAE1H,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9C2H,MAAM,EAAE3H,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACjD4H,QAAQ,EAAE5H,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACvD6H,MAAM,EAAE7H,MAAM,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACrD8H,KAAK,EAAE9H,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9C+H,KAAK,EAAE/H,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAClDgI,IAAI,EAAEhI,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3CiI,KAAK,EAAEjI,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAClDkI,KAAK,EAAElI,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAClDmI,KAAK,EAAEnI,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CoI,KAAK,EAAEpI,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;IAC9CqI,IAAI,EAAErI,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3CsI,OAAO,EAAEtI,MAAM,CAAC,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACxDuI,KAAK,EAAEvI,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAClDwI,UAAU,EAAExI,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACnEyI,IAAI,EAAEzI,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3C0I,OAAO,EAAE1I,MAAM,CAAC,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACxD2I,IAAI,EAAE3I,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3C4I,UAAU,EAAE5I,MAAM,CAAC,kBAAkB,EAAE,CACrC,qBAAqB,EACrB,mBAAmB,CACpB,CAAC;IACF6I,IAAI,EAAE7I,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IAC3C8I,KAAK,EAAE9I,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAC;AAC9C+I,IAAAA,KAAK,EAAE/I,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,CAAC,CAAA;GAClD;AAEDyD,EAAAA,GAAG,EAAE;IACHzB,IAAI,EAAEhC,MAAM,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,GAAGoB,eAAe,CAAC,CAAC;IACjE4H,OAAO,EAAEhJ,MAAM,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,GAAGoB,eAAe,CAAC,CAAC;IACxE6H,KAAK,EAAEjJ,MAAM,CAAC,YAAY,EAAE,CAAC,mBAAmB,EAAE,GAAGoB,eAAe,CAAC,CAAC;IACtEc,EAAE,EAAElC,MAAM,CAAC,QAAQ,EAAE,CAAC,eAAe,EAAE,GAAGoB,eAAe,CAAC,CAAA;GAC3D;AAEDsC,EAAAA,MAAM,EAAE;IACNwF,OAAO,EAAElJ,MAAM,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACxDmJ,gBAAgB,EAAEnJ,MAAM,CAAC,yBAAyB,EAAE,CAClD,4BAA4B,CAC7B,CAAC;IACFoJ,gBAAgB,EAAEpJ,MAAM,CAAC,yBAAyB,EAAE,CAClD,4BAA4B,CAC7B,CAAC;IACFqJ,UAAU,EAAErJ,MAAM,CAAC,oBAAoB,EAAE,CAAC,2BAA2B,CAAC,CAAC;IACvEsJ,QAAQ,EAAEtJ,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC7DuJ,SAAS,EAAEvJ,MAAM,CAAC,mBAAmB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IAChEwJ,KAAK,EAAExJ,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACpDyJ,aAAa,EAAEzJ,MAAM,CAAC,wBAAwB,EAAE,CAC9C,2BAA2B,CAC5B,CAAC;IACFkF,UAAU,EAAElF,MAAM,CAAC,oBAAoB,EAAE,CAAC,uBAAuB,CAAC,CAAC;IACnEmF,QAAQ,EAAEnF,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC7DiG,KAAK,EAAEjG,MAAM,CAAC,cAAc,EAAE,CAC5B,qBAAqB,EACrB,qBAAqB,CACtB,CAAA;GACF;AAEDN,EAAAA,MAAM,EAAE;IACNgK,MAAM,EAAE1J,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACrD2J,MAAM,EAAE3J,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACrD4J,gBAAgB,EAAE5J,MAAM,CAAC,0BAA0B,EAAE,CACnD,6BAA6B,CAC9B,CAAC;IACF6J,cAAc,EAAE7J,MAAM,CAAC,wBAAwB,EAAE,CAC/C,2BAA2B,CAC5B,CAAC;IACF8J,OAAO,EAAE9J,MAAM,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACxD+J,MAAM,EAAE/J,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACrDgK,WAAW,EAAEhK,MAAM,CAAC,qBAAqB,EAAE,CACzC,wBAAwB,EACxB,mBAAmB,CACpB,CAAC;IACFiK,wBAAwB,EAAEjK,MAAM,CAAC,oCAAoC,EAAE,CACrE,uCAAuC,CACxC,CAAC;IACFkK,yBAAyB,EAAElK,MAAM,CAAC,qCAAqC,EAAE,CACvE,wCAAwC,CACzC,CAAC;IACFmK,mBAAmB,EAAEnK,MAAM,CAAC,+BAA+B,EAAE,CAC3D,kCAAkC,CACnC,CAAC;IACFoK,qBAAqB,EAAEpK,MAAM,CAAC,iCAAiC,EAAE,CAC/D,WAAW,CACZ,CAAC;IACFqK,cAAc,EAAErK,MAAM,CAAC,yBAAyB,EAAE,CAChD,4BAA4B,CAC7B,CAAC;IACFgJ,OAAO,EAAEhJ,MAAM,CAAC,iBAAiB,EAAE,CACjC,oBAAoB,EACpB,kBAAkB,CACnB,CAAC;IACFsK,MAAM,EAAEtK,MAAM,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACvDuK,EAAE,EAAEvK,MAAM,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC;IACzCwK,YAAY,EAAExK,MAAM,CAAC,sBAAsB,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACzEyK,QAAQ,EAAEzK,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC7D0K,QAAQ,EAAE1K,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC7DL,IAAI,EAAEK,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC/C2K,iBAAiB,EAAE3K,MAAM,CAAC,2BAA2B,EAAE,CACrD,8BAA8B,CAC/B,CAAC;IACF4K,IAAI,EAAE5K,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC/C6K,cAAc,EAAE7K,MAAM,CAAC,yBAAyB,EAAE,CAChD,4BAA4B,CAC7B,CAAC;AACF8K,IAAAA,MAAM,EAAE9K,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAA;GACrD;AAED4D,EAAAA,OAAO,EAAE;AACPmH,IAAAA,GAAG,EAAE/K,MAAM,CAAC,IAAI,EAAEkB,gCAAgC,CAAC;IACnD8J,UAAU,EAAEhL,MAAM,CAAC,qBAAqB,EAAE,CACxC,wBAAwB,EACxB,GAAGkB,gCAAgC,CACpC,CAAC;AACF+J,IAAAA,GAAG,EAAEjL,MAAM,CAAC,aAAa,EAAE,CACzB,gBAAgB,EAChB,oBAAoB,EACpB,GAAGkB,gCAAgC,CACpC,CAAC;AACFgK,IAAAA,IAAI,EAAElL,MAAM,CAAC,IAAI,EAAEkB,gCAAgC,CAAC;IACpDiK,GAAG,EAAEnL,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,EAAE,GAAGiB,mBAAmB,CAAC,CAAC;IACtEmK,aAAa,EAAEpL,MAAM,CAAC,wBAAwB,EAAE,CAC9C,2BAA2B,EAC3B,GAAGiB,mBAAmB,CACvB,CAAA;GACF;AAED8C,EAAAA,OAAO,EAAE;IACPsH,KAAK,EAAErL,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACpDsL,SAAS,EAAEtL,MAAM,CAAC,mBAAmB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IAChEuL,cAAc,EAAEvL,MAAM,CAAC,yBAAyB,EAAE,CAChD,gCAAgC,CACjC,CAAC;IACF6J,cAAc,EAAE7J,MAAM,CAAC,yBAAyB,EAAE,CAChD,4BAA4B,CAC7B,CAAC;IACFwL,cAAc,EAAExL,MAAM,CAAC,yBAAyB,EAAE,CAChD,gCAAgC,CACjC,CAAC;IACFyL,cAAc,EAAEzL,MAAM,CAAC,yBAAyB,EAAE,CAChD,4BAA4B,CAC7B,CAAC;IACF0L,GAAG,EAAE1L,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC9C2L,WAAW,EAAE3L,MAAM,CAAC,sBAAsB,EAAE,CAC1C,6BAA6B,CAC9B,CAAC;IACF4L,eAAe,EAAE5L,MAAM,CAAC,2BAA2B,EAAE,CACnD,kCAAkC,CACnC,CAAC;IACF6L,cAAc,EAAE7L,MAAM,CAAC,0BAA0B,EAAE,CACjD,iCAAiC,CAClC,CAAC;IACF8L,kBAAkB,EAAE9L,MAAM,CAAC,+BAA+B,EAAE,CAC1D,sCAAsC,CACvC,CAAC;IACFiK,wBAAwB,EAAEjK,MAAM,CAAC,qCAAqC,EAAE,CACtE,wCAAwC,CACzC,CAAC;IACFqK,cAAc,EAAErK,MAAM,CAAC,0BAA0B,EAAE,CACjD,6BAA6B,CAC9B,CAAC;IACF+L,GAAG,EAAE/L,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC9CgM,WAAW,EAAEhM,MAAM,CAAC,sBAAsB,EAAE,CAC1C,6BAA6B,CAC9B,CAAC;IACFiM,cAAc,EAAEjM,MAAM,CAAC,0BAA0B,EAAE,CACjD,iCAAiC,CAClC,CAAC;IACFwK,YAAY,EAAExK,MAAM,CAAC,uBAAuB,EAAE,CAAC,0BAA0B,CAAC,CAAC;IAC3EkM,QAAQ,EAAElM,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACjEmM,OAAO,EAAEnM,MAAM,CAAC,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAC5D2K,iBAAiB,EAAE3K,MAAM,CAAC,4BAA4B,EAAE,CACtD,+BAA+B,CAChC,CAAC;IACFoM,GAAG,EAAEpM,MAAM,CAAC,aAAa,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAC9C6K,IAAAA,cAAc,EAAE7K,MAAM,CAAC,0BAA0B,EAAE,CACjD,6BAA6B,CAC9B,CAAA;GACF;AAEDgE,EAAAA,MAAM,EAAE;AACNe,IAAAA,MAAM,EAAE/E,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAA;GACrD;AAEDR,EAAAA,GAAG,EAAE;IACHwC,IAAI,EAAEhC,MAAM,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,GAAGqB,eAAe,CAAC,CAAC;IACjEa,EAAE,EAAElC,MAAM,CAAC,QAAQ,EAAE,CAAC,eAAe,EAAE,GAAGqB,eAAe,CAAC,CAAA;GAC3D;AAEDgL,EAAAA,MAAM,EAAE;IACNC,MAAM,EAAEtM,MAAM,CAAC,eAAe,EAAE,CAAC,sBAAsB,CAAC,CAAC;AACzDuM,IAAAA,MAAM,EAAEvM,MAAM,CAAC,eAAe,EAAE,CAC9B,sBAAsB,EACtB,2BAA2B,EAC3B,aAAa,CACd,CAAC;IACFwM,aAAa,EAAExM,MAAM,CAAC,wBAAwB,EAAE,CAC9C,2BAA2B,CAC5B,CAAC;AACFyM,IAAAA,GAAG,EAAEzM,MAAM,CAAC,YAAY,EAAE,CAAC,eAAe,CAAC,CAAA;GAC5C;AAEDkE,EAAAA,MAAM,EAAE;IACNwI,YAAY,EAAE1M,MAAM,CAAC,sBAAsB,EAAE,CAC3C,yBAAyB,EACzB,iCAAiC,CAClC,CAAC;IACF2M,aAAa,EAAE3M,MAAM,CAAC,uBAAuB,EAAE,CAC7C,0BAA0B,CAC3B,CAAC;IACF4M,aAAa,EAAE5M,MAAM,CAAC,uBAAuB,EAAE,CAC7C,8BAA8B,CAC/B,CAAC;IACF6M,OAAO,EAAE7M,MAAM,CAAC,gBAAgB,EAAE,CAChC,mBAAmB,EACnB,qBAAqB,CACtB,CAAC;IACF8M,GAAG,EAAE9M,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,WAAW,CAAC;IAC1C+M,WAAW,EAAE/M,MAAM,CAAC,qBAAqB,EAAE,CACzC,wBAAwB,EACxB,0BAA0B,CAC3B,CAAC;IACFgN,kBAAkB,EAAEhN,MAAM,CAAC,6BAA6B,EAAE,CACxD,gCAAgC,EAChC,iBAAiB,CAClB,CAAC;IACFiN,YAAY,EAAEjN,MAAM,CAAC,sBAAsB,EAAE,CAC3C,6BAA6B,EAC7B,WAAW,CACZ,CAAC;IACFkN,kBAAkB,EAAElN,MAAM,CAAC,6BAA6B,EAAE,CACxD,oCAAoC,EACpC,WAAW,CACZ,CAAC;IACFmN,WAAW,EAAEnN,MAAM,CAAC,sBAAsB,EAAE,CAC1C,6BAA6B,EAC7B,WAAW,CACZ,CAAC;IACFoN,iBAAiB,EAAEpN,MAAM,CAAC,6BAA6B,EAAE,CACvD,oCAAoC,EACpC,WAAW,CACZ,CAAC;IACFqN,QAAQ,EAAErN,MAAM,CAAC,iBAAiB,EAAE,CAClC,oBAAoB,EACpB,GAAGa,sBAAsB,CAC1B,CAAC;IACFyM,MAAM,EAAEtN,MAAM,CAAC,gBAAgB,EAAE,EAAE,EAAE,WAAW,CAAC;IACjDuN,KAAK,EAAEvN,MAAM,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACrEwN,OAAO,EAAExN,MAAM,CAAC,gBAAgB,EAAE,CAAC,uBAAuB,CAAC,CAAC;IAC5DyN,QAAQ,EAAEzN,MAAM,CAAC,kBAAkB,EAAE,CACnC,qBAAqB,EACrB,qBAAqB,CACtB,CAAC;AACFkM,IAAAA,QAAQ,EAAElM,MAAM,CAAC,iBAAiB,EAAE6B,6BAA6B,CAAC;IAClE6L,WAAW,EAAE1N,MAAM,CAAC,qBAAqB,EAAE,CAAC,4BAA4B,CAAC,CAAC;IAC1E2N,UAAU,EAAE3N,MAAM,CAAC,mBAAmB,EAAE,CAAC,0BAA0B,CAAC,CAAC;IACrE4N,YAAY,EAAE5N,MAAM,CAAC,sBAAsB,EAAE,CAC3C,6BAA6B,CAC9B,CAAC;IACF6N,OAAO,EAAE7N,MAAM,CAAC,gBAAgB,EAAE,CAChC,mBAAmB,EACnB,mBAAmB,CACpB,CAAC;IACF8N,MAAM,EAAE9N,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IACzE+N,OAAO,EAAE/N,MAAM,CAAC,gBAAgB,EAAE,CAChC,mBAAmB,EACnB,kBAAkB,CACnB,CAAC;IACFgO,KAAK,EAAEhO,MAAM,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACrEiO,WAAW,EAAEjO,MAAM,CAAC,qBAAqB,EAAE,CACzC,wBAAwB,EACxB,sBAAsB,CACvB,CAAC;AACFkO,IAAAA,WAAW,EAAElO,MAAM,CAAC,sBAAsB,EAAE,CAC1C,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,CACxB,CAAC;AACFmO,IAAAA,WAAW,EAAEnO,MAAM,CAAC,oBAAoB,EAAE,CAAC,uBAAuB,CAAC,CAAA;GACpE;AAEDsE,EAAAA,GAAG,EAAE;IACH8J,QAAQ,EAAEpO,MAAM,CAAC,eAAe,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IACnE4G,KAAK,EAAE5G,MAAM,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;GACxD;AAEDwE,EAAAA,OAAO,EAAE;IACPxC,IAAI,EAAEhC,MAAM,CAAC,eAAe,EAAE,CAC5B,sBAAsB,EACtB,GAAGsB,mBAAmB,CACvB,CAAC;IACFY,EAAE,EAAElC,MAAM,CAAC,aAAa,EAAE,CAAC,oBAAoB,EAAE,GAAGsB,mBAAmB,CAAC,CAAA;GACzE;AAEDmD,EAAAA,OAAO,EAAE;IACPzC,IAAI,EAAEhC,MAAM,CAAC,eAAe,EAAE,CAC5B,sBAAsB,EACtB,GAAGuB,mBAAmB,CACvB,CAAC;IACFW,EAAE,EAAElC,MAAM,CAAC,aAAa,EAAE,CAAC,oBAAoB,EAAE,GAAGuB,mBAAmB,CAAC,CAAA;GACzE;AAED0B,EAAAA,SAAS,EAAEnB,uBAAuB,CAAC,2BAA2B,CAAC;AAC/DuB,EAAAA,UAAU,EAAE;IACVgL,UAAU,EAAErO,MAAM,CAAC,IAAI,EAAE,CACvB,4BAA4B,EAC5B,GAAGS,sBAAsB,CAC1B,CAAC;IACF6N,OAAO,EAAEtO,MAAM,CAAC,IAAI,EAAE,CACpB,yBAAyB,EACzB,GAAGS,sBAAsB,CAC1B,CAAC;IACF,GAAGqB,uBAAuB,CAAC,4BAA4B,CAAA;GACxD;AACDwB,EAAAA,iBAAiB,EAAExB,uBAAuB,CACxC,oCACF,CAAC;AACDoB,EAAAA,UAAU,EAAEpB,uBAAuB,CAAC,4BAA4B,CAAC;AACjEyB,EAAAA,WAAW,EAAEzB,uBAAuB,CAAC,6BAA6B,CAAC;AACnEqB,EAAAA,UAAU,EAAErB,uBAAuB,CAAC,4BAA4B,CAAC;AACjE0B,EAAAA,WAAW,EAAE1B,uBAAuB,CAAC,6BAA6B,CAAC;AACnEiB,EAAAA,YAAY,EAAEjB,uBAAuB,CAAC,8BAA8B,CAAC;AACrEkB,EAAAA,YAAY,EAAElB,uBAAuB,CAAC,8BAA8B,CAAC;AAErEyM,EAAAA,WAAW,EAAE;AACXC,IAAAA,YAAY,EAAExO,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC7C2N,IAAAA,SAAS,EAAEzO,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAC;AAC1C4N,IAAAA,YAAY,EAAE1O,MAAM,CAAC,IAAI,EAAEc,iBAAiB,CAAA;AAC9C,GAAA;AACF,CAAC,CAAA;AAED,CACE,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,CACX,CAACjB,OAAO,CAAC8O,cAAc,IAAI;AAC1BhJ,EAAAA,gBAAgB,CAACgJ,cAAc,CAAC,GAAGhJ,gBAAgB,CAAC9C,KAAK,CAAA;AAC3D,CAAC,CAAC,CAAA;AAEK,MAAM+L,kBAAkB,GAAG;AAChCC,EAAAA,cAAc,EAAE7O,MAAM,CAAC,IAAI,EAAE,CAC3B,wCAAwC,EACxC,GAAG0B,yBAAyB,EAC5B,kCAAkC,EAClC,GAAGE,oBAAoB,CACxB,CAAC;AACFkN,EAAAA,EAAE,EAAE9O,MAAM,CAAC,aAAa,EAAE;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,CACd,CAAC;EACF+O,MAAM,EAAE/O,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC1CgP,GAAG,EAAEhP,MAAM,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,CAAC;EACpCiP,IAAI,EAAEjP,MAAM,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC;EACnDkP,KAAK,EAAElP,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,CAAC;EACxCmP,IAAI,EAAEnP,MAAM,CAAC,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACtCoP,MAAM,EAAEpP,MAAM,CAAC,IAAI,EAAE,CAAC,wBAAwB,EAAE,GAAG4B,oBAAoB,CAAC,CAAC;EACzE0F,KAAK,EAAEtH,MAAM,CAAC,gBAAgB,EAAE,CAAC,qBAAqB,CAAC,CAAC;EACxDqP,WAAW,EAAErP,MAAM,CAAC,wBAAwB,EAAE,CAAC,yBAAyB,CAAC,CAAC;EAC1EsP,UAAU,EAAEtP,MAAM,CAAC,sBAAsB,EAAE,CAAC,2BAA2B,CAAC,CAAC;AACzEuG,EAAAA,MAAM,EAAEvG,MAAM,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,EAAEuP,SAAS,EAAE,CAAC,QAAQ,CAAC,CAAC;EAC7EC,UAAU,EAAExP,MAAM,CAAC,sBAAsB,EAAE,CAAC,sBAAsB,CAAC,CAAC;EACpEyP,WAAW,EAAEzP,MAAM,CAAC,sBAAsB,EAAE,CAAC,6BAA6B,CAAC,CAAC;EAC5E0P,WAAW,EAAE1P,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;EACjE2P,MAAM,EAAE3P,MAAM,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC;AAC3C4P,EAAAA,IAAI,EAAE5P,MAAM,CAAC,IAAI,EAAE,CACjB,kBAAkB,EAClB,GAAG4B,oBAAoB,EACvB,4BAA4B,EAC5B,GAAGF,yBAAyB,CAC7B,CAAC;EACFmO,QAAQ,EAAE7P,MAAM,CAAC,oBAAoB,EAAE,CAAC,qBAAqB,CAAC,CAAC;AAC/D8J,EAAAA,OAAO,EAAE9J,MAAM,CAAC,kBAAkB,EAAEY,2BAA2B,CAAC;EAChEkP,KAAK,EAAE9P,MAAM,CAAC,gBAAgB,EAAE,CAC9B,gBAAgB,EAChB,mBAAmB,EACnB,GAAG4B,oBAAAA;AACH;AACA;AACA;AACA;AACA;AACA;AAAA,GACD,CAAC;EACFmO,IAAI,EAAE/P,MAAM,CAAC,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACtCgQ,IAAI,EAAEhQ,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC;EAChDiQ,MAAM,EAAEjQ,MAAM,CAAC,iBAAiB,EAAE,CAChC,iBAAiB,EACjB,oBAAoB,EACpB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACFsO,YAAY,EAAElQ,MAAM,CAAC,wBAAwB,EAAE,CAC7C,4BAA4B,CAC7B,CAAC;EACFmQ,OAAO,EAAEnQ,MAAM,CAAC,IAAI,EAAE,CAAC,oBAAoB,EAAE,GAAGiB,mBAAmB,CAAC,CAAC;EACrEmP,IAAI,EAAEpQ,MAAM,CAAC,eAAe,EAAE,CAC5B,eAAe,EACf,kBAAkB,EAClB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACFyO,SAAS,EAAErQ,MAAM,CAAC,qBAAqB,EAAE,CAAC,qBAAqB,CAAC,CAAC;EACjEsQ,QAAQ,EAAEtQ,MAAM,CAAC,oBAAoB,EAAE,CAAC,oBAAoB,CAAC,CAAC;EAC9DuQ,aAAa,EAAEvQ,MAAM,CAAC,0BAA0B,EAAE,CAChD,0BAA0B,CAC3B,CAAC;EACFwQ,KAAK,EAAExQ,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,CAAC;EACxCyQ,KAAK,EAAEzQ,MAAM,CAAC,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACpD0Q,EAAAA,OAAO,EAAE1Q,MAAM,CAAC,mBAAmB,EAAE,CACnC,mBAAmB,EACnB,+BAA+B,EAC/B,sBAAsB,EACtB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACF+O,IAAI,EAAE3Q,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,EAAE,2BAA2B,CAAC,CAAC;EAC7E4Q,UAAU,EAAE5Q,MAAM,CAAC,IAAI,EAAE,CACvB,0BAA0B,EAC1B,GAAGmC,oBAAoB,CACxB,CAAC;EACF0O,eAAe,EAAE7Q,MAAM,CAAC,IAAI,EAAE,CAC5B,oCAAoC,EACpC,GAAGmC,oBAAoB,CACxB,CAAC;EACF2O,OAAO,EAAE9Q,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC3C+Q,KAAK,EAAE/Q,MAAM,CAAC,gBAAgB,EAAE,CAAC,oBAAoB,CAAC,CAAC;EACvDgJ,OAAO,EAAEhJ,MAAM,CAAC,mBAAmB,EAAE,CAAC,uBAAuB,CAAC,CAAC;AAC/DgR,EAAAA,YAAY,EAAEhR,MAAM,CAAC,0BAA0B,EAAE,CAC/C,8BAA8B,EAC9B,QAAQ,EACR,qBAAqB,CACtB,CAAC;AACFiR,EAAAA,UAAU,EAAEjR,MAAM,CAAC,uBAAuB,EAAE,CAC1C,2BAA2B,EAC3B,QAAQ,EACR,qBAAqB,CACtB,CAAC;EACFkR,SAAS,EAAElR,MAAM,CAAC,IAAI,EAAE,CAAC,qBAAqB,CAAC,CAAC;EAChDmR,QAAQ,EAAEnR,MAAM,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;EAC9CH,OAAO,EAAEG,MAAM,CAAC,mBAAmB,EAAE,CACnC,mBAAmB,EACnB,sBAAsB,EACtB,GAAG4B,oBAAoB;AACvB;AACA,EAAA,8BAA8B,CAC/B,CAAC;EACFwP,QAAQ,EAAEpR,MAAM,CAAC,mBAAmB,EAAE,CACpC,mBAAmB,EACnB,oBAAoB,CACrB,CAAC;AACFqR,EAAAA,OAAO,EAAErR,MAAM,CAAC,IAAI,EAAE,CACpB,+BAA+B,EAC/B,GAAG0B,yBAAyB,EAC5B,yBAAyB,EACzB,GAAGE,oBAAoB,CACxB,CAAC;EACF0P,OAAO,EAAEtR,MAAM,CAAC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC,CAAC;EAC3DuR,YAAY,EAAEvR,MAAM,CAAC,yBAAyB,EAAE,CAAC,0BAA0B,CAAC,CAAC;EAC7EwR,OAAO,EAAExR,MAAM,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC;EAC5CyR,IAAI,EAAEzR,MAAM,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,CAAC;AACrCL,EAAAA,IAAI,EAAEK,MAAM,CAAC,eAAe,EAAEY,2BAA2B,CAAC;EAC1D8Q,SAAS,EAAE1R,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAC;EACpD2R,WAAW,EAAE3R,MAAM,CAAC,wBAAwB,EAAE,CAAC,wBAAwB,CAAC,CAAC;EACzE4R,QAAQ,EAAE5R,MAAM,CAAC,IAAI,EAAE,CAAC,wBAAwB,CAAC,CAAC;EAClD6R,IAAI,EAAE7R,MAAM,CAAC,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACtC8R,GAAG,EAAE9R,MAAM,CAAC,cAAc,EAAE,CAC1B,cAAc,EACd,iBAAiB,EACjB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACF2L,KAAK,EAAEvN,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;EAC1DyN,QAAQ,EAAEzN,MAAM,CAAC,oBAAoB,EAAE,CACrC,qBAAqB,EACrB,gBAAgB,CACjB,CAAC;EACFF,IAAI,EAAEE,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EACxC+R,MAAM,EAAE/R,MAAM,CAAC,kBAAkB,EAAE,CAAC,mBAAmB,CAAC,CAAC;EACzDgS,QAAQ,EAAEhS,MAAM,CAAC,oBAAoB,EAAE,CAAC,qBAAqB,CAAC,CAAC;EAC/DiS,IAAI,EAAEjS,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC;EAChDkS,MAAM,EAAElS,MAAM,CAAC,iBAAiB,EAAE,CAChC,iBAAiB,EACjB,oBAAoB,EACpB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACFuQ,WAAW,EAAEnS,MAAM,CAAC,uBAAuB,EAAE,CAAC,uBAAuB,CAAC,CAAC;EACvEoS,MAAM,EAAEpS,MAAM,CAAC,iBAAiB,EAAE,CAAC,kBAAkB,CAAC,CAAC;EACvD6N,OAAO,EAAE7N,MAAM,CAAC,IAAI,EAAE,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAC9DqS,EAAAA,UAAU,EAAErS,MAAM,CAAC,sBAAsB,EAAE,CACzC,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,CACjB,CAAC;EACFsS,OAAO,EAAEtS,MAAM,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC,CAAC;EACzD8N,MAAM,EAAE9N,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;EAC5DuS,UAAU,EAAEvS,MAAM,CAAC,IAAI,EAAE,CACvB,0BAA0B,EAC1B,GAAGmC,oBAAoB,CACxB,CAAC;EACFqQ,eAAe,EAAExS,MAAM,CAAC,IAAI,EAAE,CAC5B,oCAAoC,EACpC,GAAGmC,oBAAoB,CACxB,CAAC;EACFsQ,OAAO,EAAEzS,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC3C0S,KAAK,EAAE1S,MAAM,CAAC,gBAAgB,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACnD2S,OAAO,EAAE3S,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,EAAE,GAAG4B,oBAAoB,CAAC,CAAC;EAC3EgR,KAAK,EAAE5S,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,CAAC;EACxC6S,IAAI,EAAE7S,MAAM,CAAC,eAAe,EAAE,CAC5B,eAAe,EACf,kBAAkB,EAClB,GAAG4B,oBAAAA;AACH;AAAA,GACD,CAAC;EACFxB,IAAI,EAAEJ,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC;EAChD8S,MAAM,EAAE9S,MAAM,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,CAAC;EACtDgO,KAAK,EAAEhO,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;EAC1D+S,UAAU,EAAE/S,MAAM,CAAC,sBAAsB,EAAE,CAAC,uBAAuB,CAAC,CAAC;EACrEgT,MAAM,EAAEhT,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC1CiT,MAAM,EAAEjT,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC1CkT,GAAG,EAAElT,MAAM,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,CAAC;EACpCmT,MAAM,EAAEnT,MAAM,CAAC,IAAI,EAAE,CAAC,kBAAkB,CAAC,CAAC;EAC1CoT,GAAG,EAAEpT,MAAM,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,CAAC;AACpCqT,EAAAA,IAAI,EAAErT,MAAM,CAAC,IAAI,EAAE,CACjB,kBAAkB,EAClB,GAAG4B,oBAAoB,EACvB,4BAA4B,EAC5B,GAAGF,yBAAyB,CAC7B,CAAC;EACF4R,IAAI,EAAEtT,MAAM,CAAC,IAAI,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AACxDuT,EAAAA,OAAO,EAAEvT,MAAM,CAAC,IAAI,EAAE,CACpB,sBAAsB,EACtB,GAAG4B,oBAAoB,EACvB,gCAAgC,EAChC,GAAGF,yBAAyB,CAC7B,CAAC;AACF8R,EAAAA,OAAO,EAAExT,MAAM,CAAC,IAAI,EAAE,CACpB,0BAA0B,EAC1B,GAAG4B,oBAAoB,EACvB,GAAGF,yBAAyB,EAC5B,GAAGC,2BAA2B,CAC/B,CAAC;EACF8R,aAAa,EAAEzT,MAAM,CAAC,IAAI,EAAE,CAAC,0BAA0B,CAAC,CAAC;EACzD0T,OAAO,EAAE1T,MAAM,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;EAC7C2T,WAAW,EAAE3T,MAAM,CAAC,IAAI,EAAE,CAAC,uBAAuB,CAAC,CAAC;EACpD4T,WAAW,EAAE5T,MAAM,CAAC,IAAI,EAAE,CAAC,uBAAuB,CAAC,CAAC;EACpD6T,MAAM,EAAE7T,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,CAAC;EACzC8T,WAAW,EAAE9T,MAAM,CAAC,IAAI,EAAE,CAAC,wBAAwB,CAAC,CAAC;EACrD+T,UAAU,EAAE/T,MAAM,CAAC,sBAAsB,EAAE,CAAC,sBAAsB,CAAC,CAAC;EACpEgU,QAAQ,EAAEhU,MAAM,CAAC,oBAAoB,EAAE,CACrC,oBAAoB,EACpB,eAAe,CAChB,CAAC;EACFiU,SAAS,EAAEjU,MAAM,CAAC,qBAAqB,EAAE,CAAC,qBAAqB,CAAC,CAAC;AACjEkU,EAAAA,QAAQ,EAAElU,MAAM,CAAC,IAAI,EAAE,CACrB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,CACtB,CAAC;EACFmU,YAAY,EAAEnU,MAAM,CAAC,yBAAyB,EAAE,CAAC,0BAA0B,CAAC,CAAC;EAC7EoU,IAAI,EAAEpU,MAAM,CAAC,eAAe,EAAE,CAAC,gBAAgB,CAAC,CAAC;EACjDqU,OAAO,EAAErU,MAAM,CAAC,mBAAmB,EAAE,CAAC,oBAAoB,CAAC,CAAC;EAC5DsU,QAAQ,EAAEtU,MAAM,CAAC,oBAAoB,EAAE,CAAC,sBAAsB,CAAC,CAAC;EAChEuU,SAAS,EAAEvU,MAAM,CAAC,qBAAqB,EAAE,CAAC,oBAAoB,CAAC,CAAC;EAChEwU,SAAS,EAAExU,MAAM,CAAC,qBAAqB,EAAE,CAAC,sBAAsB,CAAC,CAAC;EAClEyU,QAAQ,EAAEzU,MAAM,CAAC,oBAAoB,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;EAC5E0U,OAAO,EAAE1U,MAAM,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC,CAAC;EACzD2U,MAAM,EAAE3U,MAAM,CAAC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC,CAAC;AAC/D8K,EAAAA,MAAM,EAAE9K,MAAM,CAAC,iBAAiB,EAAEY,2BAA2B,CAAC;EAC9DgU,OAAO,EAAE5U,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,EAAE,GAAG4B,oBAAoB,CAAC,CAAC;EAC3EiT,IAAI,EAAE7U,MAAM,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC;EAChD8U,gBAAgB,EAAE9U,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAC;EAC3D+U,gBAAgB,EAAE/U,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAC;EAC3DgV,gBAAgB,EAAEhV,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAC;EAC3DiV,gBAAgB,EAAEjV,MAAM,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,CAAC;EAC3D,CAAC,WAAW,GAAGA,MAAM,CAAC,IAAI,EAAE,CAAC,iBAAiB,CAAC,CAAA;AACjD,CAAC;;AC3gCD;AACA;AACA;;AAEO,MAAMkV,MAAM,GAAG,IAAI1V,GAAG,CAAC,CAC5B,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,oCAAoC,EACpC,qCAAqC,EACrC,+BAA+B,EAC/B,iCAAiC,EACjC,yBAAyB,EACzB,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,2BAA2B,EAC3B,aAAa,EACb,yBAAyB,EACzB,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,qCAAqC,EACrC,0BAA0B,EAC1B,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,4BAA4B,EAC5B,aAAa,EACb,0BAA0B,EAC1B,KAAK,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,EACL,mBAAmB,EACnB,UAAU,EACV,UAAU,CACX,CAAC,CAAA;AAEK,MAAM2V,SAAS,GAAG,IAAI3V,GAAG,CAAC,CAC/B,GAAG0V,MAAM,EACT,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,+BAA+B,EAC/B,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,CACvB,CAAC;;;ACjLOE,EAAAA,KAAK,EAAIC,GAAAA;AAAC,CAAA,GAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA,CAAA;AAEJ,SAASE,eAAeA,CACrCC,IAA8B,EAC9BC,IAAc,EACd;EACA,MAAM;IAAEC,IAAI;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAGF,IAAI,CAAA;EAC7B,QAAQD,IAAI,CAAC3V,IAAI;AACf,IAAA,KAAK,iBAAiB;AAAE,MAAA;AACtB,QAAA,IAAI,CAACuV,GAAC,CAACQ,gBAAgB,CAACD,MAAM,EAAE;AAAEE,UAAAA,MAAM,EAAEH,IAAAA;SAAM,CAAC,EAAE,OAAO,KAAK,CAAA;QAC/D,IAAIC,MAAM,CAACG,SAAS,CAACC,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI,CAAA;AAC5C,QAAA,MAAMC,QAAQ,GAAGL,MAAM,CAACG,SAAS,CAAC,CAAC,CAAC,CAAA;AACpC,QAAA,OAAOV,GAAC,CAACa,eAAe,CAACD,QAAQ,CAAC,IAAIZ,GAAC,CAACc,iBAAiB,CAACF,QAAQ,CAAC,CAAA;AACrE,OAAA;AACF,GAAA;AACF;;;AChBSb,EAAAA,KAAK,EAAIC,GAAAA;AAAC,CAAA,GAAAC,MAAA,CAAAC,OAAA,IAAAD,MAAA,CAAA;AAGZ,MAAMc,aAAa,GAAG,wBAAwB,CAAA;AAE9C,SAASC,UAAUA,CACxBX,IAAS,EACTY,EAAgB,EAChBC,YAAsB,EACtBC,UAAmD,EACnD;AACA,EAAA,MAAM,CAACC,QAAQ,EAAEC,QAAQ,CAAC,GAAGC,mBAAmB,CAACjB,IAAI,CAACC,IAAI,EAAED,IAAI,CAACkB,KAAK,CAAC,CAAA;EAEvE,IAAId,MAAoB,GAAGT,GAAC,CAACwB,cAAc,CAACP,EAAE,EAAE,CAACG,QAAQ,CAAC,CAAC,CAAA;AAC3D,EAAA,IAAID,UAAU,EAAEV,MAAM,GAAGU,UAAU,CAACV,MAAM,CAAC,CAAA;AAE3C,EAAA,MAAMgB,IAAI,GAAGzB,GAAC,CAAC0B,UAAU,CAAC,MAAM,CAAC,CAAA;EAEjCrB,IAAI,CAACsB,WAAW,CACdT,YAAY,GACRlB,GAAC,CAAC4B,wBAAwB,CAACnB,MAAM,EAAEgB,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,GACrDzB,GAAC,CAAC6B,gBAAgB,CAACpB,MAAM,EAAEgB,IAAI,CACrC,CAAC,CAAA;EAEDpB,IAAI,CAACyB,UAAU,CAACC,gBAAgB,CAAC,WAAW,EAAEV,QAAQ,CAAC,CAAA;AACzD,CAAA;AAEO,SAASC,mBAAmBA,CACjChB,IAAqD,EACrDiB,KAAwB,EACxB;EACA,MAAM;AAAES,IAAAA,MAAAA;AAAO,GAAC,GAAG1B,IAAI,CAAA;EAEvB,IAAIc,QAAQ,EAAEC,QAAQ,CAAA;AACtB,EAAA,IAAIrB,GAAC,CAACiC,YAAY,CAACD,MAAM,CAAC,EAAE;AAC1BX,IAAAA,QAAQ,GAAGW,MAAM,CAAA;AACjBZ,IAAAA,QAAQ,GAAGpB,GAAC,CAACkC,SAAS,CAACF,MAAM,CAAC,CAAA;AAChC,GAAC,MAAM;AACLX,IAAAA,QAAQ,GAAGE,KAAK,CAACY,6BAA6B,CAAC,SAAS,CAAC,CAAA;AACzDf,IAAAA,QAAQ,GAAGpB,GAAC,CAACoC,oBAAoB,CAAC,GAAG,EAAEpC,GAAC,CAACkC,SAAS,CAACb,QAAQ,CAAC,EAAEW,MAAM,CAAC,CAAA;AACvE,GAAA;AAEA,EAAA,OAAO,CAACZ,QAAQ,EAAEC,QAAQ,CAAC,CAAA;AAC7B,CAAA;AAEO,SAASgB,oBAAoBA,CAClCd,KAAwB,EACxBjB,IAAgC,EAChC;EACA,IAAIgC,YAAY,GAAGhC,IAAI,CAAA;AACvB,EAAA,OACE,CAACgC,YAAY,CAACC,QAAQ,IACtBvC,GAAC,CAACwC,0BAA0B,CAACF,YAAY,CAACN,MAAM,CAAC,EACjD;IACAM,YAAY,GAAGA,YAAY,CAACN,MAAM,CAAA;AACpC,GAAA;EACAM,YAAY,CAACC,QAAQ,GAAG,KAAK,CAAA;AAE7B,EAAA,MAAME,GAAG,GAAGlB,KAAK,CAACY,6BAA6B,CAAC,SAAS,CAAC,CAAA;AAC1D,EAAA,MAAM9N,MAAM,GAAG2L,GAAC,CAACoC,oBAAoB,CAAC,GAAG,EAAEK,GAAG,EAAEH,YAAY,CAACN,MAAM,CAAC,CAAA;EACpEM,YAAY,CAACN,MAAM,GAAGhC,GAAC,CAACkC,SAAS,CAACO,GAAG,CAAC,CAAA;AAEtC,EAAA,OAAOC,YAAY,IACjB1C,GAAC,CAAC2C,qBAAqB,CACrB3C,GAAC,CAAC4C,gBAAgB,CAAC,IAAI,EAAEvO,MAAM,EAAE2L,GAAC,CAAC6C,WAAW,EAAE,CAAC,EACjD7C,GAAC,CAAC8C,eAAe,CAAC,MAAM,EAAE9C,GAAC,CAAC+C,cAAc,CAAC,CAAC,CAAC,CAAC,EAC9CL,YACF,CAAC,CAAA;AACL,CAAA;AAEO,SAASM,cAAcA,CAACC,MAAc,EAAE;AAC7C,EAAA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;AAC9BA,IAAAA,MAAM,GAAGA,MAAM,CACZzK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CACnBA,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CACrC0K,WAAW,EAAE,CAAA;AAClB,GAAA;AAEA,EAAA,OACE7Y,MAAM,CAAC8Y,SAAS,CAACC,cAAc,CAAC3B,IAAI,CAAC4B,aAAa,EAAEJ,MAAM,CAAC,IAC3DI,aAAa,CAACJ,MAAM,CAAC,CAAA;AAEzB,CAAA;AAEO,SAASK,YAAYA,CAAC7Y,IAAY,EAAE;EACzC,OAAO,CAAA,gBAAA,EAAmBA,IAAI,CAAK,GAAA,CAAA,CAAA;AACrC,CAAA;AAEO,SAAS8Y,gBAAgBA,CAC9B9Y,IAAY,EACZ+Y,eAAwB,EACxBC,GAAW,EACX;AACA,EAAA,OAAOD,eAAe,GAClB,CAAGzC,EAAAA,aAAa,CAAYtW,SAAAA,EAAAA,IAAI,CAAGgZ,EAAAA,GAAG,CAAE,CAAA,GACxC,CAAyBhZ,sBAAAA,EAAAA,IAAI,CAAK,GAAA,CAAA,CAAA;AACxC;;AClF8C,MAAA;AAGrCsV,EAAAA,KAAK,EAAIC,CAAC;AAAE0D,EAAAA,QAAQ,EAARA,QAAAA;AAAQ,CAAA,GAAAzD,MAAA,CAAAC,OAAA,IAAAD,MAAA,CAAA;AAa7B,MAAM0D,eAAe,GAAG,iDAAiD,CAAA;AACzE,MAAMC,aAAa,GAAG,8CAA8C,CAAA;AAapE,MAAMC,aAAa,GAAG,CACpB,OAAO,EACP,QAAQ,EAER,UAAU,EACV,gBAAgB,EAChB,iBAAiB,CAClB,CAACpH,GAAG,CAACqH,CAAC,IAAI,IAAInV,MAAM,CAAC,CAAYmV,SAAAA,EAAAA,CAAC,CAAO,KAAA,CAAA,CAAC,CAAC,CAAA;AAE5C,MAAMC,cAAc,GAAGA,CACrBtZ,IAAY,EACZuZ,EAA6B,KACjB;AACZ,EAAA,IAAIA,EAAE,CAACvZ,IAAI,CAAC,EAAE,OAAO,IAAI,CAAA;EACzB,IAAI,CAACA,IAAI,CAACiT,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;EACzC,MAAMuG,QAAQ,GAAG,CAAUxZ,OAAAA,EAAAA,IAAI,CAAC4S,KAAK,CAAC,CAAC,CAAC,CAAE,CAAA,CAAA;AAC1C,EAAA,IAAI,CAAC9S,gBAAgB,CAAC0Z,QAAQ,CAAC,EAAE,OAAO,KAAK,CAAA;EAC7C,OAAOD,EAAE,CAACC,QAAQ,CAAC,CAAA;AACrB,CAAC,CAAA;AAED,YAAeC,cAAc,CAAU,UACrC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,oBAAoB;EAAEC,kBAAkB;EAAEC,KAAK;AAAEC,EAAAA,KAAAA;AAAM,CAAC,EAC5E;AACEC,EAAAA,OAAO,GAAG,CAAC;aACX3E,WAAS;EACT4E,gBAAgB;AAChB,EAAA,CAACf,eAAe,GAAG;AAAEgB,IAAAA,aAAa,GAAG,KAAA;GAAO,GAAG,EAAE;AACjD,EAAA,CAACf,aAAa,GAAG;AAAEJ,IAAAA,eAAe,GAAG,KAAK;AAAEC,IAAAA,GAAG,GAAG,KAAA;AAAM,GAAC,GAAG,EAAC;AAC/D,CAAC,EACD;AACA,EAAA,MAAMmB,SAAS,GAAGJ,KAAK,CAACK,MAAM,CAACA,MAAM,IAAI,CAAAA,MAAM,oBAANA,MAAM,CAAEpa,IAAI,MAAK,cAAc,CAAC,CAAA;EAEzE,MAAMqa,OAAO,GAAGR,kBAAkB,CAAC;AACjCzZ,IAAAA,MAAM,EAAEkC,QAAQ;AAChBgY,IAAAA,MAAM,EAAEzU,gBAAgB;AACxB0U,IAAAA,QAAQ,EAAEzL,kBAAAA;AACZ,GAAC,CAAC,CAAA;EAEF,MAAM0L,SAAS,GAAG,IAAI9a,GAAG,CAAC+a,8BAA8B,CAACT,OAAO,CAAC,CAAC,CAAA;EAElE,SAASU,iBAAiBA,CAACC,eAAe,EAAE;AAC1C,IAAA,OAAO5B,eAAe,GAClB4B,eAAe,GACb,CAAA,EAAGrE,aAAa,CAAU,QAAA,CAAA,GAC1B,CAAGA,EAAAA,aAAa,iBAAiB,GACnCqE,eAAe,GACb,uBAAuB,GACvB,qBAAqB,CAAA;AAC7B,GAAA;AAEA,EAAA,SAASC,qBAAqBA,CAAC5a,IAAY,EAAE6a,KAAK,EAAE;AAClD,IAAA,IAAIjB,oBAAoB,CAAC5Z,IAAI,CAAC,EAAE;MAC9B8Z,KAAK,CAAC9Z,IAAI,CAAC,CAAA;MACX6a,KAAK,CAACC,kBAAkB,CAACjC,YAAY,CAAC7Y,IAAI,CAAC,EAAEA,IAAI,CAAC,CAAA;AAClD,MAAA,OAAO,IAAI,CAAA;AACb,KAAA;AACA,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;EAEA,SAAS+a,iBAAiBA,CAACC,KAAe,EAAEH,KAAK,EAAErB,QAAQ,GAAG,IAAI,EAAE;AAClE,IAAA,KAAK,MAAMxZ,IAAI,IAAIgb,KAAK,EAAE;AACxB,MAAA,IAAIxB,QAAQ,EAAE;QACZF,cAAc,CAACtZ,IAAI,EAAEA,IAAI,IAAI4a,qBAAqB,CAAC5a,IAAI,EAAE6a,KAAK,CAAC,CAAC,CAAA;AAClE,OAAC,MAAM;AACLD,QAAAA,qBAAqB,CAAC5a,IAAI,EAAE6a,KAAK,CAAC,CAAA;AACpC,OAAA;AACF,KAAA;AACF,GAAA;EAEA,SAASI,eAAeA,CACtBtF,IAA8B,EAC9BuF,IAAY,EACZL,KAAkC,EAClCtD,MAAe,EACf;AACA,IAAA,IACE5B,IAAI,CAACxV,IAAI,IACT,EAAEoX,MAAM,IAAI5B,IAAI,CAACtV,OAAO,IAAIsV,IAAI,CAACtV,OAAO,CAACiR,QAAQ,CAACiG,MAAM,CAAC,CAAC,IAC1D+B,cAAc,CAAC3D,IAAI,CAAC3V,IAAI,EAAE4Z,oBAAoB,CAAC,EAC/C;MACA,MAAM;AAAE5Z,QAAAA,IAAAA;AAAK,OAAC,GAAG2V,IAAI,CAAA;MACrB,IAAIgF,eAAe,GAAG,KAAK,CAAA;MAC3B,IAAItF,WAAS,IAAK4E,gBAAgB,IAAIja,IAAI,CAACiT,UAAU,CAAC,SAAS,CAAE,EAAE;AACjE0H,QAAAA,eAAe,GAAG,IAAI,CAAA;AACxB,OAAC,MAAM,IAAI3a,IAAI,CAACiT,UAAU,CAAC,KAAK,CAAC,IAAI,CAACuH,SAAS,CAACvO,GAAG,CAACjM,IAAI,CAAC,EAAE;AACzD2a,QAAAA,eAAe,GAAG,IAAI,CAAA;AACxB,OAAA;MACA,IACE5B,eAAe,IACf,CAAC,CACC4B,eAAe,GACXQ,SAA2B,GAC3BA,MAAwB,EAC5BlP,GAAG,CAAC0J,IAAI,CAACxV,IAAI,CAAC,EAChB;AACA,QAAA,OAAA;AACF,OAAA;AACA,MAAA,MAAMib,cAAc,GAAGV,iBAAiB,CAACC,eAAe,CAAC,CAAA;AACzD,MAAA,OAAOE,KAAK,CAACQ,mBAAmB,CAC9B,GAAGD,cAAc,CAAA,CAAA,EAAIzF,IAAI,CAACxV,IAAI,CAAG6Y,EAAAA,GAAG,CAAE,CAAA,EACtCkC,IACF,CAAC,CAAA;AACH,KAAA;AACF,GAAA;EAEA,SAASI,eAAeA,CAACtb,IAAI,EAAE;AAC7B,IAAA,IAAIA,IAAI,CAACiT,UAAU,CAAC,SAAS,CAAC,EAAE;MAC9B,MAAMsI,MAAM,GAAG,CAAMvb,GAAAA,EAAAA,IAAI,CAAC4S,KAAK,CAAC,CAAC,CAAC,CAAE,CAAA,CAAA;AACpC;AACA;MACA,OAAO2I,MAAM,IAAIzb,gBAAgB,CAAA;AACnC,KAAA;AACA,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;EAEA,OAAO;AACLE,IAAAA,IAAI,EAAE,SAAS;AAEfwb,IAAAA,WAAW,EAAEtB,aAAa,GAAG,IAAI,GAAG5D,aAAa;AAEjDmF,IAAAA,SAAS,EAAE3b,gBAAgB;IAE3B4b,eAAeA,CAAC1b,IAAI,EAAE;MACpB,IAAI,CAACwa,SAAS,CAACvO,GAAG,CAACjM,IAAI,CAAC,EAAE,OAAO,KAAK,CAAA;AACtC,MAAA,IAAIqV,WAAS,IAAIsE,MAAM,KAAK,cAAc,EAAE,OAAO,IAAI,CAAA;MACvD,IAAIM,gBAAgB,IAAI0B,2BAA2B,CAAC1P,GAAG,CAACjM,IAAI,CAAC,EAAE;AAC7D,QAAA,OAAO,IAAI,CAAA;AACb,OAAA;MACA,OAAOsb,eAAe,CAACtb,IAAI,CAAC,CAAA;KAC7B;AAED4b,IAAAA,WAAWA,CAACC,IAAI,EAAEhB,KAAK,EAAEjF,IAAI,EAAE;AAC7B,MAAA,IAAIiG,IAAI,CAACC,IAAI,KAAK,QAAQ,EAAE,OAAA;AAE5B,MAAA,MAAMpb,OAAO,GAAG6X,cAAc,CAACsD,IAAI,CAACrD,MAAM,CAAC,CAAA;MAC3C,IAAI,CAAC9X,OAAO,EAAE,OAAA;MAEd,IACEA,OAAO,CAACwV,MAAM,KAAK,CAAC,IACpB2F,IAAI,CAACrD,MAAM,KAAKK,YAAY,CAACnY,OAAO,CAAC,CAAC,CAAC,CAAC,IACxCkZ,oBAAoB,CAAClZ,OAAO,CAAC,CAAC,CAAC,CAAC,EAChC;AACA;AACA;QACAoZ,KAAK,CAAC,IAAI,CAAC,CAAA;AACX,QAAA,OAAA;AACF,OAAA;AAEA,MAAA,MAAMiC,UAAU,GAAG,IAAIrc,GAAG,CAACgB,OAAO,CAAC,CAAA;AACnC,MAAA,MAAMsb,eAAe,GAAGtb,OAAO,CAACyP,MAAM,CAAC8L,MAAM,IAAI;QAC/C,IAAI,CAACA,MAAM,CAAChJ,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,IAAI,CAAA;QAC9C,MAAMmC,MAAM,GAAG6G,MAAM,CAAClO,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAC/C,IAAIgO,UAAU,CAAC9P,GAAG,CAACmJ,MAAM,CAAC,IAAIwE,oBAAoB,CAACxE,MAAM,CAAC,EAAE;AAC1D,UAAA,OAAO,KAAK,CAAA;AACd,SAAA;AACA,QAAA,OAAO,IAAI,CAAA;AACb,OAAC,CAAC,CAAA;AAEF2F,MAAAA,iBAAiB,CAACiB,eAAe,EAAEnB,KAAK,EAAE,KAAK,CAAC,CAAA;MAChDjF,IAAI,CAACsG,MAAM,EAAE,CAAA;KACd;AAEDC,IAAAA,WAAWA,CAACN,IAAI,EAAEhB,KAAK,EAAEjF,IAAI,EAAE;AAC7B,MAAA,MAAMwG,QAAQ,GAAG/B,OAAO,CAACwB,IAAI,CAAC,CAAA;MAC9B,IAAI,CAACO,QAAQ,EAAE,OAAA;MAEf,IAAI1G,eAAe,CAAC0G,QAAQ,CAACzG,IAAI,EAAEC,IAAI,CAAC,EAAE,OAAA;AAE1C,MAAA,IAAIyG,IAAI,GAAGD,QAAQ,CAACzG,IAAI,CAACvV,MAAM,CAAA;AAE/B,MAAA,IACEgc,QAAQ,CAACN,IAAI,KAAK,QAAQ,IAC1B,QAAQ,IAAID,IAAI,IAChBA,IAAI,CAACtE,MAAM,IACXsE,IAAI,CAACS,SAAS,KAAK,WAAW,EAC9B;QACA,MAAMC,GAAG,GAAGV,IAAI,CAACtE,MAAM,CAACkB,WAAW,EAAE,CAAA;AACrC4D,QAAAA,IAAI,GAAGA,IAAI,CAAClM,MAAM,CAACqM,CAAC,IAClBpD,aAAa,CAACrG,IAAI,CAACsG,CAAC,IAAIA,CAAC,CAAC7F,IAAI,CAACgJ,CAAC,CAAC,CAAC,GAAGA,CAAC,CAAClL,QAAQ,CAACiL,GAAG,CAAC,GAAG,IACzD,CAAC,CAAA;AACH,OAAA;AAEAxB,MAAAA,iBAAiB,CAACsB,IAAI,EAAExB,KAAK,CAAC,CAAA;AAE9B,MAAA,OAAO,IAAI,CAAA;KACZ;AAED4B,IAAAA,SAASA,CAACZ,IAAI,EAAEhB,KAAK,EAAEjF,IAAI,EAAE;AAC3B,MAAA,IAAIiG,IAAI,CAACC,IAAI,KAAK,IAAI,EAAE;AACtB,QAAA,IAAID,IAAI,CAACa,GAAG,KAAK,iBAAiB,EAAE;AAClC9G,UAAAA,IAAI,CAACsB,WAAW,CACd3B,CAAC,CAACwB,cAAc,CACd8D,KAAK,CAACQ,mBAAmB,CACvBvC,gBAAgB,CAAC,aAAa,EAAEC,eAAe,EAAEC,GAAG,CAAC,EACrD,YACF,CAAC,EACD,CAAEpD,IAAI,CAACC,IAAI,CAAwB8G,KAAK,CAAC;AAC3C,WACF,CAAC,CAAA;AACH,SAAA;AACA,QAAA,OAAA;AACF,OAAA;AAEA,MAAA,IAAI/G,IAAI,CAACyB,UAAU,CAACuF,iBAAiB,CAAC;AAAEC,QAAAA,QAAQ,EAAE,QAAA;AAAS,OAAC,CAAC,EAAE,OAAA;AAE/D,MAAA,IAAIhB,IAAI,CAACC,IAAI,KAAK,UAAU,EAAE;AAC5B;AACA,QAAA,IAAI,CAAClG,IAAI,CAACkH,kBAAkB,EAAE,IAAI,CAAClH,IAAI,CAACmC,0BAA0B,EAAE,EAAE;AACpE,UAAA,OAAA;AACF,SAAA;AACA,QAAA,IAAI,CAACnC,IAAI,CAACmH,YAAY,EAAE,EAAE,OAAA;AAC1B,QAAA,IAAInH,IAAI,CAACyB,UAAU,CAAC2F,kBAAkB,EAAE,EAAE,OAAA;QAC1C,IAAIzH,CAAC,CAAC0H,OAAO,CAACrH,IAAI,CAACC,IAAI,CAAC0B,MAAM,CAAC,EAAE;AAC/B,UAAA,OAAA;AACF,SAAA;AAEA,QAAA,IAAIsE,IAAI,CAACa,GAAG,KAAK,iBAAiB,EAAE;AAClC,UAAA,IAAI,CAAC9C,oBAAoB,CAAC,oBAAoB,CAAC,EAAE,OAAA;UAEjD,MAAM;YAAE9D,MAAM;AAAED,YAAAA,IAAAA;AAAK,WAAC,GAAGD,IAAI,CAAA;AAC7B,UAAA,IAAIL,CAAC,CAACQ,gBAAgB,CAACD,MAAM,EAAE;AAAEE,YAAAA,MAAM,EAAEH,IAAAA;AAAK,WAAC,CAAC,EAAE;AAChD,YAAA,IAAIC,MAAM,CAACG,SAAS,CAACC,MAAM,KAAK,CAAC,EAAE;AACjCN,cAAAA,IAAI,CAACyB,UAAU,CAACH,WAAW,CACzB3B,CAAC,CAACwB,cAAc,CACd8D,KAAK,CAACQ,mBAAmB,CACvBvC,gBAAgB,CAAC,cAAc,EAAEC,eAAe,EAAEC,GAAG,CAAC,EACtD,aACF,CAAC,EACD,CAACnD,IAAI,CAAC0B,MAAM,CACd,CACF,CAAC,CAAA;cACD3B,IAAI,CAACsH,IAAI,EAAE,CAAA;AACb,aAAC,MAAM;AACL3G,cAAAA,UAAU,CACRX,IAAI,EACJiF,KAAK,CAACQ,mBAAmB,CACvBvC,gBAAgB,CAAC,qBAAqB,EAAEC,eAAe,EAAEC,GAAG,CAAC,EAC7D,mBACF,CACF,CAAC,CAAA;AACH,aAAA;AACF,WAAC,MAAM;AACLpD,YAAAA,IAAI,CAACsB,WAAW,CACd3B,CAAC,CAACwB,cAAc,CACd8D,KAAK,CAACQ,mBAAmB,CACvBvC,gBAAgB,CAAC,qBAAqB,EAAEC,eAAe,EAAEC,GAAG,CAAC,EAC7D,mBACF,CAAC,EACD,CAACpD,IAAI,CAACC,IAAI,CAAC0B,MAAM,CACnB,CACF,CAAC,CAAA;AACH,WAAA;AAEA,UAAA,OAAA;AACF,SAAA;AACF,OAAA;AAEA,MAAA,IAAI6E,QAAQ,GAAG/B,OAAO,CAACwB,IAAI,CAAC,CAAA;MAC5B,IAAI,CAACO,QAAQ,EAAE,OAAA;MAEf,IAAI1G,eAAe,CAAC0G,QAAQ,CAACzG,IAAI,EAAEC,IAAI,CAAC,EAAE,OAAA;MAE1C,IACEmD,eAAe,IACfqD,QAAQ,CAACzG,IAAI,CAACxV,IAAI,IAClBic,QAAQ,CAACzG,IAAI,CAACxV,IAAI,CAACyS,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EACzC;AACA;AACAwJ,QAAAA,QAAQ,GAAG;AACT,UAAA,GAAGA,QAAQ;AACXzG,UAAAA,IAAI,EAAE;YACJ,GAAGyG,QAAQ,CAACzG,IAAI;AAChBxV,YAAAA,IAAI,EAAEic,QAAQ,CAACzG,IAAI,CAACxV,IAAI,CAACyS,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACtC,WAAA;SACD,CAAA;AACH,OAAA;AAEA,MAAA,IAAIwJ,QAAQ,CAACN,IAAI,KAAK,QAAQ,EAAE;AAC9B,QAAA,MAAMtF,EAAE,GAAGyE,eAAe,CAACmB,QAAQ,CAACzG,IAAI,EAAEyG,QAAQ,CAACpc,IAAI,EAAE6a,KAAK,CAAC,CAAA;AAC/D,QAAA,IAAIrE,EAAE,EAAEZ,IAAI,CAACsB,WAAW,CAACV,EAAE,CAAC,CAAA;AAC9B,OAAC,MAAM,IAAI4F,QAAQ,CAACN,IAAI,KAAK,QAAQ,EAAE;AACrC,QAAA,MAAMtF,EAAE,GAAGyE,eAAe,CACxBmB,QAAQ,CAACzG,IAAI,EACbyG,QAAQ,CAACpc,IAAI,EACb6a,KAAK;AACL;QACAgB,IAAI,CAACtE,MACP,CAAC,CAAA;AACD,QAAA,IAAIf,EAAE,EAAE;AACNZ,UAAAA,IAAI,CAACsB,WAAW,CAACV,EAAE,CAAC,CAAA;UACpB,IAAI;AAAEa,YAAAA,UAAAA;AAAW,WAAC,GAAGzB,IAAI,CAAA;UACzB,IACEyB,UAAU,CAACU,0BAA0B,EAAE,IACvCV,UAAU,CAAC8F,wBAAwB,EAAE,EACrC;YACA,GAAG;cACD,MAAMC,mBAAmB,GAAG/F,UAE3B,CAAA;AACD+F,cAAAA,mBAAmB,CAACC,IAAI,GAAGD,mBAAmB,CAACvH,IAAI,CAACwH,IAAI,GACtDhG,UAAU,CAACgG,IAAI,KAAK,0BAA0B,GAC1C,kBAAkB,GAClB,gBAAgB,CAAA;AACtB,cAAA,OAAOD,mBAAmB,CAACvH,IAAI,CAACiC,QAAQ,CAAA;cAExC,CAAC;AAAET,gBAAAA,UAAAA;AAAW,eAAC,GAAGA,UAAU,EAAA;AAC9B,aAAC,QACC,CAACA,UAAU,CAACU,0BAA0B,EAAE,IACtCV,UAAU,CAAC8F,wBAAwB,EAAE,KACvC,CAAC9F,UAAU,CAACxB,IAAI,CAACiC,QAAQ,EAAA;AAE7B,WAAA;AACF,SAAA;AACF,OAAC,MAAM,IAAIsE,QAAQ,CAACN,IAAI,KAAK,UAAU,EAAE;AACvC,QAAA,MAAMtF,EAAE,GAAGyE,eAAe,CACxBmB,QAAQ,CAACzG,IAAI,EACb,CAAA,EAAGyG,QAAQ,CAACpc,IAAI,CAAA,gBAAA,CAAkB,EAClC6a,KAAK;AACL;QACAgB,IAAI,CAACtE,MACP,CAAC,CAAA;QACD,IAAI,CAACf,EAAE,EAAE,OAAA;QAET,MAAM;UAAEX,IAAI;AAAEC,UAAAA,MAAAA;AAAO,SAAC,GAAGF,IAExB,CAAA;AAED,QAAA,IAAIL,CAAC,CAAC4H,wBAAwB,CAACrH,MAAM,CAAC,IAAIA,MAAM,CAACE,MAAM,KAAKH,IAAI,EAAE;AAChE,UAAA,MAAMyH,WAAW,GAAGxH,MAAM,CAACgC,QAAQ,CAAA;AACnChC,UAAAA,MAAM,CAACgC,QAAQ,GAAG,CAACwF,WAAW,CAAA;UAE9B,IAAI,CAACA,WAAW,EAAE;YAChB,MAAMC,KAAK,GAAG3F,oBAAoB,CAChChC,IAAI,CAACkB,KAAK,EACVjB,IACF,CAAC,CAAA;AACD,YAAA,MAAM,CAAC2H,OAAO,EAAEC,QAAQ,CAAC,GAAG5G,mBAAmB,CAAChB,IAAI,EAAED,IAAI,CAACkB,KAAK,CAAC,CAAA;YAEjElB,IAAI,CAACsB,WAAW,CACdqG,KAAK,CACHtE,QAAQ,CAACyE,UAAU,CAACC,GAAG,CAAA;AACvC,qCAAA,EAAuCnH,EAAE,CAAA,CAAA,EAAIgH,OAAO,CAAA,GAAA,EAAMC,QAAQ,CAAA;AAClE,gBAAA,CACc,CACF,CAAC,CAAA;WACF,MAAM,IAAIlI,CAAC,CAACwC,0BAA0B,CAAClC,IAAI,CAAC,EAAE;YAC7C,MAAM0H,KAAK,GAAG3F,oBAAoB,CAAChC,IAAI,CAACkB,KAAK,EAAEjB,IAAI,CAAC,CAAA;YACpDU,UAAU,CAACX,IAAI,EAAEY,EAAE,EAAE,IAAI,EAAE+G,KAAK,CAAC,CAAA;AACnC,WAAC,MAAM;AACLhH,YAAAA,UAAU,CAACX,IAAI,EAAEY,EAAE,EAAE,IAAI,CAAC,CAAA;AAC5B,WAAA;AACF,SAAC,MAAM,IAAIjB,CAAC,CAACQ,gBAAgB,CAACD,MAAM,CAAC,IAAIA,MAAM,CAACE,MAAM,KAAKH,IAAI,EAAE;AAC/DU,UAAAA,UAAU,CAACX,IAAI,EAAEY,EAAE,EAAE,KAAK,CAAC,CAAA;SAC5B,MAAM,IAAIjB,CAAC,CAACwC,0BAA0B,CAAClC,IAAI,CAAC,EAAE;UAC7C,MAAM0H,KAAK,GAAG3F,oBAAoB,CAAChC,IAAI,CAACkB,KAAK,EAAEjB,IAAI,CAAC,CAAA;AACpDD,UAAAA,IAAI,CAACsB,WAAW,CAACqG,KAAK,CAAChI,CAAC,CAACwB,cAAc,CAACP,EAAE,EAAE,CAACX,IAAI,CAAC0B,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;UAC5D,IAAIhC,CAAC,CAACwC,0BAA0B,CAACjC,MAAM,CAAC,EAAEA,MAAM,CAACgC,QAAQ,GAAG,IAAI,CAAA;AAClE,SAAC,MAAM;AACLlC,UAAAA,IAAI,CAACsB,WAAW,CAAC3B,CAAC,CAACwB,cAAc,CAACP,EAAE,EAAE,CAACX,IAAI,CAAC0B,MAAM,CAAC,CAAC,CAAC,CAAA;AACvD,SAAA;AACF,OAAA;KACD;AAEDqG,IAAAA,OAAO,EAAEjE,MAAM,KAAK,cAAc,IAAI;AACpC;MACAkE,cAAcA,CAACjI,IAAgC,EAAE;QAC/C,IAAIA,IAAI,CAAChK,GAAG,CAAC,QAAQ,CAAC,CAACkS,QAAQ,EAAE,EAAE;AACjC,UAAA,MAAMjD,KAAK,GAAGnB,QAAQ,CAAC9D,IAAI,CAAC,CAAA;AAE5B,UAAA,IAAIuE,SAAS,EAAE;AACb;AACAY,YAAAA,iBAAiB,CAAC3Z,gCAAgC,EAAEyZ,KAAK,CAAC,CAAA;AAC5D,WAAC,MAAM;AACLE,YAAAA,iBAAiB,CAAC5Z,mBAAmB,EAAE0Z,KAAK,CAAC,CAAA;AAC/C,WAAA;AACF,SAAA;OACD;AAED;MACAvU,QAAQA,CAACsP,IAA0B,EAAE;AACnC,QAAA,IAAIA,IAAI,CAACC,IAAI,CAACkI,KAAK,EAAE;AACnBhD,UAAAA,iBAAiB,CAAC5Z,mBAAmB,EAAEuY,QAAQ,CAAC9D,IAAI,CAAC,CAAC,CAAA;AACxD,SAAA;OACD;AAED;MACA,6BAA6BoI,CAC3BpI,IAAiD,EACjD;AACAmF,QAAAA,iBAAiB,CAACla,eAAe,EAAE6Y,QAAQ,CAAC9D,IAAI,CAAC,CAAC,CAAA;OACnD;AAED;MACAqI,aAAaA,CAACrI,IAA+B,EAAE;QAC7C,IAAI,CAACA,IAAI,CAACyB,UAAU,CAAC6G,kBAAkB,EAAE,EAAE;AACzCnD,UAAAA,iBAAiB,CAACla,eAAe,EAAE6Y,QAAQ,CAAC9D,IAAI,CAAC,CAAC,CAAA;AACpD,SAAA;OACD;AAED;MACAuI,eAAeA,CAACvI,IAAiC,EAAE;AACjD,QAAA,IAAIA,IAAI,CAACC,IAAI,CAACuI,QAAQ,EAAE;AACtBrD,UAAAA,iBAAiB,CAACla,eAAe,EAAE6Y,QAAQ,CAAC9D,IAAI,CAAC,CAAC,CAAA;AACpD,SAAA;OACD;AAED;MACAyI,KAAKA,CAACzI,IAAuB,EAAE;AAAA,QAAA,IAAA0I,qBAAA,CAAA;QAC7B,MAAMC,aAAa,GACjB,CAAA,CAAAD,qBAAA,GAAA1I,IAAI,CAACC,IAAI,CAAC2I,UAAU,KAApBF,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAAsBpI,MAAM,KAC5BN,IAAI,CAACC,IAAI,CAAC4I,IAAI,CAACA,IAAI,CAAC1L,IAAI,CACtB2L,EAAE,IAAA;AAAA,UAAA,IAAAC,WAAA,CAAA;UAAA,OAAAA,CAAAA,WAAA,GAAKD,EAAE,CAAmBF,UAAU,KAAhCG,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,WAAA,CAAkCzI,MAAM,CAAA;AAAA,SAChD,CAAC,CAAA;AACH,QAAA,IAAIqI,aAAa,EAAE;AACjBxD,UAAAA,iBAAiB,CAAChZ,6BAA6B,EAAE2X,QAAQ,CAAC9D,IAAI,CAAC,CAAC,CAAA;AAClE,SAAA;AACF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/babel-runtime-corejs3-paths.js b/node_modules/babel-plugin-polyfill-corejs3/lib/babel-runtime-corejs3-paths.js new file mode 100644 index 0000000000000000000000000000000000000000..dc6c904bebf870769f798de5049f0eb3219cc10c --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/babel-runtime-corejs3-paths.js @@ -0,0 +1,10 @@ +"use strict"; + +exports.__esModule = true; +exports.stable = exports.proposals = void 0; +// This file contains the list of paths supported by @babel/runtime-corejs3. +// It must _not_ be edited, as all new features should go through direct +// injection of core-js-pure imports. + +const stable = exports.stable = new Set(["array", "array/from", "array/is-array", "array/of", "clear-immediate", "date/now", "instance/bind", "instance/code-point-at", "instance/concat", "instance/copy-within", "instance/ends-with", "instance/entries", "instance/every", "instance/fill", "instance/filter", "instance/find", "instance/find-index", "instance/flags", "instance/flat", "instance/flat-map", "instance/for-each", "instance/includes", "instance/index-of", "instance/keys", "instance/last-index-of", "instance/map", "instance/pad-end", "instance/pad-start", "instance/reduce", "instance/reduce-right", "instance/repeat", "instance/reverse", "instance/slice", "instance/some", "instance/sort", "instance/splice", "instance/starts-with", "instance/trim", "instance/trim-end", "instance/trim-left", "instance/trim-right", "instance/trim-start", "instance/values", "json/stringify", "map", "math/acosh", "math/asinh", "math/atanh", "math/cbrt", "math/clz32", "math/cosh", "math/expm1", "math/fround", "math/hypot", "math/imul", "math/log10", "math/log1p", "math/log2", "math/sign", "math/sinh", "math/tanh", "math/trunc", "number/epsilon", "number/is-finite", "number/is-integer", "number/is-nan", "number/is-safe-integer", "number/max-safe-integer", "number/min-safe-integer", "number/parse-float", "number/parse-int", "object/assign", "object/create", "object/define-properties", "object/define-property", "object/entries", "object/freeze", "object/from-entries", "object/get-own-property-descriptor", "object/get-own-property-descriptors", "object/get-own-property-names", "object/get-own-property-symbols", "object/get-prototype-of", "object/is", "object/is-extensible", "object/is-frozen", "object/is-sealed", "object/keys", "object/prevent-extensions", "object/seal", "object/set-prototype-of", "object/values", "parse-float", "parse-int", "promise", "queue-microtask", "reflect/apply", "reflect/construct", "reflect/define-property", "reflect/delete-property", "reflect/get", "reflect/get-own-property-descriptor", "reflect/get-prototype-of", "reflect/has", "reflect/is-extensible", "reflect/own-keys", "reflect/prevent-extensions", "reflect/set", "reflect/set-prototype-of", "set", "set-immediate", "set-interval", "set-timeout", "string/from-code-point", "string/raw", "symbol", "symbol/async-iterator", "symbol/for", "symbol/has-instance", "symbol/is-concat-spreadable", "symbol/iterator", "symbol/key-for", "symbol/match", "symbol/replace", "symbol/search", "symbol/species", "symbol/split", "symbol/to-primitive", "symbol/to-string-tag", "symbol/unscopables", "url", "url-search-params", "weak-map", "weak-set"]); +const proposals = exports.proposals = new Set([...stable, "aggregate-error", "composite-key", "composite-symbol", "global-this", "instance/at", "instance/code-points", "instance/match-all", "instance/replace-all", "math/clamp", "math/degrees", "math/deg-per-rad", "math/fscale", "math/iaddh", "math/imulh", "math/isubh", "math/rad-per-deg", "math/radians", "math/scale", "math/seeded-prng", "math/signbit", "math/umulh", "number/from-string", "observable", "reflect/define-metadata", "reflect/delete-metadata", "reflect/get-metadata", "reflect/get-metadata-keys", "reflect/get-own-metadata", "reflect/get-own-metadata-keys", "reflect/has-metadata", "reflect/has-own-metadata", "reflect/metadata", "symbol/dispose", "symbol/observable", "symbol/pattern-match"]); \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js b/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js new file mode 100644 index 0000000000000000000000000000000000000000..73e4ad6dfae76e0abae6cfa25fe36923e2a57407 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js @@ -0,0 +1,474 @@ +"use strict"; + +exports.__esModule = true; +exports.StaticProperties = exports.PromiseDependenciesWithIterators = exports.PromiseDependencies = exports.InstanceProperties = exports.DecoratorMetadataDependencies = exports.CommonIterators = exports.BuiltIns = void 0; +var _data = _interopRequireDefault(require("../core-js-compat/data.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const polyfillsOrder = {}; +Object.keys(_data.default).forEach((name, index) => { + polyfillsOrder[name] = index; +}); +const define = (pure, global, name = global[0], exclude) => { + return { + name, + pure, + global: global.sort((a, b) => polyfillsOrder[a] - polyfillsOrder[b]), + exclude + }; +}; +const typed = (...modules) => define(null, [...modules, ...TypedArrayDependencies]); +const ArrayNatureIterators = ["es.array.iterator", "web.dom-collections.iterator"]; +const CommonIterators = exports.CommonIterators = ["es.string.iterator", ...ArrayNatureIterators]; +const ArrayNatureIteratorsWithTag = ["es.object.to-string", ...ArrayNatureIterators]; +const CommonIteratorsWithTag = ["es.object.to-string", ...CommonIterators]; +const ErrorDependencies = ["es.error.cause", "es.error.to-string"]; +const SuppressedErrorDependencies = ["es.suppressed-error.constructor", ...ErrorDependencies]; +const ArrayBufferDependencies = ["es.array-buffer.constructor", "es.array-buffer.slice", "es.data-view", "es.array-buffer.detached", "es.array-buffer.transfer", "es.array-buffer.transfer-to-fixed-length", "es.object.to-string"]; +const TypedArrayDependencies = ["es.typed-array.at", "es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.find-last", "es.typed-array.find-last-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-reversed", "es.typed-array.to-sorted", "es.typed-array.to-string", "es.typed-array.with", "es.object.to-string", "es.array.iterator", "esnext.typed-array.filter-reject", "esnext.typed-array.group-by", "esnext.typed-array.to-spliced", "esnext.typed-array.unique-by", ...ArrayBufferDependencies]; +const PromiseDependencies = exports.PromiseDependencies = ["es.promise", "es.object.to-string"]; +const PromiseDependenciesWithIterators = exports.PromiseDependenciesWithIterators = [...PromiseDependencies, ...CommonIterators]; +const SymbolDependencies = ["es.symbol", "es.symbol.description", "es.object.to-string"]; +const MapDependencies = ["es.map", "es.map.get-or-insert", "es.map.get-or-insert-computed", "esnext.map.delete-all", "esnext.map.emplace", "esnext.map.every", "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", "esnext.map.map-values", "esnext.map.merge", "esnext.map.reduce", "esnext.map.some", "esnext.map.update", ...CommonIteratorsWithTag]; +const SetDependencies = ["es.set", "es.set.difference.v2", "es.set.intersection.v2", "es.set.is-disjoint-from.v2", "es.set.is-subset-of.v2", "es.set.is-superset-of.v2", "es.set.symmetric-difference.v2", "es.set.union.v2", "esnext.set.add-all", "esnext.set.delete-all", "esnext.set.difference", "esnext.set.every", "esnext.set.filter", "esnext.set.find", "esnext.set.intersection", "esnext.set.is-disjoint-from", "esnext.set.is-subset-of", "esnext.set.is-superset-of", "esnext.set.join", "esnext.set.map", "esnext.set.reduce", "esnext.set.some", "esnext.set.symmetric-difference", "esnext.set.union", ...CommonIteratorsWithTag]; +const WeakMapDependencies = ["es.weak-map", "es.weak-map.get-or-insert", "es.weak-map.get-or-insert-computed", "esnext.weak-map.delete-all", "esnext.weak-map.emplace", ...CommonIteratorsWithTag]; +const WeakSetDependencies = ["es.weak-set", "esnext.weak-set.add-all", "esnext.weak-set.delete-all", ...CommonIteratorsWithTag]; +const DOMExceptionDependencies = ["web.dom-exception.constructor", "web.dom-exception.stack", "web.dom-exception.to-string-tag", "es.error.to-string"]; +const URLSearchParamsDependencies = ["web.url-search-params", "web.url-search-params.delete", "web.url-search-params.has", "web.url-search-params.size", ...CommonIteratorsWithTag]; +const AsyncIteratorDependencies = ["esnext.async-iterator.constructor", ...PromiseDependencies]; +const AsyncIteratorProblemMethods = ["esnext.async-iterator.every", "esnext.async-iterator.filter", "esnext.async-iterator.find", "esnext.async-iterator.flat-map", "esnext.async-iterator.for-each", "esnext.async-iterator.map", "esnext.async-iterator.reduce", "esnext.async-iterator.some"]; +const IteratorDependencies = ["es.iterator.constructor", "es.object.to-string"]; +const DecoratorMetadataDependencies = exports.DecoratorMetadataDependencies = ["esnext.symbol.metadata", "esnext.function.metadata"]; +const TypedArrayStaticMethods = base => ({ + from: define(null, ["es.typed-array.from", base, ...TypedArrayDependencies]), + fromAsync: define(null, ["esnext.typed-array.from-async", base, ...PromiseDependenciesWithIterators, ...TypedArrayDependencies]), + of: define(null, ["es.typed-array.of", base, ...TypedArrayDependencies]) +}); +const DataViewDependencies = ["es.data-view", ...ArrayBufferDependencies]; +const BuiltIns = exports.BuiltIns = { + AsyncDisposableStack: define("async-disposable-stack/index", ["es.async-disposable-stack.constructor", "es.object.to-string", "es.async-iterator.async-dispose", "es.iterator.dispose", ...PromiseDependencies, ...SuppressedErrorDependencies]), + AsyncIterator: define("async-iterator/index", AsyncIteratorDependencies), + AggregateError: define("aggregate-error", ["es.aggregate-error", ...ErrorDependencies, ...CommonIteratorsWithTag, "es.aggregate-error.cause"]), + ArrayBuffer: define(null, ArrayBufferDependencies), + DataView: define(null, DataViewDependencies), + Date: define(null, ["es.date.to-string"]), + DOMException: define("dom-exception/index", DOMExceptionDependencies), + DisposableStack: define("disposable-stack/index", ["es.disposable-stack.constructor", "es.object.to-string", "es.iterator.dispose", ...SuppressedErrorDependencies]), + Error: define(null, ErrorDependencies), + EvalError: define(null, ErrorDependencies), + Float32Array: typed("es.typed-array.float32-array"), + Float64Array: typed("es.typed-array.float64-array"), + Int8Array: typed("es.typed-array.int8-array"), + Int16Array: typed("es.typed-array.int16-array"), + Int32Array: typed("es.typed-array.int32-array"), + Iterator: define("iterator/index", IteratorDependencies), + Uint8Array: typed("es.typed-array.uint8-array", "es.uint8-array.set-from-base64", "es.uint8-array.set-from-hex", "es.uint8-array.to-base64", "es.uint8-array.to-hex"), + Uint8ClampedArray: typed("es.typed-array.uint8-clamped-array"), + Uint16Array: typed("es.typed-array.uint16-array"), + Uint32Array: typed("es.typed-array.uint32-array"), + Map: define("map/index", MapDependencies), + Number: define(null, ["es.number.constructor"]), + Observable: define("observable/index", ["esnext.observable", "esnext.symbol.observable", "es.object.to-string", ...CommonIteratorsWithTag]), + Promise: define("promise/index", PromiseDependencies), + RangeError: define(null, ErrorDependencies), + ReferenceError: define(null, ErrorDependencies), + Reflect: define(null, ["es.reflect.to-string-tag", "es.object.to-string"]), + RegExp: define(null, ["es.regexp.constructor", "es.regexp.dot-all", "es.regexp.exec", "es.regexp.sticky", "es.regexp.to-string"]), + Set: define("set/index", SetDependencies), + SuppressedError: define("suppressed-error", SuppressedErrorDependencies), + Symbol: define("symbol/index", SymbolDependencies), + SyntaxError: define(null, ErrorDependencies), + TypeError: define(null, ErrorDependencies), + URIError: define(null, ErrorDependencies), + URL: define("url/index", ["web.url", "web.url.to-json", ...URLSearchParamsDependencies]), + URLSearchParams: define("url-search-params/index", URLSearchParamsDependencies), + WeakMap: define("weak-map/index", WeakMapDependencies), + WeakSet: define("weak-set/index", WeakSetDependencies), + atob: define("atob", ["web.atob", ...DOMExceptionDependencies]), + btoa: define("btoa", ["web.btoa", ...DOMExceptionDependencies]), + clearImmediate: define("clear-immediate", ["web.immediate"]), + compositeKey: define("composite-key", ["esnext.composite-key"]), + compositeSymbol: define("composite-symbol", ["esnext.composite-symbol"]), + escape: define("escape", ["es.escape"]), + fetch: define(null, PromiseDependencies), + globalThis: define("global-this", ["es.global-this"]), + parseFloat: define("parse-float", ["es.parse-float"]), + parseInt: define("parse-int", ["es.parse-int"]), + queueMicrotask: define("queue-microtask", ["web.queue-microtask"]), + self: define("self", ["web.self"]), + setImmediate: define("set-immediate", ["web.immediate"]), + setInterval: define("set-interval", ["web.timers"]), + setTimeout: define("set-timeout", ["web.timers"]), + structuredClone: define("structured-clone", ["web.structured-clone", ...DOMExceptionDependencies, "es.array.iterator", "es.object.keys", "es.object.to-string", "es.map", "es.set"]), + unescape: define("unescape", ["es.unescape"]) +}; +const StaticProperties = exports.StaticProperties = { + AsyncIterator: { + from: define("async-iterator/from", ["esnext.async-iterator.from", ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods, ...CommonIterators]) + }, + Array: { + from: define("array/from", ["es.array.from", "es.string.iterator"]), + fromAsync: define("array/from-async", ["es.array.from-async", ...PromiseDependenciesWithIterators]), + isArray: define("array/is-array", ["es.array.is-array"]), + isTemplateObject: define("array/is-template-object", ["esnext.array.is-template-object"]), + of: define("array/of", ["es.array.of"]) + }, + ArrayBuffer: { + isView: define(null, ["es.array-buffer.is-view"]) + }, + BigInt: { + range: define("bigint/range", ["esnext.bigint.range", "es.object.to-string"]) + }, + Date: { + now: define("date/now", ["es.date.now"]) + }, + Error: { + isError: define("error/is-error", ["es.error.is-error", "es.object.create"]) + }, + Function: { + isCallable: define("function/is-callable", ["esnext.function.is-callable"]), + isConstructor: define("function/is-constructor", ["esnext.function.is-constructor"]) + }, + Iterator: { + concat: define("iterator/concat", ["es.iterator.concat", ...IteratorDependencies, ...CommonIterators]), + from: define("iterator/from", ["es.iterator.from", ...IteratorDependencies, ...CommonIterators]), + range: define("iterator/range", ["esnext.iterator.range", ...IteratorDependencies]), + zip: define("iterator/zip", ["esnext.iterator.zip", ...IteratorDependencies, ...CommonIterators]), + zipKeyed: define("iterator/zip-keyed", ["esnext.iterator.zip-keyed", "es.object.create", "es.reflect.own-keys", ...IteratorDependencies, ...CommonIterators]) + }, + JSON: { + isRawJSON: define("json/is-raw-json", ["es.json.is-raw-json"]), + parse: define("json/parse", ["es.json.parse", "es.object.keys"]), + rawJSON: define("json/raw-json", ["es.json.raw-json", "es.object.create", "es.object.freeze"]), + stringify: define("json/stringify", ["es.json.stringify", "es.date.to-json"]) + }, + Math: { + DEG_PER_RAD: define("math/deg-per-rad", ["esnext.math.deg-per-rad"]), + RAD_PER_DEG: define("math/rad-per-deg", ["esnext.math.rad-per-deg"]), + acosh: define("math/acosh", ["es.math.acosh"]), + asinh: define("math/asinh", ["es.math.asinh"]), + atanh: define("math/atanh", ["es.math.atanh"]), + cbrt: define("math/cbrt", ["es.math.cbrt"]), + clamp: define("math/clamp", ["esnext.math.clamp"]), + clz32: define("math/clz32", ["es.math.clz32"]), + cosh: define("math/cosh", ["es.math.cosh"]), + degrees: define("math/degrees", ["esnext.math.degrees"]), + expm1: define("math/expm1", ["es.math.expm1"]), + fround: define("math/fround", ["es.math.fround"]), + f16round: define("math/f16round", ["es.math.f16round"]), + fscale: define("math/fscale", ["esnext.math.fscale"]), + hypot: define("math/hypot", ["es.math.hypot"]), + iaddh: define("math/iaddh", ["esnext.math.iaddh"]), + imul: define("math/imul", ["es.math.imul"]), + imulh: define("math/imulh", ["esnext.math.imulh"]), + isubh: define("math/isubh", ["esnext.math.isubh"]), + log10: define("math/log10", ["es.math.log10"]), + log1p: define("math/log1p", ["es.math.log1p"]), + log2: define("math/log2", ["es.math.log2"]), + radians: define("math/radians", ["esnext.math.radians"]), + scale: define("math/scale", ["esnext.math.scale"]), + seededPRNG: define("math/seeded-prng", ["esnext.math.seeded-prng"]), + sign: define("math/sign", ["es.math.sign"]), + signbit: define("math/signbit", ["esnext.math.signbit"]), + sinh: define("math/sinh", ["es.math.sinh"]), + sumPrecise: define("math/sum-precise", ["es.math.sum-precise", "es.array.iterator"]), + tanh: define("math/tanh", ["es.math.tanh"]), + trunc: define("math/trunc", ["es.math.trunc"]), + umulh: define("math/umulh", ["esnext.math.umulh"]) + }, + Map: { + from: define("map/from", ["esnext.map.from", ...MapDependencies]), + groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]), + keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]), + of: define("map/of", ["esnext.map.of", ...MapDependencies]) + }, + Number: { + EPSILON: define("number/epsilon", ["es.number.epsilon"]), + MAX_SAFE_INTEGER: define("number/max-safe-integer", ["es.number.max-safe-integer"]), + MIN_SAFE_INTEGER: define("number/min-safe-integer", ["es.number.min-safe-integer"]), + fromString: define("number/from-string", ["esnext.number.from-string"]), + isFinite: define("number/is-finite", ["es.number.is-finite"]), + isInteger: define("number/is-integer", ["es.number.is-integer"]), + isNaN: define("number/is-nan", ["es.number.is-nan"]), + isSafeInteger: define("number/is-safe-integer", ["es.number.is-safe-integer"]), + parseFloat: define("number/parse-float", ["es.number.parse-float"]), + parseInt: define("number/parse-int", ["es.number.parse-int"]), + range: define("number/range", ["esnext.number.range", "es.object.to-string"]) + }, + Object: { + assign: define("object/assign", ["es.object.assign"]), + create: define("object/create", ["es.object.create"]), + defineProperties: define("object/define-properties", ["es.object.define-properties"]), + defineProperty: define("object/define-property", ["es.object.define-property"]), + entries: define("object/entries", ["es.object.entries"]), + freeze: define("object/freeze", ["es.object.freeze"]), + fromEntries: define("object/from-entries", ["es.object.from-entries", "es.array.iterator"]), + getOwnPropertyDescriptor: define("object/get-own-property-descriptor", ["es.object.get-own-property-descriptor"]), + getOwnPropertyDescriptors: define("object/get-own-property-descriptors", ["es.object.get-own-property-descriptors"]), + getOwnPropertyNames: define("object/get-own-property-names", ["es.object.get-own-property-names"]), + getOwnPropertySymbols: define("object/get-own-property-symbols", ["es.symbol"]), + getPrototypeOf: define("object/get-prototype-of", ["es.object.get-prototype-of"]), + groupBy: define("object/group-by", ["es.object.group-by", "es.object.create"]), + hasOwn: define("object/has-own", ["es.object.has-own"]), + is: define("object/is", ["es.object.is"]), + isExtensible: define("object/is-extensible", ["es.object.is-extensible"]), + isFrozen: define("object/is-frozen", ["es.object.is-frozen"]), + isSealed: define("object/is-sealed", ["es.object.is-sealed"]), + keys: define("object/keys", ["es.object.keys"]), + preventExtensions: define("object/prevent-extensions", ["es.object.prevent-extensions"]), + seal: define("object/seal", ["es.object.seal"]), + setPrototypeOf: define("object/set-prototype-of", ["es.object.set-prototype-of"]), + values: define("object/values", ["es.object.values"]) + }, + Promise: { + all: define(null, PromiseDependenciesWithIterators), + allSettled: define("promise/all-settled", ["es.promise.all-settled", ...PromiseDependenciesWithIterators]), + any: define("promise/any", ["es.promise.any", "es.aggregate-error", ...PromiseDependenciesWithIterators]), + race: define(null, PromiseDependenciesWithIterators), + try: define("promise/try", ["es.promise.try", ...PromiseDependencies]), + withResolvers: define("promise/with-resolvers", ["es.promise.with-resolvers", ...PromiseDependencies]) + }, + Reflect: { + apply: define("reflect/apply", ["es.reflect.apply"]), + construct: define("reflect/construct", ["es.reflect.construct"]), + defineMetadata: define("reflect/define-metadata", ["esnext.reflect.define-metadata"]), + defineProperty: define("reflect/define-property", ["es.reflect.define-property"]), + deleteMetadata: define("reflect/delete-metadata", ["esnext.reflect.delete-metadata"]), + deleteProperty: define("reflect/delete-property", ["es.reflect.delete-property"]), + get: define("reflect/get", ["es.reflect.get"]), + getMetadata: define("reflect/get-metadata", ["esnext.reflect.get-metadata"]), + getMetadataKeys: define("reflect/get-metadata-keys", ["esnext.reflect.get-metadata-keys"]), + getOwnMetadata: define("reflect/get-own-metadata", ["esnext.reflect.get-own-metadata"]), + getOwnMetadataKeys: define("reflect/get-own-metadata-keys", ["esnext.reflect.get-own-metadata-keys"]), + getOwnPropertyDescriptor: define("reflect/get-own-property-descriptor", ["es.reflect.get-own-property-descriptor"]), + getPrototypeOf: define("reflect/get-prototype-of", ["es.reflect.get-prototype-of"]), + has: define("reflect/has", ["es.reflect.has"]), + hasMetadata: define("reflect/has-metadata", ["esnext.reflect.has-metadata"]), + hasOwnMetadata: define("reflect/has-own-metadata", ["esnext.reflect.has-own-metadata"]), + isExtensible: define("reflect/is-extensible", ["es.reflect.is-extensible"]), + metadata: define("reflect/metadata", ["esnext.reflect.metadata"]), + ownKeys: define("reflect/own-keys", ["es.reflect.own-keys"]), + preventExtensions: define("reflect/prevent-extensions", ["es.reflect.prevent-extensions"]), + set: define("reflect/set", ["es.reflect.set"]), + setPrototypeOf: define("reflect/set-prototype-of", ["es.reflect.set-prototype-of"]) + }, + RegExp: { + escape: define("regexp/escape", ["es.regexp.escape"]) + }, + Set: { + from: define("set/from", ["esnext.set.from", ...SetDependencies]), + of: define("set/of", ["esnext.set.of", ...SetDependencies]) + }, + String: { + cooked: define("string/cooked", ["esnext.string.cooked"]), + dedent: define("string/dedent", ["esnext.string.dedent", "es.string.from-code-point", "es.weak-map"]), + fromCodePoint: define("string/from-code-point", ["es.string.from-code-point"]), + raw: define("string/raw", ["es.string.raw"]) + }, + Symbol: { + asyncDispose: define("symbol/async-dispose", ["es.symbol.async-dispose", "es.async-iterator.async-dispose"]), + asyncIterator: define("symbol/async-iterator", ["es.symbol.async-iterator"]), + customMatcher: define("symbol/custom-matcher", ["esnext.symbol.custom-matcher"]), + dispose: define("symbol/dispose", ["es.symbol.dispose", "es.iterator.dispose"]), + for: define("symbol/for", [], "es.symbol"), + hasInstance: define("symbol/has-instance", ["es.symbol.has-instance", "es.function.has-instance"]), + isConcatSpreadable: define("symbol/is-concat-spreadable", ["es.symbol.is-concat-spreadable", "es.array.concat"]), + isRegistered: define("symbol/is-registered", ["esnext.symbol.is-registered", "es.symbol"]), + isRegisteredSymbol: define("symbol/is-registered-symbol", ["esnext.symbol.is-registered-symbol", "es.symbol"]), + isWellKnown: define("symbol/is-well-known", ["esnext.symbol.is-well-known", "es.symbol"]), + isWellKnownSymbol: define("symbol/is-well-known-symbol", ["esnext.symbol.is-well-known-symbol", "es.symbol"]), + iterator: define("symbol/iterator", ["es.symbol.iterator", ...CommonIteratorsWithTag]), + keyFor: define("symbol/key-for", [], "es.symbol"), + match: define("symbol/match", ["es.symbol.match", "es.string.match"]), + matcher: define("symbol/matcher", ["esnext.symbol.matcher"]), + matchAll: define("symbol/match-all", ["es.symbol.match-all", "es.string.match-all"]), + metadata: define("symbol/metadata", DecoratorMetadataDependencies), + metadataKey: define("symbol/metadata-key", ["esnext.symbol.metadata-key"]), + observable: define("symbol/observable", ["esnext.symbol.observable"]), + patternMatch: define("symbol/pattern-match", ["esnext.symbol.pattern-match"]), + replace: define("symbol/replace", ["es.symbol.replace", "es.string.replace"]), + search: define("symbol/search", ["es.symbol.search", "es.string.search"]), + species: define("symbol/species", ["es.symbol.species", "es.array.species"]), + split: define("symbol/split", ["es.symbol.split", "es.string.split"]), + toPrimitive: define("symbol/to-primitive", ["es.symbol.to-primitive", "es.date.to-primitive"]), + toStringTag: define("symbol/to-string-tag", ["es.symbol.to-string-tag", "es.object.to-string", "es.math.to-string-tag", "es.json.to-string-tag"]), + unscopables: define("symbol/unscopables", ["es.symbol.unscopables"]) + }, + URL: { + canParse: define("url/can-parse", ["web.url.can-parse", "web.url"]), + parse: define("url/parse", ["web.url.parse", "web.url"]) + }, + WeakMap: { + from: define("weak-map/from", ["esnext.weak-map.from", ...WeakMapDependencies]), + of: define("weak-map/of", ["esnext.weak-map.of", ...WeakMapDependencies]) + }, + WeakSet: { + from: define("weak-set/from", ["esnext.weak-set.from", ...WeakSetDependencies]), + of: define("weak-set/of", ["esnext.weak-set.of", ...WeakSetDependencies]) + }, + Int8Array: TypedArrayStaticMethods("es.typed-array.int8-array"), + Uint8Array: _extends({ + fromBase64: define(null, ["es.uint8-array.from-base64", ...TypedArrayDependencies]), + fromHex: define(null, ["es.uint8-array.from-hex", ...TypedArrayDependencies]) + }, TypedArrayStaticMethods("es.typed-array.uint8-array")), + Uint8ClampedArray: TypedArrayStaticMethods("es.typed-array.uint8-clamped-array"), + Int16Array: TypedArrayStaticMethods("es.typed-array.int16-array"), + Uint16Array: TypedArrayStaticMethods("es.typed-array.uint16-array"), + Int32Array: TypedArrayStaticMethods("es.typed-array.int32-array"), + Uint32Array: TypedArrayStaticMethods("es.typed-array.uint32-array"), + Float32Array: TypedArrayStaticMethods("es.typed-array.float32-array"), + Float64Array: TypedArrayStaticMethods("es.typed-array.float64-array"), + WebAssembly: { + CompileError: define(null, ErrorDependencies), + LinkError: define(null, ErrorDependencies), + RuntimeError: define(null, ErrorDependencies) + } +}; +["AggregateError", "EvalError", "RangeError", "ReferenceError", "SuppressedError", "SyntaxError", "TypeError", "URIError"].forEach(ERROR_SUBCLASS => { + StaticProperties[ERROR_SUBCLASS] = StaticProperties.Error; +}); +const InstanceProperties = exports.InstanceProperties = { + asIndexedPairs: define(null, ["esnext.async-iterator.as-indexed-pairs", ...AsyncIteratorDependencies, "esnext.iterator.as-indexed-pairs", ...IteratorDependencies]), + at: define("instance/at", [ + // TODO: We should introduce overloaded instance methods definition + // Before that is implemented, the `esnext.string.at` must be the first + // In pure mode, the provider resolves the descriptor as a "pure" `esnext.string.at` + // and treats the compat-data of `esnext.string.at` as the compat-data of + // pure import `instance/at`. The first polyfill here should have the lowest corejs + // supported versions. + "esnext.string.at", "es.string.at-alternative", "es.array.at"]), + anchor: define(null, ["es.string.anchor"]), + big: define(null, ["es.string.big"]), + bind: define("instance/bind", ["es.function.bind"]), + blink: define(null, ["es.string.blink"]), + bold: define(null, ["es.string.bold"]), + chunks: define(null, ["esnext.iterator.chunks", ...IteratorDependencies]), + clamp: define("instance/clamp", ["esnext.number.clamp"]), + codePointAt: define("instance/code-point-at", ["es.string.code-point-at"]), + codePoints: define("instance/code-points", ["esnext.string.code-points"]), + concat: define("instance/concat", ["es.array.concat"], undefined, ["String"]), + copyWithin: define("instance/copy-within", ["es.array.copy-within"]), + demethodize: define("instance/demethodize", ["esnext.function.demethodize"]), + description: define(null, ["es.symbol", "es.symbol.description"]), + dotAll: define(null, ["es.regexp.dot-all"]), + drop: define(null, ["es.iterator.drop", ...IteratorDependencies, "esnext.async-iterator.drop", ...AsyncIteratorDependencies]), + endsWith: define("instance/ends-with", ["es.string.ends-with"]), + entries: define("instance/entries", ArrayNatureIteratorsWithTag), + every: define("instance/every", ["es.array.every", "es.iterator.every", ...IteratorDependencies + // TODO: add async iterator dependencies when we support sub-dependencies + // esnext.async-iterator.every depends on es.promise + // but we don't want to pull es.promise when esnext.async-iterator is disabled + // + // "esnext.async-iterator.every", + // ...AsyncIteratorDependencies + ]), + exec: define(null, ["es.regexp.exec"]), + fill: define("instance/fill", ["es.array.fill"]), + filter: define("instance/filter", ["es.array.filter", "es.iterator.filter", ...IteratorDependencies + // "esnext.async-iterator.filter", + ]), + filterReject: define("instance/filter-reject", ["esnext.array.filter-reject"]), + finally: define(null, ["es.promise.finally", ...PromiseDependencies]), + find: define("instance/find", ["es.array.find", "es.iterator.find", ...IteratorDependencies + // "esnext.async-iterator.find", + ]), + findIndex: define("instance/find-index", ["es.array.find-index"]), + findLast: define("instance/find-last", ["es.array.find-last"]), + findLastIndex: define("instance/find-last-index", ["es.array.find-last-index"]), + fixed: define(null, ["es.string.fixed"]), + flags: define("instance/flags", ["es.regexp.flags"]), + flatMap: define("instance/flat-map", ["es.array.flat-map", "es.array.unscopables.flat-map", "es.iterator.flat-map", ...IteratorDependencies + // "esnext.async-iterator.flat-map", + ]), + flat: define("instance/flat", ["es.array.flat", "es.array.unscopables.flat"]), + getFloat16: define(null, ["es.data-view.get-float16", ...DataViewDependencies]), + getUint8Clamped: define(null, ["esnext.data-view.get-uint8-clamped", ...DataViewDependencies]), + getYear: define(null, ["es.date.get-year"]), + group: define("instance/group", ["esnext.array.group"]), + groupBy: define("instance/group-by", ["esnext.array.group-by"]), + groupByToMap: define("instance/group-by-to-map", ["esnext.array.group-by-to-map", "es.map", "es.object.to-string"]), + groupToMap: define("instance/group-to-map", ["esnext.array.group-to-map", "es.map", "es.object.to-string"]), + fontcolor: define(null, ["es.string.fontcolor"]), + fontsize: define(null, ["es.string.fontsize"]), + forEach: define("instance/for-each", ["es.array.for-each", "es.iterator.for-each", ...IteratorDependencies, + // "esnext.async-iterator.for-each", + "web.dom-collections.for-each"]), + includes: define("instance/includes", ["es.array.includes", "es.string.includes"]), + indexed: define(null, ["esnext.async-iterator.indexed", ...AsyncIteratorDependencies, "esnext.iterator.indexed", ...IteratorDependencies]), + indexOf: define("instance/index-of", ["es.array.index-of"]), + isWellFormed: define("instance/is-well-formed", ["es.string.is-well-formed"]), + italics: define(null, ["es.string.italics"]), + join: define(null, ["es.array.join"]), + keys: define("instance/keys", ArrayNatureIteratorsWithTag), + lastIndex: define(null, ["esnext.array.last-index"]), + lastIndexOf: define("instance/last-index-of", ["es.array.last-index-of"]), + lastItem: define(null, ["esnext.array.last-item"]), + link: define(null, ["es.string.link"]), + map: define("instance/map", ["es.array.map", "es.iterator.map", ...IteratorDependencies + // "esnext.async-iterator.map", + ]), + match: define(null, ["es.string.match", "es.regexp.exec"]), + matchAll: define("instance/match-all", ["es.string.match-all", "es.regexp.exec"]), + name: define(null, ["es.function.name"]), + padEnd: define("instance/pad-end", ["es.string.pad-end"]), + padStart: define("instance/pad-start", ["es.string.pad-start"]), + push: define("instance/push", ["es.array.push"]), + reduce: define("instance/reduce", ["es.array.reduce", "es.iterator.reduce", ...IteratorDependencies + // "esnext.async-iterator.reduce", + ]), + reduceRight: define("instance/reduce-right", ["es.array.reduce-right"]), + repeat: define("instance/repeat", ["es.string.repeat"]), + replace: define(null, ["es.string.replace", "es.regexp.exec"]), + replaceAll: define("instance/replace-all", ["es.string.replace-all", "es.string.replace", "es.regexp.exec"]), + reverse: define("instance/reverse", ["es.array.reverse"]), + search: define(null, ["es.string.search", "es.regexp.exec"]), + setFloat16: define(null, ["es.data-view.set-float16", ...DataViewDependencies]), + setUint8Clamped: define(null, ["esnext.data-view.set-uint8-clamped", ...DataViewDependencies]), + setYear: define(null, ["es.date.set-year"]), + slice: define("instance/slice", ["es.array.slice"]), + sliding: define(null, ["esnext.iterator.sliding", ...IteratorDependencies]), + small: define(null, ["es.string.small"]), + some: define("instance/some", ["es.array.some", "es.iterator.some", ...IteratorDependencies + // "esnext.async-iterator.some", + ]), + sort: define("instance/sort", ["es.array.sort"]), + splice: define("instance/splice", ["es.array.splice"]), + split: define(null, ["es.string.split", "es.regexp.exec"]), + startsWith: define("instance/starts-with", ["es.string.starts-with"]), + sticky: define(null, ["es.regexp.sticky"]), + strike: define(null, ["es.string.strike"]), + sub: define(null, ["es.string.sub"]), + substr: define(null, ["es.string.substr"]), + sup: define(null, ["es.string.sup"]), + take: define(null, ["es.iterator.take", ...IteratorDependencies, "esnext.async-iterator.take", ...AsyncIteratorDependencies]), + test: define(null, ["es.regexp.test", "es.regexp.exec"]), + toArray: define(null, ["es.iterator.to-array", ...IteratorDependencies, "esnext.async-iterator.to-array", ...AsyncIteratorDependencies]), + toAsync: define(null, ["esnext.iterator.to-async", ...IteratorDependencies, ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods]), + toExponential: define(null, ["es.number.to-exponential"]), + toFixed: define(null, ["es.number.to-fixed"]), + toGMTString: define(null, ["es.date.to-gmt-string"]), + toISOString: define(null, ["es.date.to-iso-string"]), + toJSON: define(null, ["es.date.to-json"]), + toPrecision: define(null, ["es.number.to-precision"]), + toReversed: define("instance/to-reversed", ["es.array.to-reversed"]), + toSorted: define("instance/to-sorted", ["es.array.to-sorted", "es.array.sort"]), + toSpliced: define("instance/to-spliced", ["es.array.to-spliced"]), + toString: define(null, ["es.object.to-string", "es.error.to-string", "es.date.to-string", "es.regexp.to-string"]), + toWellFormed: define("instance/to-well-formed", ["es.string.to-well-formed"]), + trim: define("instance/trim", ["es.string.trim"]), + trimEnd: define("instance/trim-end", ["es.string.trim-end"]), + trimLeft: define("instance/trim-left", ["es.string.trim-start"]), + trimRight: define("instance/trim-right", ["es.string.trim-end"]), + trimStart: define("instance/trim-start", ["es.string.trim-start"]), + uniqueBy: define("instance/unique-by", ["esnext.array.unique-by", "es.map"]), + unshift: define("instance/unshift", ["es.array.unshift"]), + unThis: define("instance/un-this", ["esnext.function.un-this"]), + values: define("instance/values", ArrayNatureIteratorsWithTag), + windows: define(null, ["esnext.iterator.windows", ...IteratorDependencies]), + with: define("instance/with", ["es.array.with"]), + __defineGetter__: define(null, ["es.object.define-getter"]), + __defineSetter__: define(null, ["es.object.define-setter"]), + __lookupGetter__: define(null, ["es.object.lookup-getter"]), + __lookupSetter__: define(null, ["es.object.lookup-setter"]), + ["__proto__"]: define(null, ["es.object.proto"]) +}; \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/index.js b/node_modules/babel-plugin-polyfill-corejs3/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ae34bf82b58d66d83885ec09dea6399a6daf24b1 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/index.js @@ -0,0 +1,309 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _data = _interopRequireDefault(require("../core-js-compat/data.js")); +var _shippedProposals = _interopRequireDefault(require("./shipped-proposals")); +var _getModulesListForTargetVersion = _interopRequireDefault(require("../core-js-compat/get-modules-list-for-target-version.js")); +var _builtInDefinitions = require("./built-in-definitions"); +var BabelRuntimePaths = _interopRequireWildcard(require("./babel-runtime-corejs3-paths")); +var _usageFilters = _interopRequireDefault(require("./usage-filters")); +var _babel = _interopRequireWildcard(require("@babel/core")); +var _utils = require("./utils"); +var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider")); +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const { + types: t, + template: template +} = _babel.default || _babel; +const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility"; +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +const uniqueObjects = ["array", "string", "iterator", "async-iterator", "dom-collections"].map(v => new RegExp(`[a-z]*\\.${v}\\..*`)); +const esnextFallback = (name, cb) => { + if (cb(name)) return true; + if (!name.startsWith("es.")) return false; + const fallback = `esnext.${name.slice(3)}`; + if (!_data.default[fallback]) return false; + return cb(fallback); +}; +var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(function ({ + getUtils, + method, + shouldInjectPolyfill, + createMetaResolver, + debug, + babel +}, { + version = 3, + proposals, + shippedProposals, + [presetEnvCompat]: { + noRuntimeName = false + } = {}, + [runtimeCompat]: { + useBabelRuntime = false, + ext = ".js" + } = {} +}) { + const isWebpack = babel.caller(caller => (caller == null ? void 0 : caller.name) === "babel-loader"); + const resolve = createMetaResolver({ + global: _builtInDefinitions.BuiltIns, + static: _builtInDefinitions.StaticProperties, + instance: _builtInDefinitions.InstanceProperties + }); + const available = new Set((0, _getModulesListForTargetVersion.default)(version)); + function getCoreJSPureBase(useProposalBase) { + return useBabelRuntime ? useProposalBase ? `${_utils.BABEL_RUNTIME}/core-js` : `${_utils.BABEL_RUNTIME}/core-js-stable` : useProposalBase ? "core-js-pure/features" : "core-js-pure/stable"; + } + function maybeInjectGlobalImpl(name, utils) { + if (shouldInjectPolyfill(name)) { + debug(name); + utils.injectGlobalImport((0, _utils.coreJSModule)(name), name); + return true; + } + return false; + } + function maybeInjectGlobal(names, utils, fallback = true) { + for (const name of names) { + if (fallback) { + esnextFallback(name, name => maybeInjectGlobalImpl(name, utils)); + } else { + maybeInjectGlobalImpl(name, utils); + } + } + } + function maybeInjectPure(desc, hint, utils, object) { + if (desc.pure && !(object && desc.exclude && desc.exclude.includes(object)) && esnextFallback(desc.name, shouldInjectPolyfill)) { + const { + name + } = desc; + let useProposalBase = false; + if (proposals || shippedProposals && name.startsWith("esnext.")) { + useProposalBase = true; + } else if (name.startsWith("es.") && !available.has(name)) { + useProposalBase = true; + } + if (useBabelRuntime && !(useProposalBase ? BabelRuntimePaths.proposals : BabelRuntimePaths.stable).has(desc.pure)) { + return; + } + const coreJSPureBase = getCoreJSPureBase(useProposalBase); + return utils.injectDefaultImport(`${coreJSPureBase}/${desc.pure}${ext}`, hint); + } + } + function isFeatureStable(name) { + if (name.startsWith("esnext.")) { + const esName = `es.${name.slice(7)}`; + // If its imaginative esName is not in latest compat data, it means + // the proposal is not stage 4 + return esName in _data.default; + } + return true; + } + return { + name: "corejs3", + runtimeName: noRuntimeName ? null : _utils.BABEL_RUNTIME, + polyfills: _data.default, + filterPolyfills(name) { + if (!available.has(name)) return false; + if (proposals || method === "entry-global") return true; + if (shippedProposals && _shippedProposals.default.has(name)) { + return true; + } + return isFeatureStable(name); + }, + entryGlobal(meta, utils, path) { + if (meta.kind !== "import") return; + const modules = (0, _utils.isCoreJSSource)(meta.source); + if (!modules) return; + if (modules.length === 1 && meta.source === (0, _utils.coreJSModule)(modules[0]) && shouldInjectPolyfill(modules[0])) { + // Avoid infinite loop: do not replace imports with a new copy of + // themselves. + debug(null); + return; + } + const modulesSet = new Set(modules); + const filteredModules = modules.filter(module => { + if (!module.startsWith("esnext.")) return true; + const stable = module.replace("esnext.", "es."); + if (modulesSet.has(stable) && shouldInjectPolyfill(stable)) { + return false; + } + return true; + }); + maybeInjectGlobal(filteredModules, utils, false); + path.remove(); + }, + usageGlobal(meta, utils, path) { + const resolved = resolve(meta); + if (!resolved) return; + if ((0, _usageFilters.default)(resolved.desc, path)) return; + let deps = resolved.desc.global; + if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") { + const low = meta.object.toLowerCase(); + deps = deps.filter(m => uniqueObjects.some(v => v.test(m)) ? m.includes(low) : true); + } + maybeInjectGlobal(deps, utils); + return true; + }, + usagePure(meta, utils, path) { + if (meta.kind === "in") { + if (meta.key === "Symbol.iterator") { + path.replaceWith(t.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("is-iterable", useBabelRuntime, ext), "isIterable"), [path.node.right] // meta.kind === "in" narrows this + )); + } + return; + } + if (path.parentPath.isUnaryExpression({ + operator: "delete" + })) return; + if (meta.kind === "property") { + // We can't compile destructuring and updateExpression. + if (!path.isMemberExpression() && !path.isOptionalMemberExpression()) { + return; + } + if (!path.isReferenced()) return; + if (path.parentPath.isUpdateExpression()) return; + if (t.isSuper(path.node.object)) { + return; + } + if (meta.key === "Symbol.iterator") { + if (!shouldInjectPolyfill("es.symbol.iterator")) return; + const { + parent, + node + } = path; + if (t.isCallExpression(parent, { + callee: node + })) { + if (parent.arguments.length === 0) { + path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator", useBabelRuntime, ext), "getIterator"), [node.object])); + path.skip(); + } else { + (0, _utils.callMethod)(path, utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod")); + } + } else { + path.replaceWith(t.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod"), [path.node.object])); + } + return; + } + } + let resolved = resolve(meta); + if (!resolved) return; + if ((0, _usageFilters.default)(resolved.desc, path)) return; + if (useBabelRuntime && resolved.desc.pure && resolved.desc.pure.slice(-6) === "/index") { + // Remove /index, since it doesn't exist in @babel/runtime-corejs3s + resolved = _extends({}, resolved, { + desc: _extends({}, resolved.desc, { + pure: resolved.desc.pure.slice(0, -6) + }) + }); + } + if (resolved.kind === "global") { + const id = maybeInjectPure(resolved.desc, resolved.name, utils); + if (id) path.replaceWith(id); + } else if (resolved.kind === "static") { + const id = maybeInjectPure(resolved.desc, resolved.name, utils, + // @ts-expect-error + meta.object); + if (id) { + path.replaceWith(id); + let { + parentPath + } = path; + if (parentPath.isOptionalMemberExpression() || parentPath.isOptionalCallExpression()) { + do { + const parentAsNotOptional = parentPath; + parentAsNotOptional.type = parentAsNotOptional.node.type = parentPath.type === "OptionalMemberExpression" ? "MemberExpression" : "CallExpression"; + delete parentAsNotOptional.node.optional; + ({ + parentPath + } = parentPath); + } while ((parentPath.isOptionalMemberExpression() || parentPath.isOptionalCallExpression()) && !parentPath.node.optional); + } + } + } else if (resolved.kind === "instance") { + const id = maybeInjectPure(resolved.desc, `${resolved.name}InstanceProperty`, utils, + // @ts-expect-error + meta.object); + if (!id) return; + const { + node, + parent + } = path; + if (t.isOptionalCallExpression(parent) && parent.callee === node) { + const wasOptional = parent.optional; + parent.optional = !wasOptional; + if (!wasOptional) { + const check = (0, _utils.extractOptionalCheck)(path.scope, node); + const [thisArg, thisArg2] = (0, _utils.maybeMemoizeContext)(node, path.scope); + path.replaceWith(check(template.expression.ast` + Function.call.bind(${id}(${thisArg}), ${thisArg2}) + `)); + } else if (t.isOptionalMemberExpression(node)) { + const check = (0, _utils.extractOptionalCheck)(path.scope, node); + (0, _utils.callMethod)(path, id, true, check); + } else { + (0, _utils.callMethod)(path, id, true); + } + } else if (t.isCallExpression(parent) && parent.callee === node) { + (0, _utils.callMethod)(path, id, false); + } else if (t.isOptionalMemberExpression(node)) { + const check = (0, _utils.extractOptionalCheck)(path.scope, node); + path.replaceWith(check(t.callExpression(id, [node.object]))); + if (t.isOptionalMemberExpression(parent)) parent.optional = true; + } else { + path.replaceWith(t.callExpression(id, [node.object])); + } + } + }, + visitor: method === "usage-global" && { + // import("foo") + CallExpression(path) { + if (path.get("callee").isImport()) { + const utils = getUtils(path); + if (isWebpack) { + // Webpack uses Promise.all to handle dynamic import. + maybeInjectGlobal(_builtInDefinitions.PromiseDependenciesWithIterators, utils); + } else { + maybeInjectGlobal(_builtInDefinitions.PromiseDependencies, utils); + } + } + }, + // (async function () { }).finally(...) + Function(path) { + if (path.node.async) { + maybeInjectGlobal(_builtInDefinitions.PromiseDependencies, getUtils(path)); + } + }, + // for-of, [a, b] = c + "ForOfStatement|ArrayPattern"(path) { + maybeInjectGlobal(_builtInDefinitions.CommonIterators, getUtils(path)); + }, + // [...spread] + SpreadElement(path) { + if (!path.parentPath.isObjectExpression()) { + maybeInjectGlobal(_builtInDefinitions.CommonIterators, getUtils(path)); + } + }, + // yield* + YieldExpression(path) { + if (path.node.delegate) { + maybeInjectGlobal(_builtInDefinitions.CommonIterators, getUtils(path)); + } + }, + // Decorators metadata + Class(path) { + var _path$node$decorators; + const hasDecorators = ((_path$node$decorators = path.node.decorators) == null ? void 0 : _path$node$decorators.length) || path.node.body.body.some(el => { + var _decorators; + return (_decorators = el.decorators) == null ? void 0 : _decorators.length; + }); + if (hasDecorators) { + maybeInjectGlobal(_builtInDefinitions.DecoratorMetadataDependencies, getUtils(path)); + } + } + } + }; +}); \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js b/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js new file mode 100644 index 0000000000000000000000000000000000000000..34cefc6d294698a0e7a5dbfac2a2996ca32a86e9 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js @@ -0,0 +1,6 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +// This file is automatically generated by scripts/build-corejs3-shipped-proposals.mjs +var _default = exports.default = new Set(["esnext.array.group", "esnext.array.group-to-map", "esnext.iterator.zip", "esnext.iterator.zip-keyed", "esnext.symbol.metadata"]); \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/usage-filters.js b/node_modules/babel-plugin-polyfill-corejs3/lib/usage-filters.js new file mode 100644 index 0000000000000000000000000000000000000000..0a397e60c94239196f3ed5f859c5f99c0ec9406d --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/usage-filters.js @@ -0,0 +1,26 @@ +"use strict"; + +exports.__esModule = true; +exports.default = canSkipPolyfill; +var _babel = _interopRequireWildcard(require("@babel/core")); +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } +const { + types: t +} = _babel.default || _babel; +function canSkipPolyfill(desc, path) { + const { + node, + parent + } = path; + switch (desc.name) { + case "es.string.split": + { + if (!t.isCallExpression(parent, { + callee: node + })) return false; + if (parent.arguments.length < 1) return true; + const splitter = parent.arguments[0]; + return t.isStringLiteral(splitter) || t.isTemplateLiteral(splitter); + } + } +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/utils.js b/node_modules/babel-plugin-polyfill-corejs3/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..67c7e79df81d7947cdff588693ba4eec563759f6 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/utils.js @@ -0,0 +1,63 @@ +"use strict"; + +exports.__esModule = true; +exports.BABEL_RUNTIME = void 0; +exports.callMethod = callMethod; +exports.coreJSModule = coreJSModule; +exports.coreJSPureHelper = coreJSPureHelper; +exports.extractOptionalCheck = extractOptionalCheck; +exports.isCoreJSSource = isCoreJSSource; +exports.maybeMemoizeContext = maybeMemoizeContext; +var _babel = _interopRequireWildcard(require("@babel/core")); +var _entries = _interopRequireDefault(require("../core-js-compat/entries.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } +const { + types: t +} = _babel.default || _babel; +const BABEL_RUNTIME = exports.BABEL_RUNTIME = "@babel/runtime-corejs3"; +function callMethod(path, id, optionalCall, wrapCallee) { + const [context1, context2] = maybeMemoizeContext(path.node, path.scope); + let callee = t.callExpression(id, [context1]); + if (wrapCallee) callee = wrapCallee(callee); + const call = t.identifier("call"); + path.replaceWith(optionalCall ? t.optionalMemberExpression(callee, call, false, true) : t.memberExpression(callee, call)); + path.parentPath.unshiftContainer("arguments", context2); +} +function maybeMemoizeContext(node, scope) { + const { + object + } = node; + let context1, context2; + if (t.isIdentifier(object)) { + context2 = object; + context1 = t.cloneNode(object); + } else { + context2 = scope.generateDeclaredUidIdentifier("context"); + context1 = t.assignmentExpression("=", t.cloneNode(context2), object); + } + return [context1, context2]; +} +function extractOptionalCheck(scope, node) { + let optionalNode = node; + while (!optionalNode.optional && t.isOptionalMemberExpression(optionalNode.object)) { + optionalNode = optionalNode.object; + } + optionalNode.optional = false; + const ctx = scope.generateDeclaredUidIdentifier("context"); + const assign = t.assignmentExpression("=", ctx, optionalNode.object); + optionalNode.object = t.cloneNode(ctx); + return ifNotNullish => t.conditionalExpression(t.binaryExpression("==", assign, t.nullLiteral()), t.unaryExpression("void", t.numericLiteral(0)), ifNotNullish); +} +function isCoreJSSource(source) { + if (typeof source === "string") { + source = source.replace(/\\/g, "/").replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase(); + } + return Object.prototype.hasOwnProperty.call(_entries.default, source) && _entries.default[source]; +} +function coreJSModule(name) { + return `core-js/modules/${name}.js`; +} +function coreJSPureHelper(name, useBabelRuntime, ext) { + return useBabelRuntime ? `${BABEL_RUNTIME}/core-js/${name}${ext}` : `core-js-pure/features/${name}.js`; +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-corejs3/package.json b/node_modules/babel-plugin-polyfill-corejs3/package.json new file mode 100644 index 0000000000000000000000000000000000000000..590a5f61875abc9e4703438421ddd9b8e0ebfa90 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-corejs3/package.json @@ -0,0 +1,49 @@ +{ + "name": "babel-plugin-polyfill-corejs3", + "version": "0.14.2", + "description": "A Babel plugin to inject imports to core-js@3 polyfills", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel-polyfills.git", + "directory": "packages/babel-plugin-polyfill-corejs3" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "exports": { + ".": [ + { + "import": "./esm/index.mjs", + "default": "./lib/index.js" + }, + "./lib/index.js" + ], + "./package.json": "./package.json" + }, + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8", + "core-js-compat": "^3.48.0" + }, + "devDependencies": { + "@babel/core": "^7.28.6", + "@babel/helper-plugin-test-runner": "^7.27.1", + "@babel/plugin-proposal-decorators": "^7.28.6", + "@babel/plugin-transform-class-properties": "^7.28.6", + "@babel/plugin-transform-classes": "^7.28.6", + "@babel/plugin-transform-for-of": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.28.6", + "@babel/plugin-transform-runtime": "^7.28.5", + "@babel/plugin-transform-spread": "^7.28.6", + "core-js": "^3.48.0", + "core-js-pure": "^3.48.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + }, + "gitHead": "86eff78e98adc17cdf0eb9ba4d94140eb7cb0da0" +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-regenerator/LICENSE b/node_modules/babel-plugin-polyfill-regenerator/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b74971fede812cae3d1b3d7db474db739fac2d53 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Nicolò Ribaudo and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/babel-plugin-polyfill-regenerator/README.md b/node_modules/babel-plugin-polyfill-regenerator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e40b692e6e395c500a60510843ed4d07a9cc0089 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/README.md @@ -0,0 +1,28 @@ +# babel-plugin-polyfill-regenerator + +## Install + +Using npm: + +```sh +npm install --save-dev babel-plugin-polyfill-regenerator +``` + +or using yarn: + +```sh +yarn add babel-plugin-polyfill-regenerator --dev +``` + +## Usage + +Add this plugin to your Babel configuration: + +```json +{ + "plugins": [["polyfill-regenerator", { "method": "usage-global" }]] +} +``` + +This package supports the `usage-pure`, `usage-global`, and `entry-global` methods. +When `entry-global` is used, it replaces imports to `regenerator-runtime`. diff --git a/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs b/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bfaf2150eaf5fe8eaf244f3dfa65c6f1f3e9069a --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs @@ -0,0 +1,46 @@ +import defineProvider from '@babel/helper-define-polyfill-provider'; + +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +var index = defineProvider(({ + debug, + targets, + babel +}, options) => { + if (!shallowEqual(targets, babel.targets())) { + throw new Error("This plugin does not use the targets option. Only preset-env's targets" + " or top-level targets need to be configured for this plugin to work." + " See https://github.com/babel/babel-polyfills/issues/36 for more" + " details."); + } + const { + [runtimeCompat]: { + moduleName = null, + useBabelRuntime = false + } = {} + } = options; + return { + name: "regenerator", + polyfills: ["regenerator-runtime"], + usageGlobal(meta, utils) { + if (isRegenerator(meta)) { + debug("regenerator-runtime"); + utils.injectGlobalImport("regenerator-runtime/runtime.js"); + } + }, + usagePure(meta, utils, path) { + if (isRegenerator(meta)) { + let pureName = "regenerator-runtime"; + if (useBabelRuntime) { + var _ref; + const runtimeName = (_ref = moduleName != null ? moduleName : path.hub.file.get("runtimeHelpersModuleName")) != null ? _ref : "@babel/runtime"; + pureName = `${runtimeName}/regenerator`; + } + path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime")); + } + } + }; +}); +const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime"; +function shallowEqual(obj1, obj2) { + return JSON.stringify(obj1) === JSON.stringify(obj2); +} + +export { index as default }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs.map b/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..28c7e8f1fd42feac66a02fcda7c55381940c8271 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import defineProvider from \"@babel/helper-define-polyfill-provider\";\nimport type { PluginPass } from \"@babel/core\";\n\nconst runtimeCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\ntype Options = {\n \"#__secret_key__@babel/runtime__compatibility\": void | {\n useBabelRuntime: boolean;\n moduleName: string;\n };\n};\n\nexport default defineProvider(({ debug, targets, babel }, options) => {\n if (!shallowEqual(targets, babel.targets())) {\n throw new Error(\n \"This plugin does not use the targets option. Only preset-env's targets\" +\n \" or top-level targets need to be configured for this plugin to work.\" +\n \" See https://github.com/babel/babel-polyfills/issues/36 for more\" +\n \" details.\",\n );\n }\n\n const {\n [runtimeCompat]: { moduleName = null, useBabelRuntime = false } = {},\n } = options;\n\n return {\n name: \"regenerator\",\n\n polyfills: [\"regenerator-runtime\"],\n\n usageGlobal(meta, utils): undefined {\n if (isRegenerator(meta)) {\n debug(\"regenerator-runtime\");\n utils.injectGlobalImport(\"regenerator-runtime/runtime.js\");\n }\n },\n usagePure(meta, utils, path) {\n if (isRegenerator(meta)) {\n let pureName = \"regenerator-runtime\";\n if (useBabelRuntime) {\n const runtimeName =\n moduleName ??\n ((path.hub as any).file as PluginPass).get(\n \"runtimeHelpersModuleName\",\n ) ??\n \"@babel/runtime\";\n pureName = `${runtimeName}/regenerator`;\n }\n\n path.replaceWith(\n utils.injectDefaultImport(pureName, \"regenerator-runtime\"),\n );\n }\n },\n };\n});\n\nconst isRegenerator = meta =>\n meta.kind === \"global\" && meta.name === \"regeneratorRuntime\";\n\nfunction shallowEqual(obj1: any, obj2: any) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}\n"],"names":["runtimeCompat","defineProvider","debug","targets","babel","options","shallowEqual","Error","moduleName","useBabelRuntime","name","polyfills","usageGlobal","meta","utils","isRegenerator","injectGlobalImport","usagePure","path","pureName","_ref","runtimeName","hub","file","get","replaceWith","injectDefaultImport","kind","obj1","obj2","JSON","stringify"],"mappings":";;AAGA,MAAMA,aAAa,GAAG,8CAA8C,CAAA;AASpE,YAAeC,cAAc,CAAU,CAAC;EAAEC,KAAK;EAAEC,OAAO;AAAEC,EAAAA,KAAAA;AAAM,CAAC,EAAEC,OAAO,KAAK;EAC7E,IAAI,CAACC,YAAY,CAACH,OAAO,EAAEC,KAAK,CAACD,OAAO,EAAE,CAAC,EAAE;IAC3C,MAAM,IAAII,KAAK,CACb,wEAAwE,GACtE,sEAAsE,GACtE,kEAAkE,GAClE,WACJ,CAAC,CAAA;AACH,GAAA;EAEA,MAAM;AACJ,IAAA,CAACP,aAAa,GAAG;AAAEQ,MAAAA,UAAU,GAAG,IAAI;AAAEC,MAAAA,eAAe,GAAG,KAAA;AAAM,KAAC,GAAG,EAAC;AACrE,GAAC,GAAGJ,OAAO,CAAA;EAEX,OAAO;AACLK,IAAAA,IAAI,EAAE,aAAa;IAEnBC,SAAS,EAAE,CAAC,qBAAqB,CAAC;AAElCC,IAAAA,WAAWA,CAACC,IAAI,EAAEC,KAAK,EAAa;AAClC,MAAA,IAAIC,aAAa,CAACF,IAAI,CAAC,EAAE;QACvBX,KAAK,CAAC,qBAAqB,CAAC,CAAA;AAC5BY,QAAAA,KAAK,CAACE,kBAAkB,CAAC,gCAAgC,CAAC,CAAA;AAC5D,OAAA;KACD;AACDC,IAAAA,SAASA,CAACJ,IAAI,EAAEC,KAAK,EAAEI,IAAI,EAAE;AAC3B,MAAA,IAAIH,aAAa,CAACF,IAAI,CAAC,EAAE;QACvB,IAAIM,QAAQ,GAAG,qBAAqB,CAAA;AACpC,QAAA,IAAIV,eAAe,EAAE;AAAA,UAAA,IAAAW,IAAA,CAAA;UACnB,MAAMC,WAAW,IAAAD,IAAA,GACfZ,UAAU,IAAVA,IAAAA,GAAAA,UAAU,GACRU,IAAI,CAACI,GAAG,CAASC,IAAI,CAAgBC,GAAG,CACxC,0BACF,CAAC,KAAA,IAAA,GAAAJ,IAAA,GACD,gBAAgB,CAAA;UAClBD,QAAQ,GAAG,CAAGE,EAAAA,WAAW,CAAc,YAAA,CAAA,CAAA;AACzC,SAAA;QAEAH,IAAI,CAACO,WAAW,CACdX,KAAK,CAACY,mBAAmB,CAACP,QAAQ,EAAE,qBAAqB,CAC3D,CAAC,CAAA;AACH,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAMJ,aAAa,GAAGF,IAAI,IACxBA,IAAI,CAACc,IAAI,KAAK,QAAQ,IAAId,IAAI,CAACH,IAAI,KAAK,oBAAoB,CAAA;AAE9D,SAASJ,YAAYA,CAACsB,IAAS,EAAEC,IAAS,EAAE;AAC1C,EAAA,OAAOC,IAAI,CAACC,SAAS,CAACH,IAAI,CAAC,KAAKE,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC,CAAA;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-regenerator/lib/index.js b/node_modules/babel-plugin-polyfill-regenerator/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bee8bfa246d68d71e5b8dda486d0a080ab3fe9cc --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/lib/index.js @@ -0,0 +1,47 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; +var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; +var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(({ + debug, + targets, + babel +}, options) => { + if (!shallowEqual(targets, babel.targets())) { + throw new Error("This plugin does not use the targets option. Only preset-env's targets" + " or top-level targets need to be configured for this plugin to work." + " See https://github.com/babel/babel-polyfills/issues/36 for more" + " details."); + } + const { + [runtimeCompat]: { + moduleName = null, + useBabelRuntime = false + } = {} + } = options; + return { + name: "regenerator", + polyfills: ["regenerator-runtime"], + usageGlobal(meta, utils) { + if (isRegenerator(meta)) { + debug("regenerator-runtime"); + utils.injectGlobalImport("regenerator-runtime/runtime.js"); + } + }, + usagePure(meta, utils, path) { + if (isRegenerator(meta)) { + let pureName = "regenerator-runtime"; + if (useBabelRuntime) { + var _ref; + const runtimeName = (_ref = moduleName != null ? moduleName : path.hub.file.get("runtimeHelpersModuleName")) != null ? _ref : "@babel/runtime"; + pureName = `${runtimeName}/regenerator`; + } + path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime")); + } + } + }; +}); +const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime"; +function shallowEqual(obj1, obj2) { + return JSON.stringify(obj1) === JSON.stringify(obj2); +} \ No newline at end of file diff --git a/node_modules/babel-plugin-polyfill-regenerator/package.json b/node_modules/babel-plugin-polyfill-regenerator/package.json new file mode 100644 index 0000000000000000000000000000000000000000..937b5557a03ea9680cc0c2f517dfe053800f2970 --- /dev/null +++ b/node_modules/babel-plugin-polyfill-regenerator/package.json @@ -0,0 +1,41 @@ +{ + "name": "babel-plugin-polyfill-regenerator", + "version": "0.6.8", + "description": "A Babel plugin to inject imports to regenerator-runtime", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel-polyfills.git", + "directory": "packages/babel-plugin-polyfill-regenerator" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "exports": { + ".": [ + { + "import": "./esm/index.mjs", + "default": "./lib/index.js" + }, + "./lib/index.js" + ], + "./package.json": "./package.json" + }, + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8" + }, + "devDependencies": { + "@babel/core": "^7.28.6", + "@babel/helper-plugin-test-runner": "^7.27.1", + "@babel/plugin-transform-regenerator": "~7.14.5", + "regenerator-runtime": "^0.14.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + }, + "gitHead": "86eff78e98adc17cdf0eb9ba4d94140eb7cb0da0" +} \ No newline at end of file diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..cea8b16e9edc40b78b839e97f7d4b174ada0b41f --- /dev/null +++ b/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: "npm/balanced-match" +patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2cdc8e4148cc0aa1f788b25dbec4b22878644cdf --- /dev/null +++ b/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d2a48b6b49f2cf17358262f911b997121d1c2a31 --- /dev/null +++ b/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c67a64608df7f4d8e126c0a8eff2cc4a3d837e71 --- /dev/null +++ b/node_modules/balanced-match/index.js @@ -0,0 +1,62 @@ +'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); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + 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); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + 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; +} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ce6073e0403b5a9aeef19a91624ad0256f5e61b8 --- /dev/null +++ b/node_modules/balanced-match/package.json @@ -0,0 +1,48 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "1.0.2", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "tape test/test.js", + "bench": "matcha test/bench.js" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/base64-arraybuffer/CHANGELOG.md b/node_modules/base64-arraybuffer/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..ba33f2338abc3ead2c7579f61ef5340b4a3ff6b7 --- /dev/null +++ b/node_modules/base64-arraybuffer/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [1.0.2](https://github.com/niklasvh/base64-arraybuffer/compare/v1.0.1...v1.0.2) (2022-01-22) + + +### fix + +* source maps (#33) ([bd5a8ef](https://github.com/niklasvh/base64-arraybuffer/commit/bd5a8eff3a44ea07f9b68533c477076124220ddd)), closes [#33](https://github.com/niklasvh/base64-arraybuffer/issues/33) + + + +## [1.0.1](https://github.com/niklasvh/base64-arraybuffer/compare/v1.0.0...v1.0.1) (2021-08-10) + + +### fix + +* make lib loadable on ie9 (#30) ([a618d14](https://github.com/niklasvh/base64-arraybuffer/commit/a618d14d323f4eb230321a3609bfbc9f23f430c0)), closes [#30](https://github.com/niklasvh/base64-arraybuffer/issues/30) + + + +# [1.0.0](https://github.com/niklasvh/base64-arraybuffer/compare/v0.2.0...v1.0.0) (2021-08-10) + + +### docs + +* update readme (#29) ([0a0253d](https://github.com/niklasvh/base64-arraybuffer/commit/0a0253dcc2e3f01a1f6d04fa81d578f714fce27f)), closes [#29](https://github.com/niklasvh/base64-arraybuffer/issues/29) diff --git a/node_modules/base64-arraybuffer/LICENSE b/node_modules/base64-arraybuffer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ed27b41b252ac2adbbbb3dfd6606a32c972948e9 --- /dev/null +++ b/node_modules/base64-arraybuffer/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 Niklas von Hertzen + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/base64-arraybuffer/README.md b/node_modules/base64-arraybuffer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4d6ae71c799f1a2d0a3c1ab5ba8ccc06e841fc78 --- /dev/null +++ b/node_modules/base64-arraybuffer/README.md @@ -0,0 +1,27 @@ +# base64-arraybuffer + +![CI](https://github.com/niklasvh/base64-arraybuffer/workflows/CI/badge.svg?branch=master) +[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) +[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) + +Encode/decode base64 data into ArrayBuffers + +### Installing +You can install the module via npm: + + npm install base64-arraybuffer + +## API +The library encodes and decodes base64 to and from ArrayBuffers + + - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string + - __decode(str)__ - Decodes base64 string to `ArrayBuffer` + +### Testing +You can run the test suite with: + + npm test + +## License +Copyright (c) 2012 Niklas von Hertzen +Licensed under the MIT license. diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js new file mode 100644 index 0000000000000000000000000000000000000000..1480c59109e453210743296eafbc11597d525ecb --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js @@ -0,0 +1,50 @@ +/* + * base64-arraybuffer 1.0.2 + * Copyright (c) 2022 Niklas von Hertzen + * Released under MIT License + */ +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +// Use a lookup table to find the index. +var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); +for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; +} +var encode = function (arraybuffer) { + var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; + for (i = 0; i < len; i += 3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + if (len % 3 === 2) { + base64 = base64.substring(0, base64.length - 1) + '='; + } + else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + '=='; + } + return base64; +}; +var decode = function (base64) { + var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; + if (base64[base64.length - 1] === '=') { + bufferLength--; + if (base64[base64.length - 2] === '=') { + bufferLength--; + } + } + var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); + for (i = 0; i < len; i += 4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i + 1)]; + encoded3 = lookup[base64.charCodeAt(i + 2)]; + encoded4 = lookup[base64.charCodeAt(i + 3)]; + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + return arraybuffer; +}; + +export { decode, encode }; +//# sourceMappingURL=base64-arraybuffer.es5.js.map diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c5fecca686a20ed401ae4c811530a53e28202b95 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base64-arraybuffer.es5.js","sources":["../../src/index.ts"],"sourcesContent":["const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};\n"],"names":[],"mappings":";;;;;AAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;AAEjF;AACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnC;IAEY,MAAM,GAAG,UAAC,WAAwB;IAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;KACtC;IAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;KAC1D;IAED,OAAO,MAAM,CAAC;AAClB,EAAE;IAEW,MAAM,GAAG,UAAC,MAAc;IACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;IAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,YAAY,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;SAClB;KACJ;IAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;KACxD;IAED,OAAO,WAAW,CAAC;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..a3b1be44989e0e523b5915df82a308882bdfbb61 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js @@ -0,0 +1,61 @@ +/* + * base64-arraybuffer 1.0.2 + * Copyright (c) 2022 Niklas von Hertzen + * Released under MIT License + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['base64-arraybuffer'] = {})); +}(this, (function (exports) { 'use strict'; + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + // Use a lookup table to find the index. + var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + var encode = function (arraybuffer) { + var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; + for (i = 0; i < len; i += 3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + if (len % 3 === 2) { + base64 = base64.substring(0, base64.length - 1) + '='; + } + else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + '=='; + } + return base64; + }; + var decode = function (base64) { + var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; + if (base64[base64.length - 1] === '=') { + bufferLength--; + if (base64[base64.length - 2] === '=') { + bufferLength--; + } + } + var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); + for (i = 0; i < len; i += 4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i + 1)]; + encoded3 = lookup[base64.charCodeAt(i + 2)]; + encoded4 = lookup[base64.charCodeAt(i + 3)]; + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + return arraybuffer; + }; + + exports.decode = decode; + exports.encode = encode; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=base64-arraybuffer.umd.js.map diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..916fc2d0f26a5aac468e4067859d6866c0ba6172 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base64-arraybuffer.umd.js","sources":["../../src/index.ts"],"sourcesContent":["const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};\n"],"names":[],"mappings":";;;;;;;;;;;IAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;IAEjF;IACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;QAEY,MAAM,GAAG,UAAC,WAAwB;QAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;SACtC;QAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACzD;aAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SAC1D;QAED,OAAO,MAAM,CAAC;IAClB,EAAE;QAEW,MAAM,GAAG,UAAC,MAAc;QACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;QAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;gBACnC,YAAY,EAAE,CAAC;aAClB;SACJ;QAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;QAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,WAAW,CAAC;IACvB;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/base64-arraybuffer/dist/lib/index.js b/node_modules/base64-arraybuffer/dist/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..79fa4b701f1479a6e7bb8135e1add50124637647 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/lib/index.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decode = exports.encode = void 0; +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +// Use a lookup table to find the index. +var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); +for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; +} +var encode = function (arraybuffer) { + var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; + for (i = 0; i < len; i += 3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + if (len % 3 === 2) { + base64 = base64.substring(0, base64.length - 1) + '='; + } + else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + '=='; + } + return base64; +}; +exports.encode = encode; +var decode = function (base64) { + var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; + if (base64[base64.length - 1] === '=') { + bufferLength--; + if (base64[base64.length - 2] === '=') { + bufferLength--; + } + } + var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); + for (i = 0; i < len; i += 4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i + 1)]; + encoded3 = lookup[base64.charCodeAt(i + 2)]; + encoded4 = lookup[base64.charCodeAt(i + 3)]; + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + return arraybuffer; +}; +exports.decode = decode; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/base64-arraybuffer/dist/lib/index.js.map b/node_modules/base64-arraybuffer/dist/lib/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1bcc5a88c0e82d530cdf2f0229e84f99456b2343 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;AAEjF,wCAAwC;AACxC,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnC;AAEM,IAAM,MAAM,GAAG,UAAC,WAAwB;IAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;KACtC;IAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;KAC1D;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AApBW,QAAA,MAAM,UAoBjB;AAEK,IAAM,MAAM,GAAG,UAAC,MAAc;IACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;IAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,YAAY,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;SAClB;KACJ;IAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;QAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;KACxD;IAED,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AAhCW,QAAA,MAAM,UAgCjB"} \ No newline at end of file diff --git a/node_modules/base64-arraybuffer/dist/types/index.d.ts b/node_modules/base64-arraybuffer/dist/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e0fa6bc7b46dfcf8f99d2286c0da70a87948fe5 --- /dev/null +++ b/node_modules/base64-arraybuffer/dist/types/index.d.ts @@ -0,0 +1,2 @@ +export declare const encode: (arraybuffer: ArrayBuffer) => string; +export declare const decode: (base64: string) => ArrayBuffer; diff --git a/node_modules/base64-arraybuffer/package.json b/node_modules/base64-arraybuffer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2e3967c8d762a7b122375650b51e5259c0f606b1 --- /dev/null +++ b/node_modules/base64-arraybuffer/package.json @@ -0,0 +1,54 @@ +{ + "name": "base64-arraybuffer", + "description": "Encode/decode base64 data into ArrayBuffers", + "main": "dist/base64-arraybuffer.umd.js", + "module": "dist/base64-arraybuffer.es5.js", + "typings": "dist/types/index.d.ts", + "version": "1.0.2", + "homepage": "https://github.com/niklasvh/base64-arraybuffer", + "author": { + "name": "Niklas von Hertzen", + "email": "niklasvh@gmail.com", + "url": "https://hertzen.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/niklasvh/base64-arraybuffer" + }, + "bugs": { + "url": "https://github.com/niklasvh/base64-arraybuffer/issues" + }, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "scripts": { + "prebuild": "rimraf dist/", + "build": "tsc --module commonjs && rollup -c rollup.config.ts", + "format": "prettier --write \"{src,test}/**/*.ts\"", + "lint": "tslint -c tslint.json --project tsconfig.json -t codeFrame src/**/*.ts test/**/*.ts", + "mocha": "mocha --require ts-node/register test/*.ts", + "test": "npm run lint && npm run mocha", + "release": "standard-version" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^19.0.0", + "@rollup/plugin-node-resolve": "^13.0.0", + "@rollup/plugin-typescript": "^8.2.1", + "@types/mocha": "^8.2.2", + "@types/node": "^16.0.0", + "mocha": "9.0.2", + "prettier": "^2.3.2", + "rimraf": "3.0.2", + "rollup": "^2.52.7", + "rollup-plugin-json": "^4.0.0", + "rollup-plugin-sourcemaps": "^0.6.3", + "standard-version": "^9.3.0", + "ts-node": "^10.0.0", + "tslib": "^2.3.0", + "tslint": "^6.1.3", + "tslint-config-prettier": "^1.18.0", + "typescript": "^4.3.5" + }, + "keywords": [] +} diff --git a/node_modules/base64-arraybuffer/rollup.config.ts b/node_modules/base64-arraybuffer/rollup.config.ts new file mode 100644 index 0000000000000000000000000000000000000000..652fe032b477e22240368356c017406180144901 --- /dev/null +++ b/node_modules/base64-arraybuffer/rollup.config.ts @@ -0,0 +1,40 @@ +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import sourceMaps from 'rollup-plugin-sourcemaps'; +import typescript from '@rollup/plugin-typescript'; +import json from 'rollup-plugin-json'; + +const pkg = require('./package.json'); + +const banner = `/* + * ${pkg.name} ${pkg.version} <${pkg.homepage}> + * Copyright (c) ${(new Date()).getFullYear()} ${pkg.author.name} <${pkg.author.url}> + * Released under ${pkg.license} License + */`; + +export default { + input: `src/index.ts`, + output: [ + { file: pkg.main, name: pkg.name, format: 'umd', banner, sourcemap: true }, + { file: pkg.module, format: 'esm', banner, sourcemap: true }, + ], + external: [], + watch: { + include: 'src/**', + }, + plugins: [ + // Allow node_modules resolution, so you can use 'external' to control + // which external modules to include in the bundle + // https://github.com/rollup/rollup-plugin-node-resolve#usage + resolve(), + // Allow json resolution + json(), + // Compile TypeScript files + typescript({ sourceMap: true, inlineSources: true }), + // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) + commonjs(), + + // Resolve source maps to the original source + sourceMaps(), + ], +} diff --git a/node_modules/baseline-browser-mapping/LICENSE.txt b/node_modules/baseline-browser-mapping/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/node_modules/baseline-browser-mapping/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/baseline-browser-mapping/README.md b/node_modules/baseline-browser-mapping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..285cff040bb3e47dd914942e4c1ad9b130b240a2 --- /dev/null +++ b/node_modules/baseline-browser-mapping/README.md @@ -0,0 +1,545 @@ +# [`baseline-browser-mapping`](https://github.com/web-platform-dx/web-features/packages/baseline-browser-mapping) + +By the [W3C WebDX Community Group](https://www.w3.org/community/webdx/) and contributors. + +`baseline-browser-mapping` provides: + +- An `Array` of browsers compatible with Baseline Widely available and Baseline year feature sets via the [`getCompatibleVersions()` function](#get-baseline-widely-available-browser-versions-or-baseline-year-browser-versions). +- An `Array`, `Object` or `CSV` as a string describing the Baseline feature set support of all browser versions included in the module's data set via the [`getAllVersions()` function](#get-data-for-all-browser-versions). + +You can use `baseline-browser-mapping` to help you determine minimum browser version support for your chosen Baseline feature set; or to analyse the level of support for different Baseline feature sets in your site's traffic by joining the data with your analytics data. + +## Install for local development + +To install the package, run: + +`npm install --save-dev baseline-browser-mapping` + +The minimum supported NodeJS version for `baseline-browser-mapping` is v8 in alignment with `browserslist`. For NodeJS versions earlier than v13.2, the [`require('baseline-browser-mapping')`](https://nodejs.org/api/modules.html#requireid) syntax should be used to import the module. + +## Keeping `baseline-browser-mapping` up to date + +`baseline-browser-mapping` depends on `web-features` and `@mdn/browser-compat-data` for core browser version selection, but the data is pre-packaged and minified. This package checks for updates to those modules and the supported [downstream browsers](#downstream-browsers) on a daily basis and is updated frequently. + +If you are only using this module to generate minimum browser versions for Baseline Widely available or Baseline year feature sets, you don't need to update this module frequently, as the backward looking data is reasonably stable. + +However, if you are targeting Newly available, using the [`getAllVersions()`](#get-data-for-all-browser-versions) function or heavily relying on the data for downstream browsers, you should update this module more frequently. If you target a feature cut off date within the last two months and your installed version of `baseline-browser-mapping` has data that is more than 2 months old, you will receive a console warning advising you to update to the latest version when you call `getCompatibleVersions()` or `getAllVersions()`. + +If you want to suppress the console warnings mentioned above you can use the `suppressWarnings: true` option in the configuration object passed to `getCompatibleVersions()` or `getAllVersions()`. Alternatively, you can use the `BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA=true` environment variable when running your build process. This module also respects the `BROWSERSLIST_IGNORE_OLD_DATA=true` environment variable. Environment variables can also be provided in a `.env` file from Node 20 onwards; however, this module does not load .env files automatically to avoid conflicts with other libraries with different requirements. You will need to use `process.loadEnvFile()` or a library like `dotenv` to load .env files before `baseline-browser-mapping` is called. + +If you're building a tool that uses this module, consider suppressing the warnings but building a process into your tool that automatically updates this module. See, for example, [`browserslist`](https://github.com/browserslist/browserslist/blob/main/node.js#L471) and its [`update-browserslist-db`](https://github.com/browserslist/update-db) package. + +If you're implementing `baseline-browser-mapping` directly, you should add a script to your `package.json` to update `baseline-browser-mapping` and use it as part of your build process to ensure your data is as up to date as possible. For example, if you are using NPM for package management: + +```javascript +"scripts": [ + "refresh-baseline-browser-mapping": "npm i baseline-browser-mapping@latest -D" +] +``` + +If you want to ensure [reproducible builds](https://www.wikiwand.com/en/articles/Reproducible_builds), we strongly recommend using the `widelyAvailableOnDate` option to fix the Widely available date on a per build basis to ensure dependent tools provide the same output and you do not produce data staleness warnings. If you are using [`browserslist`](https://github.com/browserslist/browserslist) to target Baseline Widely available, consider automatically updating your `browserslist` configuration in `package.json` or `.browserslistrc` to `baseline widely available on {YYYY-MM-DD}` as part of your build process to ensure the same or sufficiently similar list of minimum browsers is reproduced for historical builds. + +## Importing `baseline-browser-mapping` + +This module exposes three functions: `getCompatibleVersions()`, `getAllVersions()`, and `getTimeline()`, all of which can be imported directly from `baseline-browser-mapping`: + +```javascript +import { + getCompatibleVersions, + getAllVersions, + getTimeline, +} from "baseline-browser-mapping"; +``` + +If you want to load the script and data directly in a web page without hosting it yourself, consider using a CDN: + +```html + +``` + +## Get Baseline Widely available browser versions or Baseline year browser versions + +To get the current list of minimum browser versions compatible with Baseline Widely available features from the core browser set, call the `getCompatibleVersions()` function: + +```javascript +getCompatibleVersions(); +``` + +Executed on 7th March 2025, the above code returns the following browser versions: + +```javascript +[ + { browser: "chrome", version: "105", release_date: "2022-09-02" }, + { + browser: "chrome_android", + version: "105", + release_date: "2022-09-02", + }, + { browser: "edge", version: "105", release_date: "2022-09-02" }, + { browser: "firefox", version: "104", release_date: "2022-08-23" }, + { + browser: "firefox_android", + version: "104", + release_date: "2022-08-23", + }, + { browser: "safari", version: "15.6", release_date: "2022-09-02" }, + { + browser: "safari_ios", + version: "15.6", + release_date: "2022-09-02", + }, +]; +``` + +> [!NOTE] +> The minimum versions of each browser are not necessarily the final release before the Widely available cutoff date of `TODAY - 30 MONTHS`. Some earlier versions will have supported the full Widely available feature set. + +### `getCompatibleVersions()` configuration options + +`getCompatibleVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows: + +```javascript +{ + targetYear: undefined, + widelyAvailableOnDate: undefined, + includeDownstreamBrowsers: false, + listAllCompatibleVersions: false, + suppressWarnings: false +} +``` + +#### `targetYear` + +The `targetYear` option returns the minimum browser versions compatible with all **Baseline Newly available** features at the end of the specified calendar year. For example, calling: + +```javascript +getCompatibleVersions({ + targetYear: 2020, +}); +``` + +Returns the following versions: + +```javascript +[ + { browser: "chrome", version: "87", release_date: "2020-11-19" }, + { + browser: "chrome_android", + version: "87", + release_date: "2020-11-19", + }, + { browser: "edge", version: "87", release_date: "2020-11-19" }, + { browser: "firefox", version: "83", release_date: "2020-11-17" }, + { + browser: "firefox_android", + version: "83", + release_date: "2020-11-17", + }, + { browser: "safari", version: "14", release_date: "2020-09-16" }, + { browser: "safari_ios", version: "14", release_date: "2020-09-16" }, +]; +``` + +> [!NOTE] +> The minimum version of each browser is not necessarily the final version released in that calendar year. In the above example, Firefox 84 was the final version released in 2020; however Firefox 83 supported all of the features that were interoperable at the end of 2020. +> [!WARNING] +> You cannot use `targetYear` and `widelyAavailableDate` together. Please only use one of these options at a time. + +#### `widelyAvailableOnDate` + +The `widelyAvailableOnDate` option returns the minimum versions compatible with Baseline Widely available on a specified date in the format `YYYY-MM-DD`: + +```javascript +getCompatibleVersions({ + widelyAvailableOnDate: `2023-04-05`, +}); +``` + +> [!TIP] +> This option is useful if you provide a versioned library that targets Baseline Widely available on each version's release date and you need to provide a statement on minimum supported browser versions in your documentation. + +#### `includeDownstreamBrowsers` + +Setting `includeDownstreamBrowsers` to `true` will include browsers outside of the Baseline core browser set where it is possible to map those browsers to an upstream Chromium or Gecko version: + +```javascript +getCompatibleVersions({ + includeDownstreamBrowsers: true, +}); +``` + +For more information on downstream browsers, see [the section on downstream browsers](#downstream-browsers) below. + +#### `includeKaiOS` + +KaiOS is an operating system and app framework based on the Gecko engine from Firefox. KaiOS is based on the Gecko engine and feature support can be derived from the upstream Gecko version that each KaiOS version implements. However KaiOS requires other considerations beyond feature compatibility to ensure a good user experience as it runs on device types that do not have either mouse and keyboard or touch screen input in the way that all the other browsers supported by this module do. + +```javascript +getCompatibleVersions({ + includeDownstreamBrowsers: true, + includeKaiOS: true, +}); +``` + +> [!NOTE] +> Including KaiOS requires you to include all downstream browsers using the `includeDownstreamBrowsers` option. + +#### `listAllCompatibleVersions` + +Setting `listAllCompatibleVersions` to true will include the minimum versions of each compatible browser, and all the subsequent versions: + +```javascript +getCompatibleVersions({ + listAllCompatibleVersions: true, +}); +``` + +#### `suppressWarnings` + +Setting `suppressWarnings` to `true` will suppress the console warning about old data: + +```javascript +getCompatibleVersions({ + suppressWarnings: true, +}); +``` + +## Get data for all browser versions + +You may want to obtain data on all the browser versions available in this module for use in an analytics solution or dashboard. To get details of each browser version's level of Baseline support, call the `getAllVersions()` function: + +```javascript +import { getAllVersions } from "baseline-browser-mapping"; + +getAllVersions(); +``` + +By default, this function returns an `Array` of `Objects` and excludes downstream browsers: + +```javascript +[ + ... + { + browser: "firefox_android", // Browser name + version: "125", // Browser version + release_date: "2024-04-16", // Release date + year: 2023, // Baseline year feature set the version supports + wa_compatible: true // Whether the browser version supports Widely available + }, + ... +] +``` + +For browser versions in `@mdn/browser-compat-data` that were released before Baseline can be defined, i.e. Baseline 2015, the `year` property is always the string: `"pre_baseline"`. + +### Understanding which browsers support Newly available features + +You may want to understand which recent browser versions support all Newly available features. You can replace the `wa_compatible` property with a `supports` property using the `useSupport` option: + +```javascript +getAllVersions({ + useSupports: true, +}); +``` + +The `supports` property is optional and has two possible values: + +- `widely` for browser versions that support all Widely available features. +- `newly` for browser versions that support all Newly available features. + +Browser versions that do not support Widely or Newly available will not include the `support` property in the `array` or `object` outputs, and in the CSV output, the `support` column will contain an empty string. Browser versions that support all Newly available features also support all Widely available features. + +### `getAllVersions()` Configuration options + +`getAllVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows: + +```javascript +{ + includeDownstreamBrowsers: false, + outputFormat: "array", + suppressWarnings: false +} +``` + +#### `includeDownstreamBrowsers` (in `getAllVersions()` output) + +As with `getCompatibleVersions()`, you can set `includeDownstreamBrowsers` to `true` to include the Chromium and Gecko downstream browsers [listed below](#list-of-downstream-browsers). + +```javascript +getAllVersions({ + includeDownstreamBrowsers: true, +}); +``` + +Downstream browsers include the same properties as core browsers, as well as the `engine`they use and `engine_version`, for example: + +```javascript +[ + ... + { + browser: "samsunginternet_android", + version: "27.0", + release_date: "2024-11-06", + engine: "Blink", + engine_version: "125", + year: 2023, + supports: "widely" + }, + ... +] +``` + +#### `includeKaiOS` (in `getAllVersions()` output) + +As with `getCompatibleVersions()` you can include KaiOS in your output. The same requirement to have `includeDownstreamBrowsers: true` applies. + +```javascript +getAllVersions({ + includeDownstreamBrowsers: true, + includeKaiOS: true, +}); +``` + +#### `suppressWarnings` (in `getAllVersions()` output) + +As with `getCompatibleVersions()`, you can set `suppressWarnings` to `true` to suppress the console warning about old data: + +```javascript +getAllVersions({ + suppressWarnings: true, +}); +``` + +#### `outputFormat` + +By default, this function returns an `Array` of `Objects` which can be manipulated in Javascript or output to JSON. + +To return an `Object` that nests keys , set `outputFormat` to `object`: + +```javascript +getAllVersions({ + outputFormat: "object", +}); +``` + +In thise case, `getAllVersions()` returns a nested object with the browser [IDs listed below](#list-of-downstream-browsers) as keys, and versions as keys within them: + +```javascript +{ + "chrome": { + "53": { + "year": 2016, + "release_date": "2016-09-07" + }, + ... +} +``` + +Downstream browsers will include extra fields for `engine` and `engine_versions` + +```javascript +{ + ... + "webview_android": { + "53": { + "year": 2016, + "release_date": "2016-09-07", + "engine": "Blink", + "engine_version": "53" + }, + ... +} +``` + +To return a `String` in CSV format, set `outputFormat` to `csv`: + +```javascript +getAllVersions({ + outputFormat: "csv", +}); +``` + +`getAllVersions` returns a `String` with a header row and comma-separated values for each browser version that you can write to a file or pass to another service. Core browsers will have "NULL" as the value for their `engine` and `engine_version`: + +```csv +"browser","version","year","supports","release_date","engine","engine_version" +... +"chrome","24","pre_baseline","","2013-01-10","NULL","NULL" +... +"chrome","53","2016","","2016-09-07","NULL","NULL" +... +"firefox","135","2024","widely","2025-02-04","NULL","NULL" +"firefox","136","2024","newly","2025-03-04","NULL","NULL" +... +"ya_android","20.12","2020","year_only","2020-12-20","Blink","87" +... +``` + +> [!NOTE] +> The above example uses `"includeDownstreamBrowsers": true` + +### Static resources + +The outputs of `getAllVersions()` are available as JSON or CSV files generated on a daily basis and hosted on GitHub pages: + +- Core browsers only + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_array.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_object.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions.csv) +- Core browsers only, with `supports` property + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_array_with_supports.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_object_with_supports.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_with_supports.csv) +- Including downstream browsers + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_array.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_object.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions.csv) +- Including downstream browsers with `supports` property + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_array_with_supports.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_object_with_supports.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_with_supports.csv) + +These files are updated on a daily basis. + +## Get timeline of browser version compatibility bumps + +To calculate compatible browser versions on custom/arbitrary dates completely client-side without loading the full `@mdn/browser-compat-data` database, you can call the `getTimeline()` function. It returns the timeline of minimum version requirements as a chronologically sorted array of change events: + +```javascript +import { getTimeline } from "baseline-browser-mapping"; + +const timeline = getTimeline(); +``` + +It returns an `Array` of events, where each event has a `date` and an array of `browsers` representing the compatibility changes on that date: + +```javascript +[ + { + date: "2015-07-29", + browsers: [ + { browser: "chrome", version: "38", release_date: "2014-10-07" }, + { browser: "chrome_android", version: "38", release_date: "2014-10-08" }, + { browser: "edge", version: "12", release_date: "2015-07-29" }, + { browser: "firefox", version: "38", release_date: "2015-05-12" }, + { browser: "firefox_android", version: "38", release_date: "2015-05-12" }, + { browser: "safari", version: "11", release_date: "2017-09-19" }, + { browser: "safari_ios", version: "11", release_date: "2017-09-19" } + ] + }, + { + date: "2015-09-22", + browsers: [ + { browser: "firefox", version: "41", release_date: "2015-09-22" }, + { browser: "firefox_android", version: "41", release_date: "2015-09-22" } + ] + }, + ... +] +``` + +### Options + +`getTimeline()` accepts an optional configuration `Object` with the following properties: + +- `groupBy` (`"date"` by default): + - If `"date"` (default), it returns a chronologically sorted `Array` of events, where each event represents a date on which a browser's Baseline requirements changed. + - If `"browser"`, it returns an `Object` where keys are browser names and values are arrays of version change events for that specific browser: + ```javascript + { + chrome: [ + { date: "2015-07-29", version: "38", release_date: "2014-10-07" }, + { date: "2016-03-02", version: "49", release_date: "2016-03-02" }, + ... + ], + safari: [ + { date: "2015-09-30", version: "9", release_date: "2015-09-30" }, + ... + ], + ... + } + ``` +- `listAllBrowsers` (`false` by default): + - If `false`, the `browsers` array for each event (when `groupBy` is `"date"`) contains _only_ the browsers that changed on that specific date. + - If `true`, the `browsers` array for each event will contain the state of _all_ active compatible browsers at that point in time (showing the versions they had on that date). + - _Note: Only applicable when `groupBy` is `"date"` (or when `groupBy` is `"browser"`, this lists every date in the timeline for each browser)._ +- `includeDownstreamBrowsers` (`false` by default): Whether to include downstream browsers that share the same engine as a core browser. +- `includeKaiOS` (`false` by default): Whether to include KaiOS (requires `includeDownstreamBrowsers: true`). + +```javascript +// Get a complete view of all core browsers at every timeline event +const fullTimeline = getTimeline({ listAllBrowsers: true }); + +// Get the timeline grouped by browser instead of by date +const browserTimeline = getTimeline({ groupBy: "browser" }); + +// Include downstream browsers in the timeline of changes +const downstreamTimeline = getTimeline({ includeDownstreamBrowsers: true }); +``` + +## CLI + +`baseline-browser-mapping` includes a command line interface that exposes the same data and options as the `getCompatibleVersions()` function. To learn more about using the CLI, run: + +```sh +npx baseline-browser-mapping --help +``` + +## Downstream browsers + +### Limitations + +The browser versions in this module come from two different sources: + +- MDN's `browser-compat-data` module. +- Parsed user agent strings provided by [useragents.io](https://useragents.io/) + +MDN `browser-compat-data` is an authoritative source of information for the browsers it contains. The release dates for the Baseline core browser set and the mapping of downstream browsers to Chromium versions should be considered accurate. + +Browser mappings from useragents.io are provided on a best effort basis. They assume that browser vendors are accurately stating the Chromium version they have implemented. The initial set of version mappings was derived from a bulk export in November 2024. This version was iterated over with a Regex match looking for a major Chrome version and a corresponding version of the browser in question, e.g.: + +`Mozilla/5.0 (Linux; U; Android 10; en-US; STK-L21 Build/HUAWEISTK-L21) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 UCBrowser/13.8.2.1324 Mobile Safari/537.36` + +Shows UC Browser Mobile 13.8 implementing Chromium 100, and: + +`Mozilla/5.0 (Linux; arm_64; Android 11; Redmi Note 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.123 YaBrowser/24.10.2.123.00 SA/3 Mobile Safari/537.36` + +Shows Yandex Browser Mobile 24.10 implementing Chromium 128. The Chromium version from this string is mapped to the corresponding Chrome version from MDN `browser-compat-data`. + +> [!NOTE] +> Where possible, approximate release dates have been included based on useragents.io "first seen" data. useragents.io does not have "first seen" dates prior to June 2020. However, these browsers' Baseline compatibility is determined by their Chromium or Gecko version, so their release dates are more informative than critical. + +This data is updated on a daily basis using a [script](https://github.com/web-platform-dx/web-features/tree/main/scripts/refresh-downstream.ts) triggered by a GitHub [action](https://github.com/web-platform-dx/web-features/tree/main/.github/workflows/refresh_downstream.yml). Useragents.io provides a private API for this module which exposes the last 7 days of newly seen user agents for the currently tracked browsers. If a new major version of one of the tracked browsers is encountered with a Chromium version that meets or exceeds the previous latest version of that browser, it is added to the [src/data/downstream-browsers.json](src/data/downstream-browsers.json) file with the date it was first seen by useragents.io as its release date. + +KaiOS is an exception - its upstream version mappings are handled separately from the other browsers because they happen very infrequently. + +### List of downstream browsers + +| Browser | ID | Core | Source | +| --------------------- | ------------------------- | ------- | ------------------------- | +| Chrome | `chrome` | `true` | MDN `browser-compat-data` | +| Chrome for Android | `chrome_android` | `true` | MDN `browser-compat-data` | +| Edge | `edge` | `true` | MDN `browser-compat-data` | +| Firefox | `firefox` | `true` | MDN `browser-compat-data` | +| Firefox for Android | `firefox_android` | `true` | MDN `browser-compat-data` | +| Safari | `safari` | `true` | MDN `browser-compat-data` | +| Safari on iOS | `safari_ios` | `true` | MDN `browser-compat-data` | +| Opera | `opera` | `false` | MDN `browser-compat-data` | +| Opera Android | `opera_android` | `false` | MDN `browser-compat-data` | +| Samsung Internet | `samsunginternet_android` | `false` | MDN `browser-compat-data` | +| WebView Android | `webview_android` | `false` | MDN `browser-compat-data` | +| QQ Browser Mobile | `qq_android` | `false` | useragents.io | +| UC Browser Mobile | `uc_android` | `false` | useragents.io | +| Yandex Browser Mobile | `ya_android` | `false` | useragents.io | +| KaiOS | `kai_os` | `false` | Manual | +| Facebook for Android | `facebook_android` | `false` | useragents.io | +| Instagram for Android | `instagram_android` | `false` | useragents.io | + +> [!NOTE] +> All the non-core browsers currently included implement Chromium or Gecko. Their inclusion in any of the above methods is based on the Baseline feature set supported by the Chromium or Gecko version they implement, not their release date. diff --git a/node_modules/baseline-browser-mapping/dist/cli.cjs b/node_modules/baseline-browser-mapping/dist/cli.cjs new file mode 100644 index 0000000000000000000000000000000000000000..b52b3b0930145d6628f6c8fa770cdac7a5857684 --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/cli.cjs @@ -0,0 +1,2 @@ +#!/usr/bin/env node +"use strict";const{getCompatibleVersions:e}=require("./index.cjs"),a=process.argv.slice(2),s={};for(let e=0;e{if(n===a)return 0;const[e=0,u=0]=n.split(".",2).map(Number),[s=0,o=0]=a.split(".",2).map(Number);if(isNaN(e)||isNaN(u))throw new Error(`Invalid version: ${n}`);if(isNaN(s)||isNaN(o))throw new Error(`Invalid version: ${a}`);return e!==s?e>s?1:-1:u!==o?u>o?1:-1:0},a={c:{longName:"chrome"},ca:{longName:"chrome_android"},e:{longName:"edge"},f:{longName:"firefox"},fa:{longName:"firefox_android"},s:{longName:"safari"},si:{longName:"safari_ios"},o:{longName:"opera",engine:"Blink"},oa:{longName:"opera_android",engine:"Blink"},sa:{longName:"samsunginternet_android",engine:"Blink"},wva:{longName:"webview_android",engine:"Blink"},y:{longName:"ya_android",engine:"Blink"},u:{longName:"uc_android",engine:"Blink"},q:{longName:"qq_android",engine:"Blink"},k:{longName:"kai_os",engine:"Gecko"},fb:{longName:"facebook_android",engine:"Blink"},ia:{longName:"instagram_android",engine:"Blink"}},e=n=>6===n.length&&/^\d{6}$/.test(n)?`20${n.slice(0,2)}-${n.slice(2,4)}-${n.slice(4,6)}`:8===n.length&&/^\d{8}$/.test(n)?`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6,8)}`:n,u={},s={};let o="",f=!1;"pre_baseline\nc,1,081211\nc,2,090521\nc,3,090915\nc,4,100125\nc,5,100525\nc,6,100902\nc,7,101019\nc,8,101202\nc,9,110203\nc,10,110308\nc,11,110427\nc,12,110607\nc,13,110802\nc,14,110916\nc,15,111025\nc,16,111213\nc,17,120208\nc,18,120328\nc,19,120515\nc,20,120626\nc,21,120731\nc,22,120925\nc,23,121106\nc,24,130110\nc,25,130221\nc,26,130326\nc,27,130521\nc,28,130709\nc,29,130820\nc,30,131001\nc,31,131112\nc,32,140114\nc,33,140220\nc,34,140408\nc,35,140520\nc,36,140716\nc,37,140826\nc,38,141007\nc,39,141118\nc,40,150121\nc,41,150303\nc,42,150414\nc,43,150519\nc,44,150721\nca,18,120627\nca,25,130227\nca,26,130403\nca,27,130522\nca,28,130710\nca,29,130821\nca,30,131002\nca,31,131114\nca,32,140115\nca,33,140226\nca,34,140402\nca,35,140520\nca,36,140716\nca,37,140903\nca,38,141008\nca,39,141112\nca,40,150121\nca,41,150311\nca,42,150415\nca,43,150527\nf,1,041109\nf,1.5,051129\nf,2,061024\nf,3,080617\nf,3.5,090630\nf,3.6,100121\nf,4,110322\nf,5,110621\nf,6,110816\nf,7,110927\nf,8,111108\nf,9,111220\nf,10,120131\nf,11,120313\nf,12,120424\nf,13,120605\nf,14,120717\nf,15,120828\nf,16,121009\nf,17,121120\nf,18,130108\nf,19,130219\nf,20,130402\nf,21,130514\nf,22,130625\nf,23,130806\nf,24,130917\nf,25,131029\nf,26,131210\nf,27,140204\nf,28,140318\nf,29,140429\nf,30,140610\nf,31,140722\nf,32,140902\nf,33,141014\nf,34,141201\nf,35,150113\nf,36,150224\nf,37,150331\nf,38,150512\nf,39,150702\nfa,4,110329\nfa,5,110621\nfa,6,110816\nfa,7,110927\nfa,8,111108\nfa,9,111221\nfa,10,120131\nfa,14,120626\nfa,15,120828\nfa,16,121009\nfa,17,121120\nfa,18,130108\nfa,19,130219\nfa,20,130402\nfa,21,130514\nfa,22,130625\nfa,23,130806\nfa,24,130917\nfa,25,131029\nfa,26,131210\nfa,27,140204\nfa,28,140318\nfa,29,140429\nfa,30,140610\nfa,31,140722\nfa,32,140902\nfa,33,141014\nfa,34,141201\nfa,35,150113\nfa,36,150227\nfa,37,150331\nfa,38,150512\nfa,39,150702\ns,1,030623\ns,1.1,031024\ns,1.2,040202\ns,1.3,050415\ns,2,050429\ns,3,071026\ns,3.1,080318\ns,4,090608\ns,5,100607\ns,5.1,110720\ns,6,120725\ns,7,131022\ns,8,141016\nsi,1,070629\nsi,2,080711\nsi,3,090617\nsi,3.2,100403\nsi,4,100621\nsi,4.2,101122\nsi,5,111012\nsi,6,120910\nsi,7,130918\nsi,8,140917\n20150729\nc,38,141007\nca,38,141008\ne,12,150729\nf,38,150512\nfa,38,150512\ns,11,170919\nsi,11,170919\no,25,141015,38\noa,25,141016,38\nsa,3.0,150410,38\nwva,38,141008,38\ny,14.12,u,38\nu,11.1,u,40\nq,8.1,u,57\nk,2.0,170701,48\nfb,66,u,48\nia,23,u,62\n20150922\nf,41,150922\nfa,41,150922\n20150930\nc,44,150721\nca,44,150729\no,31,150804,44\noa,32,150923,45\nsa,4.0,160311,44\nwva,44,150729,44\ny,15.9,u,44\nu,11.6,u,57\n20151112\ne,13,151112\n20151231\nc,44,150721\nca,44,150729\ne,13,151112\nf,41,150922\nfa,41,150922\ns,11,170919\nsi,11,170919\no,31,150804,44\noa,32,150923,45\nsa,4.0,160311,44\nwva,44,150729,44\ny,15.9,u,44\nu,11.6,u,57\nq,8.1,u,57\nk,2.0,170701,48\nfb,66,u,48\nia,23,u,62\n20160308\nf,45,160308\nfa,45,160308\n20160607\nf,47,160607\nfa,47,160607\n20160802\ne,14,160802\n20160907\nc,53,160831\nca,53,160907\no,40,160920,53\noa,41,161025,54\nsa,6.0,170823,56\nwva,53,160907,53\ny,16.10,u,53\nfb,95,u,53\n20160920\nf,49,160920\nfa,49,160920\nk,3.0,210901,84\n20161231\nc,53,160831\nca,53,160907\ne,14,160802\nf,49,160920\nfa,49,160920\ns,11,170919\nsi,11,170919\no,40,160920,53\noa,41,161025,54\nsa,6.0,170823,56\nwva,53,160907,53\ny,16.10,u,53\nu,11.6,u,57\nq,8.1,u,57\nk,3.0,210901,84\nfb,95,u,53\nia,23,u,62\n20170201\nc,56,170125\nca,56,170201\nf,50,161115\nfa,50,161115\no,43,170207,56\noa,43,170927,59\nwva,56,170201,56\ny,17.3,u,56\nfb,112,u,56\n20170307\nf,52,170307\nfa,52,170307\n20170316\nca,57,170316\n20170405\nc,57,170309\ne,15,170405\no,44,170321,57\nsa,7.0,180316,59\nwva,57,170316,57\ny,17.4,u,57\nfb,117,u,57\n20170419\nf,53,170419\nfa,53,170419\n20170928\nfa,56,170928\n20171017\ne,16,171017\n20171024\nc,62,171017\nca,62,171024\no,49,171108,62\noa,46,180514,63\nsa,8.0,180718,63\nwva,62,171024,62\ny,17.11,u,62\nu,13.3,200909,78\nq,9.6,u,66\nfb,149,u,62\n20171128\nfa,57,171128\n20171231\nc,62,171017\nca,62,171024\ne,16,171017\nf,53,170419\nfa,57,171128\ns,11,170919\nsi,11,170919\no,49,171108,62\noa,46,180514,63\nsa,8.0,180718,63\nwva,62,171024,62\ny,17.11,u,62\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,149,u,62\nia,23,u,62\n20180412\ns,11.1,180412\nsi,11.3,180329\n20180430\ne,17,180430\n20180509\nc,66,180417\nca,66,180417\nf,60,180509\nfa,60,180509\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nfb,169,u,66\nia,42,u,66\n20180905\nf,62,180905\nfa,62,180905\n20181002\ne,18,181002\n20181023\nf,63,181023\nfa,63,181023\n20181211\nf,64,181211\nfa,64,181211\n20181231\nc,66,180417\nca,66,180417\ne,18,181002\nf,64,181211\nfa,64,181211\ns,11.1,180412\nsi,11.3,180329\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,169,u,66\nia,42,u,66\n20190129\nf,65,190129\nfa,65,190129\n20190325\ns,12.1,190325\nsi,12.2,190325\n20190919\ns,13,190919\nsi,13,190919\n20191231\nc,66,180417\nca,66,180417\ne,18,181002\nf,65,190129\nfa,65,190129\ns,13,190919\nsi,13,190919\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,169,u,66\nia,42,u,66\n20200115\nc,76,190730\nca,76,190730\ne,79,200115\nf,68,190709\nfa,68,190709\no,63,190820,76\noa,54,191018,76\nsa,12.0,200619,79\nwva,76,190730,76\ny,19.9,u,76\nq,10.9,201122,77\nfb,233,u,76\nia,96,u,80\n20200204\nc,80,200204\nca,80,200204\no,67,200303,80\noa,57,200330,80\nsa,13.0,201202,83\nwva,80,200204,80\ny,20.3,u,80\nu,15.3,230317,100\nq,11.7,211102,89\nfb,256,u,80\n20200207\ne,80,200207\n20200324\ns,13.1,200324\nsi,13.4,200324\n20200413\nc,81,200407\nca,81,200407\ne,81,200413\no,68,200422,81\noa,58,200513,81\nwva,81,200407,81\ny,20.4,u,81\nfb,266,u,81\nia,137,u,81\n20200727\nc,84,200727\nca,84,200727\ne,84,200716\no,70,200727,84\noa,60,200923,85\nsa,14.0,210417,87\nwva,84,200727,84\ny,20.8,200902,84\nfb,297,201202,86\nia,153,u,84\n20200728\nf,78,200630\nfa,79,200728\n20200827\nc,85,200825\nca,85,200825\ne,85,200827\no,71,200915,85\nwva,85,200825,85\ny,20.9,200927,85\nia,163,u,92\n20200916\nf,79,200728\ns,14,200916\nsi,14,200916\n20201020\nc,86,201020\nca,86,201020\ne,86,201009\no,72,201021,86\noa,61,201207,86\nwva,86,201020,86\ny,20.11,201111,86\n20201117\nf,83,201117\nfa,83,201117\n20201119\nc,87,201117\nca,87,201117\ne,87,201119\no,73,201209,87\noa,62,210216,87\nwva,87,201117,87\ny,20.12,201220,87\nfb,348,211219,96\n20201231\nc,87,201117\nca,87,201117\ne,87,201119\nf,83,201117\nfa,83,201117\ns,14,200916\nsi,14,200916\no,73,201209,87\noa,62,210216,87\nsa,14.0,210417,87\nwva,87,201117,87\ny,20.12,201220,87\nu,15.3,230317,100\nq,11.7,211102,89\nk,3.0,210901,84\nfb,348,211219,96\nia,163,u,92\n20210121\nc,88,210119\nca,88,210119\ne,88,210121\nf,84,201215\nfa,84,201215\no,74,210202,88\noa,63,210416,89\nsa,15.0,210813,90\nwva,88,210119,88\ny,21.1,211231,88\n20210126\nf,85,210126\nfa,85,210126\nk,4.0,250501,123\n20210426\nc,89,210302\nca,89,210302\ne,89,210304\nf,86,210223\nfa,86,210223\ns,14.1,210426\nsi,14.5,210426\no,75,210324,89\nwva,89,210302,89\ny,21.3,210404,89\n20210810\nf,91,210810\nfa,91,210810\n20210902\ne,93,210902\n20210907\nf,92,210907\nfa,92,210907\n20210920\nc,93,210831\nca,93,210831\ns,15,210920\nsi,15,210920\no,79,210914,93\noa,66,211215,94\nsa,17.0,220504,96\nwva,93,210831,93\ny,21.9,210929,93\nq,13.4,230426,98\nia,258,221104,106\n20211005\nf,93,211005\nfa,93,211005\n20211025\ns,15.1,211025\nsi,15.1,211025\n20211102\nf,94,211102\nfa,94,211102\n20211119\nc,96,211115\nca,96,211115\ne,96,211119\no,82,211202,96\noa,67,220131,96\nwva,96,211115,96\ny,22.1,211231,96\n20211207\nf,95,211207\n20211213\ns,15.2,211213\nsi,15.2,211213\n20211231\nc,96,211115\nca,96,211115\ne,96,211119\nf,95,211207\nfa,94,211102\ns,15.2,211213\nsi,15.2,211213\no,82,211202,96\noa,67,220131,96\nsa,17.0,220504,96\nwva,96,211115,96\ny,22.1,211231,96\nu,15.3,230317,100\nq,13.4,230426,98\nk,4.0,250501,123\nfb,348,211219,96\nia,258,221104,106\n20220106\nc,97,220104\nca,97,220104\ne,97,220106\no,83,220119,97\noa,68,220330,99\nsa,18.0,220808,99\nwva,97,220104,97\ny,22.3,220325,98\nfb,399,230204,109\n20220203\nc,98,220201\nca,98,220201\ne,98,220203\nf,96,220111\nfa,96,220111\no,84,220216,98\nwva,98,220201,98\n20220303\nc,99,220301\nca,99,220301\ne,99,220303\no,85,220323,99\nwva,99,220301,99\ny,22.5,220520,100\nq,14.2,231014,109\n20220314\nf,98,220308\nfa,98,220308\ns,15.4,220314\nsi,15.4,220314\n20220428\nc,101,220426\nca,101,220426\ne,101,220428\no,87,220517,101\noa,70,220629,102\nsa,19.0,221101,102\nwva,101,220426,101\ny,22.7,220707,102\nu,17.6,250515,123\n20220503\nf,100,220503\nfa,100,220503\n20220531\nf,101,220531\nfa,101,220531\n20220628\nf,102,220628\nfa,102,220628\n20220726\nf,103,220726\nfa,103,220726\n20220805\nc,104,220802\nca,104,220802\ne,104,220805\no,90,220818,104\noa,71,220916,104\nsa,20.0,230210,106\nwva,104,220802,104\ny,22.8,u,104\n20220823\nf,104,220823\nfa,104,220823\n20220902\nc,105,220902\nca,105,220902\ne,105,220901\ns,15.6,220720\nsi,15.6,220720\no,91,220914,105\noa,72,221021,106\nwva,105,220902,105\ny,22.11,221111,106\n20220912\ns,16,220912\nsi,16,220912\n20221003\nc,106,220927\nca,106,220927\ne,106,221003\no,92,221019,106\nwva,106,220927,106\n20221027\nc,107,221025\nca,107,221025\ne,107,221027\no,93,221117,107\noa,73,230117,108\nsa,21.0,230519,110\nwva,107,221025,107\ny,23.1,230110,108\nia,279,231231,109\n20221115\nf,107,221115\nfa,107,221115\n20221205\nc,108,221129\nca,108,221129\ne,108,221205\no,94,221215,108\nwva,108,221129,108\n20221213\nf,108,221213\nfa,108,221213\n20221231\nc,108,221129\nca,108,221129\ne,108,221205\nf,108,221213\nfa,108,221213\ns,16,220912\nsi,16,220912\no,94,221215,108\noa,73,230117,108\nsa,21.0,230519,110\nwva,108,221129,108\ny,23.1,230110,108\nu,17.6,250515,123\nq,14.2,231014,109\nk,4.0,250501,123\nfb,399,230204,109\nia,279,231231,109\n20230112\nc,109,230110\nca,109,230110\ne,109,230112\no,95,230201,109\noa,74,230313,110\nwva,109,230110,109\ny,23.3,230326,110\n20230214\nf,110,230214\nfa,110,230214\n20230313\nc,111,230307\nca,111,230307\ne,111,230313\no,97,230322,111\noa,75,230517,112\nsa,22.0,230714,111\nwva,111,230301,111\ny,23.5,230519,112\nq,19.1,250708,121\nfb,420,230628,114\nia,288,u,114\n20230314\nf,111,230314\nfa,111,230314\n20230327\ns,16.4,230327\nsi,16.4,230327\n20230411\nf,112,230411\nfa,112,230411\n20230509\nf,113,230509\nfa,113,230509\n20230606\nf,114,230606\nfa,114,230606\n20230704\nc,112,230404\nca,112,230404\ne,112,230406\nf,115,230704\nfa,115,230704\no,98,230420,112\nsa,23.0,231018,115\nwva,112,230404,112\n20230721\nc,115,230718\nca,115,230721\ne,115,230721\no,101,230726,115\noa,77,230831,115\nwva,115,230721,115\ny,23.9,230913,116\nfb,430,230903,116\nia,292,u,115\n20230801\nf,116,230801\nfa,116,230801\n20230915\nc,117,230912\nca,117,230912\ne,117,230915\no,103,231003,117\noa,78,231023,117\nsa,24.0,240125,117\nwva,117,230912,117\ny,23.11,231115,118\nfb,434,231005,117\nia,302,u,117\n20230918\ns,17,230918\nsi,17,230918\n20231013\nc,118,231010\nca,118,231010\ne,118,231013\nf,118,230926\nfa,118,230926\no,104,231023,118\noa,79,231206,119\nsa,25.0,240424,121\nwva,118,231010,118\nfb,437,u,118\nia,306,240117,118\n20231024\nf,119,231024\nfa,119,231024\n20231102\nc,119,231031\nca,119,231031\ne,119,231102\no,105,231114,119\nwva,119,231031,119\ny,24.1,240118,120\nfb,439,231111,119\nia,309,u,119\n20231121\nf,120,231121\nfa,120,231121\n20231205\nca,120,231205\n20231207\nc,120,231205\ne,120,231207\no,106,231219,120\noa,80,240125,120\nwva,120,231205,120\nfb,443,231207,120\nia,311,u,120\n20231211\ns,17.2,231211\nsi,17.2,231211\n20231219\nf,121,231219\nfa,121,231219\n20231231\nc,120,231205\nca,120,231205\ne,120,231207\nf,121,231219\nfa,121,231219\ns,17.2,231211\nsi,17.2,231211\no,106,231219,120\noa,80,240125,120\nsa,25.0,240424,121\nwva,120,231205,120\ny,24.1,240118,120\nu,17.6,250515,123\nq,19.1,250708,121\nk,4.0,250501,123\nfb,443,231207,120\nia,311,u,120\n20240123\nf,122,240123\nfa,122,240123\n20240125\nc,121,240123\nca,121,240123\ne,121,240125\no,107,240207,121\noa,81,240314,122\nwva,121,240123,121\ny,24.4,240327,122\nfb,448,240129,121\nia,317,240203,121\n20240220\nf,123,240220\nfa,123,240220\n20240305\ns,17.4,240305\nsi,17.4,240305\n20240319\nf,124,240319\nfa,124,240319\n20240322\nc,123,240319\nca,123,240319\ne,123,240322\no,109,240327,123\noa,82,240502,124\nsa,27.0,241106,125\nwva,123,240319,123\ny,24.6,240604,124\nfb,465,240707,126\nia,338,240706,126\n20240416\nf,125,240416\nfa,125,240416\n20240418\nc,124,240416\nca,124,240416\ne,124,240418\no,110,240514,124\nwva,124,240416,124\n20240513\ns,17.5,240513\nsi,17.5,240513\n20240514\nf,126,240514\nfa,126,240514\n20240517\nc,125,240514\nca,125,240514\ne,125,240517\no,111,240612,125\noa,83,240625,126\nwva,125,240514,125\ny,24.7,240718,126\n20240611\nf,127,240611\nfa,127,240611\n20240709\nf,128,240709\nfa,128,240709\n20240725\nc,127,240723\nca,127,240723\ne,127,240725\no,113,240822,127\noa,84,240826,127\nsa,28.0,250402,130\nwva,127,240723,127\ny,24.10,241011,128\nfb,474,240730,127\nia,346,240901,127\n20240806\nf,129,240806\nfa,129,240806\n20240903\nf,130,240903\nfa,130,240903\n20240916\ns,18,240916\nsi,18,240916\n20241001\nf,131,241001\nfa,131,241001\n20241017\nc,130,241015\nca,130,241015\ne,130,241017\no,115,241127,130\noa,86,241202,130\nwva,130,241015,130\ny,24.12,241130,130\nfb,486,241018,130\nia,355,241106,130\n20241029\nf,132,241029\nfa,132,241029\n20241211\ns,18.2,241211\nsi,18.2,241211\n20241231\nc,130,241015\nca,130,241015\ne,130,241017\nf,132,241029\nfa,132,241029\ns,18.2,241211\nsi,18.2,241211\no,115,241127,130\noa,86,241202,130\nsa,28.0,250402,130\nwva,130,241015,130\ny,24.12,241130,130\nfb,486,241018,130\nia,355,241106,130\n20250107\nf,134,250107\nfa,134,250107\n20250127\nsi,18.3,250127\n20250304\nf,136,250304\nfa,136,250304\n20250331\ns,18.4,250331\nsi,18.4,250331\n20250401\nc,133,250204\nca,133,250204\ne,133,250206\nf,137,250401\nfa,137,250401\no,118,250415,133\noa,88,250319,134\nsa,29.0,251025,136\nwva,133,250204,133\ny,25.4,250423,134\nfb,503,250312,134\nia,378,250503,135\n20250404\nc,135,250401\nca,135,250401\ne,135,250404\no,120,250702,135\noa,89,250429,135\nwva,135,250401,135\ny,25.6,250904,136\nfb,514,250528,136\n20250429\nf,138,250429\nfa,138,250429\n20250501\nc,136,250429\nca,136,250429\ne,136,250501\no,121,250827,137\noa,90,250618,137\nwva,136,250429,136\nia,381,250619,137\n20250512\nsi,18.5,250512\n20250527\nf,139,250527\nfa,139,250527\n20250529\nc,137,250527\nca,137,250527\ne,137,250529\nwva,137,250527,137\ny,25.8,250830,138\nfb,515,250531,137\n20250626\nc,138,250624\nca,138,250624\ne,138,250626\no,122,250911,138\noa,91,250819,139\nwva,138,250624,138\nia,390,250726,138\n20250819\nf,142,250819\nfa,142,250819\n20250905\nc,140,250902\nca,140,250902\ne,140,250905\no,124,251113,140\noa,92,251008,140\nwva,140,250902,140\ny,25.10,251009,140\nia,399,250928,140\n20250915\ns,26,250915\nsi,26,250915\n20250916\nf,143,250916\nfa,143,250916\n20251003\nc,141,250930\nca,141,250930\ne,141,251003\no,125,251204,141\noa,93,251125,142\nwva,141,250930,141\ny,25.12,251207,142\nia,400,251006,141\n20251014\nf,144,251014\nfa,144,251014\n20251111\nf,145,251111\nfa,145,251111\n20251212\ns,26.2,251212\nsi,26.2,251212\n20251231\nc,141,250930\nca,141,250930\ne,141,251003\nf,145,251111\nfa,145,251111\ns,26.2,251212\nsi,26.2,251212\no,125,251204,141\noa,93,251125,142\nwva,141,250930,141\ny,25.12,251207,142\nia,400,251006,141\n20260113\nf,147,260113\nfa,147,260113\n20260211\ns,26.3,260211\nsi,26.3,260211\n20260214\nc,145,260210\nca,145,260210\ne,145,260214\no,129,260318,145\noa,96,260310,145\nwva,145,260210,145\ny,26.4,260425,146\nia,423,260405,146\n20260224\nf,148,260224\nfa,148,260224\n20260313\nc,146,260310\nca,146,260310\ne,146,260313\no,130,260408,146\noa,97,260416,146\nwva,146,260310,146\n20260324\nf,149,260324\nfa,149,260324\ns,26.4,260324\nsi,26.4,260324\n20260410\nc,147,260407\nca,147,260407\ne,147,260410\no,131,260429,147\noa,98,260505,147\nwva,147,260407,147\ny,26.6,260608,148\nia,430,260530,148\n20260505\nca,148,260505\n20260507\nc,148,260505\ne,148,260507\no,132,260528,148\noa,99,260610,148\nwva,148,260505,148\n20260511\ns,26.5,260511\nsi,26.5,260511\n20260519\nf,151,260519\nfa,151,260519\n20260616\nf,152,260616\nfa,152,260616\n20260721\nf,153,260721\nfa,153,260721\n20260818\nf,154,260818\nfa,154,260818\n20260828\nc,152,260825\nca,152,260825\ne,152,260828\no,136,u,152\nwva,152,260825,152\n20260901\nf,155,260901\nfa,155,260901\nreleases\nc,45,150901\nc,46,151013\nc,47,151201\nc,48,160120\nc,49,160302\nc,50,160413\nc,51,160525\nc,52,160720\nc,54,161012\nc,55,161201\nc,58,170419\nc,59,170605\nc,60,170725\nc,61,170905\nc,63,171206\nc,64,180123\nc,65,180306\nc,67,180529\nc,68,180724\nc,69,180904\nc,70,181016\nc,71,181204\nc,72,190129\nc,73,190312\nc,74,190423\nc,75,190604\nc,77,190910\nc,78,191022\nc,79,191210\nc,83,200519\nc,90,210413\nc,91,210525\nc,92,210720\nc,94,210921\nc,95,211019\nc,100,220329\nc,102,220524\nc,103,220621\nc,110,230207\nc,113,230502\nc,114,230530\nc,116,230815\nc,122,240220\nc,126,240611\nc,128,240820\nc,129,240917\nc,131,241112\nc,132,250114\nc,134,250304\nc,139,250805\nc,142,251028\nc,143,251202\nc,144,260113\nc,149,260602\nc,150,260630\nc,151,260728\nc,153,260908\nc,154,260922\nca,45,150901\nca,46,151014\nca,47,151202\nca,48,160126\nca,49,160309\nca,50,160413\nca,51,160608\nca,52,160727\nca,54,161019\nca,55,161206\nca,58,170425\nca,59,170606\nca,60,170801\nca,61,170905\nca,63,171205\nca,64,180123\nca,65,180306\nca,67,180531\nca,68,180724\nca,69,180904\nca,70,181017\nca,71,181204\nca,72,190129\nca,73,190312\nca,74,190424\nca,75,190604\nca,77,190910\nca,78,191022\nca,79,191217\nca,83,200519\nca,90,210413\nca,91,210525\nca,92,210720\nca,94,210921\nca,95,211019\nca,100,220329\nca,102,220524\nca,103,220621\nca,110,230207\nca,113,230502\nca,114,230530\nca,116,230815\nca,122,240220\nca,126,240611\nca,128,240820\nca,129,240917\nca,131,241112\nca,132,250114\nca,134,250304\nca,139,250805\nca,142,251028\nca,143,251202\nca,144,260113\nca,149,260602\nca,150,260630\nca,151,260728\nca,153,260908\nca,154,260922\ne,83,200521\ne,90,210415\ne,91,210527\ne,92,210722\ne,94,210924\ne,95,211021\ne,100,220401\ne,102,220531\ne,103,220623\ne,110,230209\ne,113,230505\ne,114,230602\ne,116,230821\ne,122,240223\ne,126,240613\ne,128,240822\ne,129,240919\ne,131,241114\ne,132,250117\ne,134,250306\ne,139,250807\ne,142,251031\ne,143,251205\ne,144,260121\ne,149,260604\ne,150,260702\ne,151,260731\ne,153,260910\ne,154,260924\nf,40,150811\nf,42,151103\nf,43,151215\nf,44,160126\nf,46,160426\nf,48,160802\nf,51,170124\nf,54,170613\nf,55,170808\nf,56,170928\nf,57,171114\nf,58,180123\nf,59,180313\nf,61,180626\nf,66,190319\nf,67,190521\nf,69,190903\nf,70,191022\nf,71,191210\nf,72,200107\nf,73,200211\nf,74,200310\nf,75,200407\nf,76,200505\nf,77,200602\nf,80,200825\nf,81,200922\nf,82,201020\nf,87,210323\nf,88,210419\nf,89,210601\nf,90,210713\nf,97,220208\nf,99,220405\nf,105,220920\nf,106,221018\nf,109,230117\nf,117,230829\nf,133,241126\nf,135,250204\nf,140,250624\nf,141,250722\nf,146,251209\nf,150,260421\nf,156,260915\nf,157,260929\nfa,40,150811\nfa,42,151103\nfa,43,151215\nfa,44,160126\nfa,46,160426\nfa,48,160802\nfa,51,170124\nfa,54,170613\nfa,55,170808\nfa,58,180122\nfa,59,180313\nfa,61,180626\nfa,66,190319\nfa,67,190521\nfa,80,200831\nfa,81,200922\nfa,82,201020\nfa,87,210323\nfa,88,210419\nfa,89,210601\nfa,90,210713\nfa,95,211207\nfa,97,220208\nfa,99,220405\nfa,105,220920\nfa,106,221018\nfa,109,230117\nfa,117,230829\nfa,133,241126\nfa,135,250204\nfa,140,250624\nfa,141,250722\nfa,146,251209\nfa,150,260421\nfa,156,260915\nfa,157,260929\ns,9,150930\ns,9.1,160321\ns,10,160920\ns,10.1,170327\ns,12,180917\ns,15.3,220126\ns,15.5,220516\ns,16.1,221024\ns,16.2,221213\ns,16.3,230123\ns,16.5,230518\ns,16.6,230724\ns,17.1,231025\ns,17.3,240122\ns,17.6,240729\ns,18.1,241028\ns,18.3,250127\ns,18.5,250512\ns,18.6,250729\ns,26.1,251103\ns,26.6,260727\ns,27,u\nsi,9,150916\nsi,9.3,160321\nsi,10,160913\nsi,10.3,170327\nsi,12,180917\nsi,15.3,220126\nsi,15.5,220516\nsi,16.1,221024\nsi,16.2,221213\nsi,16.3,230123\nsi,16.5,230518\nsi,16.6,230724\nsi,17.1,231025\nsi,17.3,240122\nsi,17.6,240729\nsi,18.1,241028\nsi,18.6,250729\nsi,26.1,251103\nsi,26.6,260727\nsi,27,u\no,15,130702,28\no,16,130827,29\no,17,131008,30\no,18,131119,31\no,19,140128,32\no,20,140304,33\no,21,140506,34\no,22,140603,35\no,23,140722,36\no,24,140902,37\no,26,141203,39\no,27,150127,40\no,28,150310,41\no,29,150428,42\no,30,150609,43\no,32,150915,45\no,33,151027,46\no,34,151208,47\no,35,160202,48\no,36,160315,49\no,37,160504,50\no,38,160608,51\no,39,160802,52\no,41,161025,54\no,42,161213,55\no,45,170510,58\no,46,170622,59\no,47,170809,60\no,48,170927,61\no,50,180104,63\no,51,180207,64\no,52,180322,65\no,54,180628,67\no,55,180816,68\no,56,180925,69\no,57,181128,70\no,58,190123,71\no,60,190409,73\no,62,190627,75\no,64,191007,77\no,65,191113,78\no,66,200107,79\no,69,200624,83\no,76,210428,90\no,77,210609,91\no,78,210803,92\no,80,211005,94\no,81,211104,95\no,86,220420,100\no,88,220608,102\no,89,220707,103\no,96,230222,110\no,99,230516,113\no,100,230629,114\no,102,230823,116\no,108,240305,122\no,112,240711,126\no,114,240925,128\no,116,250108,131\no,117,250213,132\no,119,250513,134\no,123,251028,139\no,126,260108,142\no,127,260202,143\no,128,260226,144\no,133,260629,149\no,134,260806,150\no,135,260820,151\no,137,u,153\noa,15,130708,28\noa,16,130918,29\noa,18,131120,31\noa,19,140128,32\noa,20,140306,33\noa,21,140422,34\noa,22,140617,35\noa,24,140910,37\noa,26,141202,39\noa,27,150129,40\noa,28,150310,41\noa,29,150428,42\noa,30,150610,43\noa,33,151103,46\noa,34,151216,47\noa,35,160204,48\noa,36,160331,49\noa,37,160616,50\noa,42,170121,55\noa,44,171211,60\noa,45,180215,61\noa,48,181108,69\noa,49,181207,70\noa,50,190218,71\noa,51,190321,72\noa,52,190517,73\noa,53,190711,74\noa,55,191203,77\noa,56,200206,78\noa,59,200630,83\noa,64,210525,91\noa,65,211020,92\noa,69,220509,100\noa,76,230626,114\noa,85,241029,128\noa,87,250122,132\noa,94,260113,143\noa,95,260211,144\noa,100,260701,149\noa,101,260826,151\nsa,1.5,130925,28\nsa,1.6,140411,28\nsa,2.0,141017,34\nsa,2.1,150107,34\nsa,3.2,150824,38\nsa,4.2,160802,44\nsa,5.0,161215,51\nsa,5.2,170421,51\nsa,5.4,170517,51\nsa,6.2,171026,56\nsa,6.4,180219,56\nsa,7.2,180620,59\nsa,7.4,180912,59\nsa,8.2,181221,63\nsa,9.2,190402,67\nsa,9.4,190725,67\nsa,10.0,190822,71\nsa,10.2,191009,71\nsa,11.0,191205,75\nsa,11.2,200322,75\nsa,12.1,200707,79\nsa,13.2,210120,83\nsa,14.2,210625,87\nsa,16.0,211125,92\nsa,16.2,220306,92\nsa,18.1,220909,99\nsa,19.1,221108,102\nsa,26.0,240607,122\nwva,4.4,131209,30\nwva,4.4.3,140602,33\nwva,37,140903,37\nwva,39,141112,39\nwva,40,150121,40\nwva,41,150311,41\nwva,42,150415,42\nwva,43,150527,43\nwva,45,150901,45\nwva,46,151014,46\nwva,47,151202,47\nwva,48,160126,48\nwva,49,160309,49\nwva,50,160413,50\nwva,51,160608,51\nwva,52,160727,52\nwva,54,161019,54\nwva,55,161206,55\nwva,58,170425,58\nwva,59,170606,59\nwva,60,170801,60\nwva,61,170905,61\nwva,63,171205,63\nwva,64,180123,64\nwva,65,180306,65\nwva,67,180531,67\nwva,68,180724,68\nwva,69,180904,69\nwva,70,181017,70\nwva,71,181204,71\nwva,72,190129,72\nwva,73,190312,73\nwva,74,190424,74\nwva,75,190604,75\nwva,77,190910,77\nwva,78,191022,78\nwva,79,191217,79\nwva,83,200519,83\nwva,90,210413,90\nwva,91,210525,91\nwva,92,210720,92\nwva,94,210921,94\nwva,95,211019,95\nwva,100,220329,100\nwva,102,220524,102\nwva,103,220621,103\nwva,110,230207,110\nwva,113,230502,113\nwva,114,230530,114\nwva,116,230815,116\nwva,122,240220,122\nwva,126,240611,126\nwva,128,240820,128\nwva,129,240917,129\nwva,131,241112,131\nwva,132,250114,132\nwva,134,250304,134\nwva,139,250805,139\nwva,142,251028,142\nwva,143,251202,143\nwva,144,260113,144\nwva,149,260602,149\nwva,150,260630,150\nwva,151,260728,151\nwva,153,260908,153\nwva,154,260922,154\ny,1.0,u,25\ny,1.5,u,22\ny,1.6,u,25\ny,1.7,u,25\ny,1.20,u,25\ny,2.5,u,25\ny,3.2,u,25\ny,4.6,u,25\ny,5.3,u,25\ny,5.4,u,25\ny,7.4,u,25\ny,9.6,u,25\ny,10.5,u,25\ny,11.4,u,25\ny,11.5,u,25\ny,12.7,u,25\ny,13.9,u,28\ny,13.10,u,28\ny,13.11,u,28\ny,13.12,u,30\ny,14.2,u,32\ny,14.4,u,33\ny,14.5,u,34\ny,14.7,u,35\ny,14.8,u,36\ny,14.10,u,37\ny,15.2,u,40\ny,15.4,u,41\ny,15.6,u,42\ny,15.7,u,43\ny,15.10,u,45\ny,15.12,u,46\ny,16.2,u,47\ny,16.3,u,47\ny,16.4,u,49\ny,16.6,u,50\ny,16.7,u,51\ny,16.9,u,52\ny,16.11,u,54\ny,17.1,u,55\ny,17.6,u,58\ny,17.7,u,59\ny,17.9,u,60\ny,17.10,u,61\ny,18.1,u,63\ny,18.2,u,63\ny,18.3,u,64\ny,18.4,u,65\ny,18.7,u,67\ny,18.9,u,68\ny,18.10,u,69\ny,18.11,u,70\ny,19.1,u,71\ny,19.3,u,72\ny,19.4,u,73\ny,19.5,u,75\ny,19.6,u,75\ny,19.7,u,75\ny,19.10,u,77\ny,19.11,u,78\ny,19.12,u,78\ny,20.2,u,79\ny,20.6,u,81\ny,20.7,u,83\ny,21.2,u,88\ny,21.5,u,90\ny,21.6,210928,91\ny,21.8,210928,92\ny,21.11,211029,94\ny,22.4,u,92\ny,22.9,220827,104\ny,23.7,230706,114\ny,24.2,240325,120\ny,24.9,241001,126\ny,25.2,250424,132\ny,25.3,250423,132\ny,26.3,260304,144\ny,26.7,260723,149\ny,26.8,260801,150\nu,10.5,u,31\nu,10.7,u,31\nu,10.8,u,31\nu,10.10,u,31\nu,11.0,u,31\nu,11.2,u,40\nu,11.3,u,40\nu,11.4,u,40\nu,11.5,u,40\nu,11.8,u,57\nu,11.9,u,57\nu,12.0,u,57\nu,12.1,u,57\nu,12.2,u,57\nu,12.3,u,57\nu,12.4,u,57\nu,12.5,u,57\nu,12.6,u,57\nu,12.7,u,57\nu,12.8,u,57\nu,12.9,u,57\nu,12.10,u,57\nu,12.11,u,57\nu,12.12,u,57\nu,12.13,u,57\nu,12.14,u,57\nu,13.0,u,57\nu,13.1,u,57\nu,13.2,u,57\nu,13.4,210928,78\nu,13.5,230825,78\nu,13.6,231217,78\nu,13.7,230624,78\nu,13.8,220430,78\nu,13.9,220518,78\nu,15.0,220824,78\nu,15.1,221111,78\nu,15.2,230423,78\nu,15.4,231025,100\nu,15.5,230822,100\nu,16.0,230824,100\nu,16.1,231015,100\nu,16.2,231209,100\nu,16.3,240308,100\nu,16.4,241003,100\nu,16.5,240530,100\nu,16.6,240723,100\nu,17.0,240824,100\nu,17.1,240926,100\nu,17.2,241129,100\nu,17.3,250107,100\nu,17.4,250226,100\nu,17.5,250408,100\nu,17.7,250611,123\nu,17.8,250730,123\nu,18.0,250817,123\nu,18.1,251004,123\nu,18.2,251104,123\nu,18.3,251212,123\nu,18.4,260109,123\nu,18.5,260128,123\nu,18.6,260321,123\nu,18.8,260503,123\nu,18.9,260702,123\nu,18.10,260808,123\nu,19.0,260824,123\nq,6.0,u,37\nq,6.1,u,37\nq,6.2,u,37\nq,6.3,u,37\nq,6.4,u,37\nq,6.6,u,37\nq,6.7,u,37\nq,6.8,u,37\nq,6.9,u,37\nq,7.0,u,37\nq,7.1,u,37\nq,7.2,u,37\nq,7.3,u,37\nq,7.4,u,37\nq,7.5,u,37\nq,7.6,u,37\nq,7.7,u,37\nq,7.8,u,37\nq,7.9,u,37\nq,8.0,u,37\nq,8.2,u,57\nq,8.3,u,57\nq,8.4,u,57\nq,8.5,u,57\nq,8.6,u,57\nq,8.7,u,57\nq,8.8,u,57\nq,8.9,u,57\nq,9.1,u,57\nq,9.7,u,66\nq,9.8,u,66\nq,10.0,u,66\nq,10.1,u,66\nq,10.2,u,66\nq,10.3,u,66\nq,10.4,u,66\nq,10.5,u,66\nq,10.7,200909,66\nq,11.0,u,77\nq,11.2,210130,77\nq,11.3,210331,77\nq,11.9,u,89\nq,12.0,211104,89\nq,12.1,211105,89\nq,12.2,211207,89\nq,12.5,220407,89\nq,12.7,220521,89\nq,12.8,220630,89\nq,12.9,220726,89\nq,13.0,220815,89\nq,13.1,220910,89\nq,13.2,221026,89\nq,13.3,221109,89\nq,13.5,230206,98\nq,13.6,230209,98\nq,13.7,230421,98\nq,13.8,230421,98\nq,14.0,231212,98\nq,14.1,230716,98\nq,14.3,230913,109\nq,14.4,231031,109\nq,14.5,231112,109\nq,14.6,231224,109\nq,14.7,240118,109\nq,14.8,240304,109\nq,14.9,240409,109\nq,15.0,240417,109\nq,15.1,240518,109\nq,15.2,241024,109\nq,15.3,240728,109\nq,15.4,240907,109\nq,15.5,240924,109\nq,15.6,241024,109\nq,15.7,241203,109\nq,15.8,241211,109\nq,15.9,250201,109\nq,19.2,250715,121\nq,19.3,250831,121\nq,19.4,250920,121\nq,19.5,251023,121\nq,19.6,251117,121\nq,19.7,251218,121\nq,19.8,260120,121\nq,19.9,260309,121\nq,20.0,260406,121\nq,20.1,260430,121\nq,20.2,260610,121\nq,20.3,260617,121\nq,20.4,260728,121\nq,20.5,260817,121\nk,1.0,170301,37\nk,2.5,170701,48\nk,3.1,220301,84\nfb,68,u,48\nfb,74,u,50\nfb,75,u,50\nfb,76,u,50\nfb,77,u,50\nfb,78,u,50\nfb,79,u,50\nfb,80,u,51\nfb,81,u,51\nfb,82,u,51\nfb,83,u,51\nfb,84,u,51\nfb,86,u,51\nfb,87,u,52\nfb,88,u,52\nfb,89,u,52\nfb,90,u,52\nfb,91,u,52\nfb,92,u,52\nfb,93,u,52\nfb,94,u,52\nfb,96,u,53\nfb,97,u,53\nfb,98,u,53\nfb,99,u,53\nfb,100,u,54\nfb,101,u,54\nfb,103,u,54\nfb,104,u,54\nfb,105,u,54\nfb,106,u,55\nfb,107,u,55\nfb,108,u,55\nfb,109,u,55\nfb,110,u,55\nfb,111,u,55\nfb,113,u,56\nfb,114,u,56\nfb,115,u,56\nfb,116,u,56\nfb,118,u,57\nfb,119,u,57\nfb,120,u,57\nfb,121,u,57\nfb,122,u,58\nfb,123,u,58\nfb,124,u,58\nfb,125,u,58\nfb,126,u,58\nfb,127,u,58\nfb,128,u,58\nfb,129,u,58\nfb,130,u,59\nfb,131,u,59\nfb,132,u,59\nfb,133,u,59\nfb,134,u,59\nfb,135,u,59\nfb,136,u,59\nfb,137,u,59\nfb,138,u,60\nfb,140,u,60\nfb,142,u,61\nfb,143,u,61\nfb,144,u,61\nfb,145,u,61\nfb,146,u,61\nfb,147,u,61\nfb,148,u,61\nfb,150,u,62\nfb,151,u,62\nfb,152,u,62\nfb,153,u,63\nfb,154,u,63\nfb,155,u,63\nfb,156,u,63\nfb,157,u,64\nfb,158,u,64\nfb,159,u,64\nfb,160,u,64\nfb,161,u,64\nfb,162,u,64\nfb,163,u,65\nfb,164,u,65\nfb,165,u,65\nfb,166,u,65\nfb,167,u,65\nfb,168,u,65\nfb,170,u,66\nfb,171,u,66\nfb,172,u,66\nfb,173,u,66\nfb,174,u,66\nfb,175,u,67\nfb,176,u,67\nfb,177,u,67\nfb,178,u,67\nfb,180,u,67\nfb,181,u,67\nfb,182,u,67\nfb,183,u,68\nfb,184,u,68\nfb,185,u,68\nfb,186,u,68\nfb,187,u,68\nfb,188,u,68\nfb,202,u,71\nfb,227,u,75\nfb,228,u,75\nfb,229,u,75\nfb,230,u,75\nfb,231,u,75\nfb,235,u,76\nfb,236,u,76\nfb,237,u,76\nfb,238,u,76\nfb,240,u,77\nfb,241,u,77\nfb,242,u,77\nfb,243,u,77\nfb,244,u,78\nfb,245,u,78\nfb,246,u,78\nfb,247,u,78\nfb,248,u,78\nfb,249,u,78\nfb,250,u,78\nfb,251,u,79\nfb,252,u,79\nfb,253,u,79\nfb,254,u,79\nfb,255,u,79\nfb,257,u,80\nfb,258,u,80\nfb,259,u,80\nfb,260,u,80\nfb,261,u,80\nfb,262,u,80\nfb,263,u,80\nfb,264,u,80\nfb,265,u,80\nfb,267,u,81\nfb,268,u,81\nfb,269,u,81\nfb,270,u,81\nfb,271,u,81\nfb,272,u,83\nfb,273,u,83\nfb,274,u,83\nfb,275,u,83\nfb,400,230210,109\nfb,436,231013,117\nfb,438,231028,118\nfb,440,231112,119\nfb,441,231120,119\nfb,442,231129,119\nfb,444,231213,120\nfb,445,231221,120\nfb,446,240106,120\nfb,447,240112,120\nfb,449,240202,121\nfb,450,240205,121\nfb,451,240217,121\nfb,452,240225,122\nfb,453,240228,122\nfb,454,240304,122\nfb,466,u,126\nfb,469,u,126\nfb,471,240710,126\nfb,472,240711,126\nfb,475,240801,127\nfb,476,240809,127\nfb,477,240816,127\nfb,478,240821,128\nfb,479,240831,128\nfb,480,240907,128\nfb,481,240914,128\nfb,482,240920,129\nfb,483,240927,129\nfb,484,241004,129\nfb,485,241011,129\nfb,487,241026,130\nfb,488,241102,130\nfb,489,241109,130\nfb,494,241226,131\nfb,497,250126,132\nia,24,u,62\nia,25,u,62\nia,26,u,63\nia,27,u,63\nia,28,u,63\nia,29,u,63\nia,30,u,63\nia,31,u,64\nia,32,u,64\nia,33,u,64\nia,34,u,64\nia,35,u,65\nia,36,u,65\nia,37,u,65\nia,38,u,65\nia,39,u,65\nia,40,u,65\nia,41,u,65\nia,43,u,66\nia,44,u,66\nia,45,u,66\nia,46,u,66\nia,47,u,66\nia,48,u,67\nia,49,u,67\nia,50,u,67\nia,51,u,67\nia,52,u,67\nia,53,u,67\nia,54,u,67\nia,55,u,67\nia,56,u,68\nia,57,u,68\nia,58,u,68\nia,59,u,68\nia,60,u,68\nia,61,u,68\nia,65,u,69\nia,66,u,69\nia,68,u,69\nia,72,u,70\nia,74,u,71\nia,75,u,71\nia,79,u,71\nia,81,u,72\nia,82,u,72\nia,83,u,72\nia,84,u,73\nia,86,u,73\nia,95,u,74\nia,97,u,80\nia,98,u,80\nia,103,u,80\nia,104,u,80\nia,117,u,80\nia,118,u,80\nia,119,u,80\nia,120,u,80\nia,121,u,80\nia,127,u,80\nia,128,u,80\nia,129,u,80\nia,130,u,80\nia,131,u,80\nia,132,u,80\nia,133,u,80\nia,134,u,80\nia,135,u,80\nia,136,u,80\nia,138,u,81\nia,139,u,81\nia,140,u,81\nia,141,u,81\nia,142,u,81\nia,143,u,83\nia,144,u,83\nia,145,u,83\nia,146,u,83\nia,164,u,92\nia,230,u,92\nia,259,221104,106\nia,281,u,109\nia,289,231221,114\nia,290,231230,114\nia,295,u,115\nia,296,u,115\nia,297,u,115\nia,298,240111,115\nia,299,u,115\nia,300,u,116\nia,301,240112,116\nia,303,u,117\nia,304,u,117\nia,305,u,117\nia,307,u,118\nia,308,240119,118\nia,310,u,119\nia,312,u,120\nia,313,u,120\nia,314,u,120\nia,315,240119,120\nia,316,240125,120\nia,318,240216,121\nia,320,240304,121\nia,321,240307,122\nia,347,240911,127\nia,349,240920,128\nia,366,u,132\nia,367,250215,132\nia,382,250619,137\nia,383,250618,137\nia,384,250616,137\nia,385,250627,137\nia,387,250709,137\nia,392,250812,138\nia,394,250826,139\nia,395,250913,139\nia,396,250920,139\nia,397,250919,139\nia,401,251008,141\nia,404,251031,141\nia,406,251116,141\nia,407,251123,142\nia,408,251128,142\nia,409,251216,143\nia,410,251217,143\nia,411,260107,143\nia,438,260722,150\nia,443,260821,151\nia,444,260827,151\n".split("\n").forEach(n=>{if(n=n.trim())if("releases"!==n){if(f){const a=n.split(",");if(a.length>=3){const[n,u,o,f]=a,i=[n,u,e(o.trim())];f&&i.push(f.trim()),s[n]||(s[n]=[]),s[n].push(i)}return}if(n.startsWith("20")||n.startsWith("pre_baseline"))return o=e(n),void(u[o]=[]);{const a=n.split(",");if(a.length>=3){const[n,s,f,i]=a,r=[n,s,e(f.trim())];if(i&&r.push(i.trim()),!u[o])throw new Error(`Timeline entry for date ${o} is undefined. This should not happen.`);u[o].push(r)}}}else f=!0});const i={};Object.keys(a).forEach(n=>{var a;i[n]=[...null!==(a=s[n])&&void 0!==a?a:[]]}),Object.keys(u).forEach(n=>{u[n].forEach(n=>{const a=n[0];i[a]&&(i[a].some(a=>a[1]===n[1])||i[a].push(n))})}),Object.keys(i).forEach(a=>{i[a].sort((a,e)=>n(a[1],e[1]))});let r=!1;const c=Object.keys(a).filter(n=>void 0===a[n].engine).map(n=>{const{longName:e}=a[n];return{shortName:n,longName:e}}),t=["webview_android","samsunginternet_android","opera_android","opera","ya_android","uc_android","qq_android","kai_os","facebook_android","instagram_android"],b=a=>{const e=[],u=[];return a.forEach(n=>{c.some(a=>a.longName===n.browser)?e.push(n):u.push(n)}),e.sort((a,e)=>a.browsere.browser?1:n(a.version,e.version)),u.sort((a,e)=>{const u=t.indexOf(a.browser),s=t.indexOf(e.browser);return u!==s?u-s:n(a.version,e.version)}),[...e,...u]};let l=!1;const w=n=>{if(!1===n.includeDownstreamBrowsers&&!0===n.includeKaiOS)throw new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.")},v=(n,e,u,s,o)=>{var f;const i={browser:e,version:u,release_date:"u"===s?"unknown":s};return o&&(i.engine_version=o,i.engine=null===(f=a[n])||void 0===f?void 0:f.engine),i};function y(e){var s,o,f,t,y,p,d;let g=null!=e?e:{},q={listAllCompatibleVersions:null!==(s=g.listAllCompatibleVersions)&&void 0!==s&&s,includeDownstreamBrowsers:null!==(o=g.includeDownstreamBrowsers)&&void 0!==o&&o,widelyAvailableOnDate:null!==(f=g.widelyAvailableOnDate)&&void 0!==f?f:void 0,targetYear:null!==(t=g.targetYear)&&void 0!==t?t:void 0,includeKaiOS:null!==(y=g.includeKaiOS)&&void 0!==y&&y,overrideLastUpdated:null!==(p=g.overrideLastUpdated)&&void 0!==p?p:void 0,suppressWarnings:null!==(d=g.suppressWarnings)&&void 0!==d&&d},m=new Date;if(q.widelyAvailableOnDate||q.targetYear){if(q.targetYear&&q.widelyAvailableOnDate)throw new Error("You cannot use targetYear and widelyAvailableOnDate at the same time. Please remove one of these options and try again.");q.widelyAvailableOnDate?m=new Date(q.widelyAvailableOnDate):q.targetYear&&(m=new Date(`${q.targetYear}-12-31`))}else m=new Date;if((q.widelyAvailableOnDate||void 0===q.targetYear)&&m.setMonth(m.getMonth()-30),!q.suppressWarnings){if(((n,a)=>{if(r||"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST_IGNORE_OLD_DATA||process.env.BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA))return;const e=new Date;e.setMonth(e.getMonth()-2),n>e&&(null!=a?a:1788456871688)(new Date).getFullYear())throw new Error("There are no browser versions compatible with Baseline in the future")}const h=m{_[n]=void 0}),Object.keys(u).forEach(n=>{const a=u[n];let e=!1;e="pre_baseline"===n||new Date(n)<=m,e&&a.forEach(a=>{const e=a[0];"pre_baseline"!==n&&(_[e]=a)})});const O=[];return Object.keys(a).forEach(e=>{var u,s;const{longName:o}=a[e];if(!q.includeKaiOS&&"k"===e)return;const f=c.some(n=>n.shortName===e);if(q.includeDownstreamBrowsers||f)if(h)if(q.listAllCompatibleVersions){O.push({browser:o,version:"0",release_date:""});(null!==(u=i[e])&&void 0!==u?u:[]).forEach(n=>{O.push(v(e,o,n[1],n[2],n[3]))})}else O.push({browser:o,version:"0",release_date:""});else{const a=_[e];if(!a)return;const u=a[1];if(q.listAllCompatibleVersions){(null!==(s=i[e])&&void 0!==s?s:[]).forEach(a=>{const s=a[1];n(s,u)>=0&&O.push(v(e,o,s,a[2],a[3]))})}else O.push(v(e,o,u,a[2],a[3]))}}),b(O)}exports._resetHasWarned=function(){r=!1},exports.getAllVersions=function(a){var e,u,s,o,f;l=!0;let i=null!=a?a:{},r={outputFormat:null!==(e=i.outputFormat)&&void 0!==e?e:"array",includeDownstreamBrowsers:null!==(u=i.includeDownstreamBrowsers)&&void 0!==u&&u,useSupports:null!==(s=i.useSupports)&&void 0!==s&&s,includeKaiOS:null!==(o=i.includeKaiOS)&&void 0!==o&&o,suppressWarnings:null!==(f=i.suppressWarnings)&&void 0!==f&&f};w(r);let t=(new Date).getFullYear()+1;const b=[...Array(t).keys()].slice(2015),v={};b.forEach(n=>{v[n]={},y({targetYear:n,suppressWarnings:r.suppressWarnings}).forEach(a=>{v[n]&&(v[n][a.browser]=a)})});const p=y({suppressWarnings:r.suppressWarnings}),d={};p.forEach(n=>{d[n.browser]=n});const g=new Date;g.setMonth(g.getMonth()+30);const q=y({widelyAvailableOnDate:g.toISOString().slice(0,10),suppressWarnings:r.suppressWarnings}),m={};q.forEach(n=>{m[n.browser]=n});const h=y({targetYear:2002,listAllCompatibleVersions:!0,suppressWarnings:r.suppressWarnings}),_=[];if(c.map(n=>n.longName).forEach(a=>{var e,u,s,o;let f=h.filter(n=>n.browser==a).sort((a,e)=>n(a.version,e.version)),i=null!==(u=null===(e=d[a])||void 0===e?void 0:e.version)&&void 0!==u?u:"0",c=null!==(o=null===(s=m[a])||void 0===s?void 0:s.version)&&void 0!==o?o:"0";b.forEach(e=>{var u;if(v[e]){let s=(null!==(u=v[e][a])&&void 0!==u?u:{version:"0"}).version,o=f.findIndex(a=>0===n(a.version,s));(e===t-1?f:f.slice(0,o)).forEach(a=>{let u=n(a.version,i)>=0,s=n(a.version,c)>=0,o=Object.assign(Object.assign({},a),{year:e<=2015?"pre_baseline":e-1});r.useSupports?(u&&(o.supports="widely"),s&&(o.supports="newly")):o=Object.assign(Object.assign({},o),{wa_compatible:u}),_.push(o)}),f=f.slice(o,f.length)}})}),r.includeDownstreamBrowsers){y({targetYear:2002,listAllCompatibleVersions:!0,includeDownstreamBrowsers:!0,includeKaiOS:r.includeKaiOS,suppressWarnings:r.suppressWarnings}).filter(n=>!c.map(n=>n.longName).includes(n.browser)).forEach(n=>{const a="Gecko"===n.engine?"firefox":"chrome";let e=_.find(e=>e.browser===a&&e.version===n.engine_version);e&&(r.useSupports?_.push(Object.assign(Object.assign({},n),{year:e.year,supports:e.supports})):_.push(Object.assign(Object.assign({},n),{year:e.year,wa_compatible:e.wa_compatible})))})}if(_.sort((a,e)=>{if("pre_baseline"===a.year&&"pre_baseline"!==e.year)return-1;if("pre_baseline"===e.year&&"pre_baseline"!==a.year)return 1;if("pre_baseline"!==a.year&&"pre_baseline"!==e.year){if(a.yeare.year)return 1}return a.browsere.browser?1:n(a.version,e.version)}),"object"===r.outputFormat){const n={};return _.forEach(a=>{n[a.browser]||(n[a.browser]={});let e={year:a.year,release_date:a.release_date,engine:a.engine,engine_version:a.engine_version};n[a.browser][a.version]=r.useSupports?a.supports?Object.assign(Object.assign({},e),{supports:a.supports}):e:Object.assign(Object.assign({},e),{wa_compatible:a.wa_compatible})}),null!=n?n:{}}if("csv"===r.outputFormat){let n=`"browser","version","year","${r.useSupports?"supports":"wa_compatible"}","release_date","engine","engine_version"`;return _.forEach(a=>{var e,u,s,o;let f={browser:a.browser,version:a.version,year:a.year,release_date:null!==(e=a.release_date)&&void 0!==e?e:"NULL",engine:null!==(u=a.engine)&&void 0!==u?u:"NULL",engine_version:null!==(s=a.engine_version)&&void 0!==s?s:"NULL"};f=r.useSupports?Object.assign(Object.assign({},f),{supports:null!==(o=a.supports)&&void 0!==o?o:""}):Object.assign(Object.assign({},f),{wa_compatible:a.wa_compatible}),n+=`\n"${f.browser}","${f.version}","${f.year}","${r.useSupports?f.supports:f.wa_compatible}","${f.release_date}","${f.engine}","${f.engine_version}"`}),n}return _},exports.getCompatibleVersions=y,exports.getTimeline=function(n){var e,s,o,f;const i=null!=n?n:{},r=null!==(e=i.groupBy)&&void 0!==e?e:"date",t=null!==(s=i.listAllBrowsers)&&void 0!==s&&s,l=null!==(o=i.includeDownstreamBrowsers)&&void 0!==o&&o,w=null!==(f=i.includeKaiOS)&&void 0!==f&&f;if(!1===l&&!0===w)throw new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.");const y={},p=[];if(Object.keys(u).forEach(n=>{const e=u[n];if("pre_baseline"===n)return;const s=new Set;e.forEach(n=>{const a=n[0],e=y[a],u=n[1];e&&e[1]===u||s.add(a),y[a]=n});const o=[];if(Object.keys(a).forEach(n=>{const{longName:e}=a[n];if(!w&&"k"===n)return;const u=c.some(a=>a.shortName===n);if(!l&&!u)return;const f=s.has(n);if(t||f){const a=y[n];a&&o.push(v(n,e,a[1],a[2],a[3]))}}),o.length>0){const a=b(o);p.push({date:n,browsers:a})}}),"browser"===r){const n={};return Object.keys(a).forEach(e=>{const{longName:u}=a[e];if(!w&&"k"===e)return;const s=c.some(n=>n.shortName===e);(l||s)&&(n[u]=[])}),p.forEach(a=>{a.browsers.forEach(e=>{const{browser:u}=e,s=function(n,a){var e={};for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&a.indexOf(u)<0&&(e[u]=n[u]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(u=Object.getOwnPropertySymbols(n);s{if(n===a)return 0;const[e=0,u=0]=n.split(".",2).map(Number),[s=0,o=0]=a.split(".",2).map(Number);if(isNaN(e)||isNaN(u))throw new Error(`Invalid version: ${n}`);if(isNaN(s)||isNaN(o))throw new Error(`Invalid version: ${a}`);return e!==s?e>s?1:-1:u!==o?u>o?1:-1:0},a={c:{longName:"chrome"},ca:{longName:"chrome_android"},e:{longName:"edge"},f:{longName:"firefox"},fa:{longName:"firefox_android"},s:{longName:"safari"},si:{longName:"safari_ios"},o:{longName:"opera",engine:"Blink"},oa:{longName:"opera_android",engine:"Blink"},sa:{longName:"samsunginternet_android",engine:"Blink"},wva:{longName:"webview_android",engine:"Blink"},y:{longName:"ya_android",engine:"Blink"},u:{longName:"uc_android",engine:"Blink"},q:{longName:"qq_android",engine:"Blink"},k:{longName:"kai_os",engine:"Gecko"},fb:{longName:"facebook_android",engine:"Blink"},ia:{longName:"instagram_android",engine:"Blink"}},e=n=>6===n.length&&/^\d{6}$/.test(n)?`20${n.slice(0,2)}-${n.slice(2,4)}-${n.slice(4,6)}`:8===n.length&&/^\d{8}$/.test(n)?`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6,8)}`:n,u={},s={};let o="",f=!1;"pre_baseline\nc,1,081211\nc,2,090521\nc,3,090915\nc,4,100125\nc,5,100525\nc,6,100902\nc,7,101019\nc,8,101202\nc,9,110203\nc,10,110308\nc,11,110427\nc,12,110607\nc,13,110802\nc,14,110916\nc,15,111025\nc,16,111213\nc,17,120208\nc,18,120328\nc,19,120515\nc,20,120626\nc,21,120731\nc,22,120925\nc,23,121106\nc,24,130110\nc,25,130221\nc,26,130326\nc,27,130521\nc,28,130709\nc,29,130820\nc,30,131001\nc,31,131112\nc,32,140114\nc,33,140220\nc,34,140408\nc,35,140520\nc,36,140716\nc,37,140826\nc,38,141007\nc,39,141118\nc,40,150121\nc,41,150303\nc,42,150414\nc,43,150519\nc,44,150721\nca,18,120627\nca,25,130227\nca,26,130403\nca,27,130522\nca,28,130710\nca,29,130821\nca,30,131002\nca,31,131114\nca,32,140115\nca,33,140226\nca,34,140402\nca,35,140520\nca,36,140716\nca,37,140903\nca,38,141008\nca,39,141112\nca,40,150121\nca,41,150311\nca,42,150415\nca,43,150527\nf,1,041109\nf,1.5,051129\nf,2,061024\nf,3,080617\nf,3.5,090630\nf,3.6,100121\nf,4,110322\nf,5,110621\nf,6,110816\nf,7,110927\nf,8,111108\nf,9,111220\nf,10,120131\nf,11,120313\nf,12,120424\nf,13,120605\nf,14,120717\nf,15,120828\nf,16,121009\nf,17,121120\nf,18,130108\nf,19,130219\nf,20,130402\nf,21,130514\nf,22,130625\nf,23,130806\nf,24,130917\nf,25,131029\nf,26,131210\nf,27,140204\nf,28,140318\nf,29,140429\nf,30,140610\nf,31,140722\nf,32,140902\nf,33,141014\nf,34,141201\nf,35,150113\nf,36,150224\nf,37,150331\nf,38,150512\nf,39,150702\nfa,4,110329\nfa,5,110621\nfa,6,110816\nfa,7,110927\nfa,8,111108\nfa,9,111221\nfa,10,120131\nfa,14,120626\nfa,15,120828\nfa,16,121009\nfa,17,121120\nfa,18,130108\nfa,19,130219\nfa,20,130402\nfa,21,130514\nfa,22,130625\nfa,23,130806\nfa,24,130917\nfa,25,131029\nfa,26,131210\nfa,27,140204\nfa,28,140318\nfa,29,140429\nfa,30,140610\nfa,31,140722\nfa,32,140902\nfa,33,141014\nfa,34,141201\nfa,35,150113\nfa,36,150227\nfa,37,150331\nfa,38,150512\nfa,39,150702\ns,1,030623\ns,1.1,031024\ns,1.2,040202\ns,1.3,050415\ns,2,050429\ns,3,071026\ns,3.1,080318\ns,4,090608\ns,5,100607\ns,5.1,110720\ns,6,120725\ns,7,131022\ns,8,141016\nsi,1,070629\nsi,2,080711\nsi,3,090617\nsi,3.2,100403\nsi,4,100621\nsi,4.2,101122\nsi,5,111012\nsi,6,120910\nsi,7,130918\nsi,8,140917\n20150729\nc,38,141007\nca,38,141008\ne,12,150729\nf,38,150512\nfa,38,150512\ns,11,170919\nsi,11,170919\no,25,141015,38\noa,25,141016,38\nsa,3.0,150410,38\nwva,38,141008,38\ny,14.12,u,38\nu,11.1,u,40\nq,8.1,u,57\nk,2.0,170701,48\nfb,66,u,48\nia,23,u,62\n20150922\nf,41,150922\nfa,41,150922\n20150930\nc,44,150721\nca,44,150729\no,31,150804,44\noa,32,150923,45\nsa,4.0,160311,44\nwva,44,150729,44\ny,15.9,u,44\nu,11.6,u,57\n20151112\ne,13,151112\n20151231\nc,44,150721\nca,44,150729\ne,13,151112\nf,41,150922\nfa,41,150922\ns,11,170919\nsi,11,170919\no,31,150804,44\noa,32,150923,45\nsa,4.0,160311,44\nwva,44,150729,44\ny,15.9,u,44\nu,11.6,u,57\nq,8.1,u,57\nk,2.0,170701,48\nfb,66,u,48\nia,23,u,62\n20160308\nf,45,160308\nfa,45,160308\n20160607\nf,47,160607\nfa,47,160607\n20160802\ne,14,160802\n20160907\nc,53,160831\nca,53,160907\no,40,160920,53\noa,41,161025,54\nsa,6.0,170823,56\nwva,53,160907,53\ny,16.10,u,53\nfb,95,u,53\n20160920\nf,49,160920\nfa,49,160920\nk,3.0,210901,84\n20161231\nc,53,160831\nca,53,160907\ne,14,160802\nf,49,160920\nfa,49,160920\ns,11,170919\nsi,11,170919\no,40,160920,53\noa,41,161025,54\nsa,6.0,170823,56\nwva,53,160907,53\ny,16.10,u,53\nu,11.6,u,57\nq,8.1,u,57\nk,3.0,210901,84\nfb,95,u,53\nia,23,u,62\n20170201\nc,56,170125\nca,56,170201\nf,50,161115\nfa,50,161115\no,43,170207,56\noa,43,170927,59\nwva,56,170201,56\ny,17.3,u,56\nfb,112,u,56\n20170307\nf,52,170307\nfa,52,170307\n20170316\nca,57,170316\n20170405\nc,57,170309\ne,15,170405\no,44,170321,57\nsa,7.0,180316,59\nwva,57,170316,57\ny,17.4,u,57\nfb,117,u,57\n20170419\nf,53,170419\nfa,53,170419\n20170928\nfa,56,170928\n20171017\ne,16,171017\n20171024\nc,62,171017\nca,62,171024\no,49,171108,62\noa,46,180514,63\nsa,8.0,180718,63\nwva,62,171024,62\ny,17.11,u,62\nu,13.3,200909,78\nq,9.6,u,66\nfb,149,u,62\n20171128\nfa,57,171128\n20171231\nc,62,171017\nca,62,171024\ne,16,171017\nf,53,170419\nfa,57,171128\ns,11,170919\nsi,11,170919\no,49,171108,62\noa,46,180514,63\nsa,8.0,180718,63\nwva,62,171024,62\ny,17.11,u,62\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,149,u,62\nia,23,u,62\n20180412\ns,11.1,180412\nsi,11.3,180329\n20180430\ne,17,180430\n20180509\nc,66,180417\nca,66,180417\nf,60,180509\nfa,60,180509\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nfb,169,u,66\nia,42,u,66\n20180905\nf,62,180905\nfa,62,180905\n20181002\ne,18,181002\n20181023\nf,63,181023\nfa,63,181023\n20181211\nf,64,181211\nfa,64,181211\n20181231\nc,66,180417\nca,66,180417\ne,18,181002\nf,64,181211\nfa,64,181211\ns,11.1,180412\nsi,11.3,180329\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,169,u,66\nia,42,u,66\n20190129\nf,65,190129\nfa,65,190129\n20190325\ns,12.1,190325\nsi,12.2,190325\n20190919\ns,13,190919\nsi,13,190919\n20191231\nc,66,180417\nca,66,180417\ne,18,181002\nf,65,190129\nfa,65,190129\ns,13,190919\nsi,13,190919\no,53,180510,66\noa,47,180723,66\nsa,9.0,180915,67\nwva,66,180417,66\ny,18.6,u,66\nu,13.3,200909,78\nq,9.6,u,66\nk,3.0,210901,84\nfb,169,u,66\nia,42,u,66\n20200115\nc,76,190730\nca,76,190730\ne,79,200115\nf,68,190709\nfa,68,190709\no,63,190820,76\noa,54,191018,76\nsa,12.0,200619,79\nwva,76,190730,76\ny,19.9,u,76\nq,10.9,201122,77\nfb,233,u,76\nia,96,u,80\n20200204\nc,80,200204\nca,80,200204\no,67,200303,80\noa,57,200330,80\nsa,13.0,201202,83\nwva,80,200204,80\ny,20.3,u,80\nu,15.3,230317,100\nq,11.7,211102,89\nfb,256,u,80\n20200207\ne,80,200207\n20200324\ns,13.1,200324\nsi,13.4,200324\n20200413\nc,81,200407\nca,81,200407\ne,81,200413\no,68,200422,81\noa,58,200513,81\nwva,81,200407,81\ny,20.4,u,81\nfb,266,u,81\nia,137,u,81\n20200727\nc,84,200727\nca,84,200727\ne,84,200716\no,70,200727,84\noa,60,200923,85\nsa,14.0,210417,87\nwva,84,200727,84\ny,20.8,200902,84\nfb,297,201202,86\nia,153,u,84\n20200728\nf,78,200630\nfa,79,200728\n20200827\nc,85,200825\nca,85,200825\ne,85,200827\no,71,200915,85\nwva,85,200825,85\ny,20.9,200927,85\nia,163,u,92\n20200916\nf,79,200728\ns,14,200916\nsi,14,200916\n20201020\nc,86,201020\nca,86,201020\ne,86,201009\no,72,201021,86\noa,61,201207,86\nwva,86,201020,86\ny,20.11,201111,86\n20201117\nf,83,201117\nfa,83,201117\n20201119\nc,87,201117\nca,87,201117\ne,87,201119\no,73,201209,87\noa,62,210216,87\nwva,87,201117,87\ny,20.12,201220,87\nfb,348,211219,96\n20201231\nc,87,201117\nca,87,201117\ne,87,201119\nf,83,201117\nfa,83,201117\ns,14,200916\nsi,14,200916\no,73,201209,87\noa,62,210216,87\nsa,14.0,210417,87\nwva,87,201117,87\ny,20.12,201220,87\nu,15.3,230317,100\nq,11.7,211102,89\nk,3.0,210901,84\nfb,348,211219,96\nia,163,u,92\n20210121\nc,88,210119\nca,88,210119\ne,88,210121\nf,84,201215\nfa,84,201215\no,74,210202,88\noa,63,210416,89\nsa,15.0,210813,90\nwva,88,210119,88\ny,21.1,211231,88\n20210126\nf,85,210126\nfa,85,210126\nk,4.0,250501,123\n20210426\nc,89,210302\nca,89,210302\ne,89,210304\nf,86,210223\nfa,86,210223\ns,14.1,210426\nsi,14.5,210426\no,75,210324,89\nwva,89,210302,89\ny,21.3,210404,89\n20210810\nf,91,210810\nfa,91,210810\n20210902\ne,93,210902\n20210907\nf,92,210907\nfa,92,210907\n20210920\nc,93,210831\nca,93,210831\ns,15,210920\nsi,15,210920\no,79,210914,93\noa,66,211215,94\nsa,17.0,220504,96\nwva,93,210831,93\ny,21.9,210929,93\nq,13.4,230426,98\nia,258,221104,106\n20211005\nf,93,211005\nfa,93,211005\n20211025\ns,15.1,211025\nsi,15.1,211025\n20211102\nf,94,211102\nfa,94,211102\n20211119\nc,96,211115\nca,96,211115\ne,96,211119\no,82,211202,96\noa,67,220131,96\nwva,96,211115,96\ny,22.1,211231,96\n20211207\nf,95,211207\n20211213\ns,15.2,211213\nsi,15.2,211213\n20211231\nc,96,211115\nca,96,211115\ne,96,211119\nf,95,211207\nfa,94,211102\ns,15.2,211213\nsi,15.2,211213\no,82,211202,96\noa,67,220131,96\nsa,17.0,220504,96\nwva,96,211115,96\ny,22.1,211231,96\nu,15.3,230317,100\nq,13.4,230426,98\nk,4.0,250501,123\nfb,348,211219,96\nia,258,221104,106\n20220106\nc,97,220104\nca,97,220104\ne,97,220106\no,83,220119,97\noa,68,220330,99\nsa,18.0,220808,99\nwva,97,220104,97\ny,22.3,220325,98\nfb,399,230204,109\n20220203\nc,98,220201\nca,98,220201\ne,98,220203\nf,96,220111\nfa,96,220111\no,84,220216,98\nwva,98,220201,98\n20220303\nc,99,220301\nca,99,220301\ne,99,220303\no,85,220323,99\nwva,99,220301,99\ny,22.5,220520,100\nq,14.2,231014,109\n20220314\nf,98,220308\nfa,98,220308\ns,15.4,220314\nsi,15.4,220314\n20220428\nc,101,220426\nca,101,220426\ne,101,220428\no,87,220517,101\noa,70,220629,102\nsa,19.0,221101,102\nwva,101,220426,101\ny,22.7,220707,102\nu,17.6,250515,123\n20220503\nf,100,220503\nfa,100,220503\n20220531\nf,101,220531\nfa,101,220531\n20220628\nf,102,220628\nfa,102,220628\n20220726\nf,103,220726\nfa,103,220726\n20220805\nc,104,220802\nca,104,220802\ne,104,220805\no,90,220818,104\noa,71,220916,104\nsa,20.0,230210,106\nwva,104,220802,104\ny,22.8,u,104\n20220823\nf,104,220823\nfa,104,220823\n20220902\nc,105,220902\nca,105,220902\ne,105,220901\ns,15.6,220720\nsi,15.6,220720\no,91,220914,105\noa,72,221021,106\nwva,105,220902,105\ny,22.11,221111,106\n20220912\ns,16,220912\nsi,16,220912\n20221003\nc,106,220927\nca,106,220927\ne,106,221003\no,92,221019,106\nwva,106,220927,106\n20221027\nc,107,221025\nca,107,221025\ne,107,221027\no,93,221117,107\noa,73,230117,108\nsa,21.0,230519,110\nwva,107,221025,107\ny,23.1,230110,108\nia,279,231231,109\n20221115\nf,107,221115\nfa,107,221115\n20221205\nc,108,221129\nca,108,221129\ne,108,221205\no,94,221215,108\nwva,108,221129,108\n20221213\nf,108,221213\nfa,108,221213\n20221231\nc,108,221129\nca,108,221129\ne,108,221205\nf,108,221213\nfa,108,221213\ns,16,220912\nsi,16,220912\no,94,221215,108\noa,73,230117,108\nsa,21.0,230519,110\nwva,108,221129,108\ny,23.1,230110,108\nu,17.6,250515,123\nq,14.2,231014,109\nk,4.0,250501,123\nfb,399,230204,109\nia,279,231231,109\n20230112\nc,109,230110\nca,109,230110\ne,109,230112\no,95,230201,109\noa,74,230313,110\nwva,109,230110,109\ny,23.3,230326,110\n20230214\nf,110,230214\nfa,110,230214\n20230313\nc,111,230307\nca,111,230307\ne,111,230313\no,97,230322,111\noa,75,230517,112\nsa,22.0,230714,111\nwva,111,230301,111\ny,23.5,230519,112\nq,19.1,250708,121\nfb,420,230628,114\nia,288,u,114\n20230314\nf,111,230314\nfa,111,230314\n20230327\ns,16.4,230327\nsi,16.4,230327\n20230411\nf,112,230411\nfa,112,230411\n20230509\nf,113,230509\nfa,113,230509\n20230606\nf,114,230606\nfa,114,230606\n20230704\nc,112,230404\nca,112,230404\ne,112,230406\nf,115,230704\nfa,115,230704\no,98,230420,112\nsa,23.0,231018,115\nwva,112,230404,112\n20230721\nc,115,230718\nca,115,230721\ne,115,230721\no,101,230726,115\noa,77,230831,115\nwva,115,230721,115\ny,23.9,230913,116\nfb,430,230903,116\nia,292,u,115\n20230801\nf,116,230801\nfa,116,230801\n20230915\nc,117,230912\nca,117,230912\ne,117,230915\no,103,231003,117\noa,78,231023,117\nsa,24.0,240125,117\nwva,117,230912,117\ny,23.11,231115,118\nfb,434,231005,117\nia,302,u,117\n20230918\ns,17,230918\nsi,17,230918\n20231013\nc,118,231010\nca,118,231010\ne,118,231013\nf,118,230926\nfa,118,230926\no,104,231023,118\noa,79,231206,119\nsa,25.0,240424,121\nwva,118,231010,118\nfb,437,u,118\nia,306,240117,118\n20231024\nf,119,231024\nfa,119,231024\n20231102\nc,119,231031\nca,119,231031\ne,119,231102\no,105,231114,119\nwva,119,231031,119\ny,24.1,240118,120\nfb,439,231111,119\nia,309,u,119\n20231121\nf,120,231121\nfa,120,231121\n20231205\nca,120,231205\n20231207\nc,120,231205\ne,120,231207\no,106,231219,120\noa,80,240125,120\nwva,120,231205,120\nfb,443,231207,120\nia,311,u,120\n20231211\ns,17.2,231211\nsi,17.2,231211\n20231219\nf,121,231219\nfa,121,231219\n20231231\nc,120,231205\nca,120,231205\ne,120,231207\nf,121,231219\nfa,121,231219\ns,17.2,231211\nsi,17.2,231211\no,106,231219,120\noa,80,240125,120\nsa,25.0,240424,121\nwva,120,231205,120\ny,24.1,240118,120\nu,17.6,250515,123\nq,19.1,250708,121\nk,4.0,250501,123\nfb,443,231207,120\nia,311,u,120\n20240123\nf,122,240123\nfa,122,240123\n20240125\nc,121,240123\nca,121,240123\ne,121,240125\no,107,240207,121\noa,81,240314,122\nwva,121,240123,121\ny,24.4,240327,122\nfb,448,240129,121\nia,317,240203,121\n20240220\nf,123,240220\nfa,123,240220\n20240305\ns,17.4,240305\nsi,17.4,240305\n20240319\nf,124,240319\nfa,124,240319\n20240322\nc,123,240319\nca,123,240319\ne,123,240322\no,109,240327,123\noa,82,240502,124\nsa,27.0,241106,125\nwva,123,240319,123\ny,24.6,240604,124\nfb,465,240707,126\nia,338,240706,126\n20240416\nf,125,240416\nfa,125,240416\n20240418\nc,124,240416\nca,124,240416\ne,124,240418\no,110,240514,124\nwva,124,240416,124\n20240513\ns,17.5,240513\nsi,17.5,240513\n20240514\nf,126,240514\nfa,126,240514\n20240517\nc,125,240514\nca,125,240514\ne,125,240517\no,111,240612,125\noa,83,240625,126\nwva,125,240514,125\ny,24.7,240718,126\n20240611\nf,127,240611\nfa,127,240611\n20240709\nf,128,240709\nfa,128,240709\n20240725\nc,127,240723\nca,127,240723\ne,127,240725\no,113,240822,127\noa,84,240826,127\nsa,28.0,250402,130\nwva,127,240723,127\ny,24.10,241011,128\nfb,474,240730,127\nia,346,240901,127\n20240806\nf,129,240806\nfa,129,240806\n20240903\nf,130,240903\nfa,130,240903\n20240916\ns,18,240916\nsi,18,240916\n20241001\nf,131,241001\nfa,131,241001\n20241017\nc,130,241015\nca,130,241015\ne,130,241017\no,115,241127,130\noa,86,241202,130\nwva,130,241015,130\ny,24.12,241130,130\nfb,486,241018,130\nia,355,241106,130\n20241029\nf,132,241029\nfa,132,241029\n20241211\ns,18.2,241211\nsi,18.2,241211\n20241231\nc,130,241015\nca,130,241015\ne,130,241017\nf,132,241029\nfa,132,241029\ns,18.2,241211\nsi,18.2,241211\no,115,241127,130\noa,86,241202,130\nsa,28.0,250402,130\nwva,130,241015,130\ny,24.12,241130,130\nfb,486,241018,130\nia,355,241106,130\n20250107\nf,134,250107\nfa,134,250107\n20250127\nsi,18.3,250127\n20250304\nf,136,250304\nfa,136,250304\n20250331\ns,18.4,250331\nsi,18.4,250331\n20250401\nc,133,250204\nca,133,250204\ne,133,250206\nf,137,250401\nfa,137,250401\no,118,250415,133\noa,88,250319,134\nsa,29.0,251025,136\nwva,133,250204,133\ny,25.4,250423,134\nfb,503,250312,134\nia,378,250503,135\n20250404\nc,135,250401\nca,135,250401\ne,135,250404\no,120,250702,135\noa,89,250429,135\nwva,135,250401,135\ny,25.6,250904,136\nfb,514,250528,136\n20250429\nf,138,250429\nfa,138,250429\n20250501\nc,136,250429\nca,136,250429\ne,136,250501\no,121,250827,137\noa,90,250618,137\nwva,136,250429,136\nia,381,250619,137\n20250512\nsi,18.5,250512\n20250527\nf,139,250527\nfa,139,250527\n20250529\nc,137,250527\nca,137,250527\ne,137,250529\nwva,137,250527,137\ny,25.8,250830,138\nfb,515,250531,137\n20250626\nc,138,250624\nca,138,250624\ne,138,250626\no,122,250911,138\noa,91,250819,139\nwva,138,250624,138\nia,390,250726,138\n20250819\nf,142,250819\nfa,142,250819\n20250905\nc,140,250902\nca,140,250902\ne,140,250905\no,124,251113,140\noa,92,251008,140\nwva,140,250902,140\ny,25.10,251009,140\nia,399,250928,140\n20250915\ns,26,250915\nsi,26,250915\n20250916\nf,143,250916\nfa,143,250916\n20251003\nc,141,250930\nca,141,250930\ne,141,251003\no,125,251204,141\noa,93,251125,142\nwva,141,250930,141\ny,25.12,251207,142\nia,400,251006,141\n20251014\nf,144,251014\nfa,144,251014\n20251111\nf,145,251111\nfa,145,251111\n20251212\ns,26.2,251212\nsi,26.2,251212\n20251231\nc,141,250930\nca,141,250930\ne,141,251003\nf,145,251111\nfa,145,251111\ns,26.2,251212\nsi,26.2,251212\no,125,251204,141\noa,93,251125,142\nwva,141,250930,141\ny,25.12,251207,142\nia,400,251006,141\n20260113\nf,147,260113\nfa,147,260113\n20260211\ns,26.3,260211\nsi,26.3,260211\n20260214\nc,145,260210\nca,145,260210\ne,145,260214\no,129,260318,145\noa,96,260310,145\nwva,145,260210,145\ny,26.4,260425,146\nia,423,260405,146\n20260224\nf,148,260224\nfa,148,260224\n20260313\nc,146,260310\nca,146,260310\ne,146,260313\no,130,260408,146\noa,97,260416,146\nwva,146,260310,146\n20260324\nf,149,260324\nfa,149,260324\ns,26.4,260324\nsi,26.4,260324\n20260410\nc,147,260407\nca,147,260407\ne,147,260410\no,131,260429,147\noa,98,260505,147\nwva,147,260407,147\ny,26.6,260608,148\nia,430,260530,148\n20260505\nca,148,260505\n20260507\nc,148,260505\ne,148,260507\no,132,260528,148\noa,99,260610,148\nwva,148,260505,148\n20260511\ns,26.5,260511\nsi,26.5,260511\n20260519\nf,151,260519\nfa,151,260519\n20260616\nf,152,260616\nfa,152,260616\n20260721\nf,153,260721\nfa,153,260721\n20260818\nf,154,260818\nfa,154,260818\n20260828\nc,152,260825\nca,152,260825\ne,152,260828\no,136,u,152\nwva,152,260825,152\n20260901\nf,155,260901\nfa,155,260901\nreleases\nc,45,150901\nc,46,151013\nc,47,151201\nc,48,160120\nc,49,160302\nc,50,160413\nc,51,160525\nc,52,160720\nc,54,161012\nc,55,161201\nc,58,170419\nc,59,170605\nc,60,170725\nc,61,170905\nc,63,171206\nc,64,180123\nc,65,180306\nc,67,180529\nc,68,180724\nc,69,180904\nc,70,181016\nc,71,181204\nc,72,190129\nc,73,190312\nc,74,190423\nc,75,190604\nc,77,190910\nc,78,191022\nc,79,191210\nc,83,200519\nc,90,210413\nc,91,210525\nc,92,210720\nc,94,210921\nc,95,211019\nc,100,220329\nc,102,220524\nc,103,220621\nc,110,230207\nc,113,230502\nc,114,230530\nc,116,230815\nc,122,240220\nc,126,240611\nc,128,240820\nc,129,240917\nc,131,241112\nc,132,250114\nc,134,250304\nc,139,250805\nc,142,251028\nc,143,251202\nc,144,260113\nc,149,260602\nc,150,260630\nc,151,260728\nc,153,260908\nc,154,260922\nca,45,150901\nca,46,151014\nca,47,151202\nca,48,160126\nca,49,160309\nca,50,160413\nca,51,160608\nca,52,160727\nca,54,161019\nca,55,161206\nca,58,170425\nca,59,170606\nca,60,170801\nca,61,170905\nca,63,171205\nca,64,180123\nca,65,180306\nca,67,180531\nca,68,180724\nca,69,180904\nca,70,181017\nca,71,181204\nca,72,190129\nca,73,190312\nca,74,190424\nca,75,190604\nca,77,190910\nca,78,191022\nca,79,191217\nca,83,200519\nca,90,210413\nca,91,210525\nca,92,210720\nca,94,210921\nca,95,211019\nca,100,220329\nca,102,220524\nca,103,220621\nca,110,230207\nca,113,230502\nca,114,230530\nca,116,230815\nca,122,240220\nca,126,240611\nca,128,240820\nca,129,240917\nca,131,241112\nca,132,250114\nca,134,250304\nca,139,250805\nca,142,251028\nca,143,251202\nca,144,260113\nca,149,260602\nca,150,260630\nca,151,260728\nca,153,260908\nca,154,260922\ne,83,200521\ne,90,210415\ne,91,210527\ne,92,210722\ne,94,210924\ne,95,211021\ne,100,220401\ne,102,220531\ne,103,220623\ne,110,230209\ne,113,230505\ne,114,230602\ne,116,230821\ne,122,240223\ne,126,240613\ne,128,240822\ne,129,240919\ne,131,241114\ne,132,250117\ne,134,250306\ne,139,250807\ne,142,251031\ne,143,251205\ne,144,260121\ne,149,260604\ne,150,260702\ne,151,260731\ne,153,260910\ne,154,260924\nf,40,150811\nf,42,151103\nf,43,151215\nf,44,160126\nf,46,160426\nf,48,160802\nf,51,170124\nf,54,170613\nf,55,170808\nf,56,170928\nf,57,171114\nf,58,180123\nf,59,180313\nf,61,180626\nf,66,190319\nf,67,190521\nf,69,190903\nf,70,191022\nf,71,191210\nf,72,200107\nf,73,200211\nf,74,200310\nf,75,200407\nf,76,200505\nf,77,200602\nf,80,200825\nf,81,200922\nf,82,201020\nf,87,210323\nf,88,210419\nf,89,210601\nf,90,210713\nf,97,220208\nf,99,220405\nf,105,220920\nf,106,221018\nf,109,230117\nf,117,230829\nf,133,241126\nf,135,250204\nf,140,250624\nf,141,250722\nf,146,251209\nf,150,260421\nf,156,260915\nf,157,260929\nfa,40,150811\nfa,42,151103\nfa,43,151215\nfa,44,160126\nfa,46,160426\nfa,48,160802\nfa,51,170124\nfa,54,170613\nfa,55,170808\nfa,58,180122\nfa,59,180313\nfa,61,180626\nfa,66,190319\nfa,67,190521\nfa,80,200831\nfa,81,200922\nfa,82,201020\nfa,87,210323\nfa,88,210419\nfa,89,210601\nfa,90,210713\nfa,95,211207\nfa,97,220208\nfa,99,220405\nfa,105,220920\nfa,106,221018\nfa,109,230117\nfa,117,230829\nfa,133,241126\nfa,135,250204\nfa,140,250624\nfa,141,250722\nfa,146,251209\nfa,150,260421\nfa,156,260915\nfa,157,260929\ns,9,150930\ns,9.1,160321\ns,10,160920\ns,10.1,170327\ns,12,180917\ns,15.3,220126\ns,15.5,220516\ns,16.1,221024\ns,16.2,221213\ns,16.3,230123\ns,16.5,230518\ns,16.6,230724\ns,17.1,231025\ns,17.3,240122\ns,17.6,240729\ns,18.1,241028\ns,18.3,250127\ns,18.5,250512\ns,18.6,250729\ns,26.1,251103\ns,26.6,260727\ns,27,u\nsi,9,150916\nsi,9.3,160321\nsi,10,160913\nsi,10.3,170327\nsi,12,180917\nsi,15.3,220126\nsi,15.5,220516\nsi,16.1,221024\nsi,16.2,221213\nsi,16.3,230123\nsi,16.5,230518\nsi,16.6,230724\nsi,17.1,231025\nsi,17.3,240122\nsi,17.6,240729\nsi,18.1,241028\nsi,18.6,250729\nsi,26.1,251103\nsi,26.6,260727\nsi,27,u\no,15,130702,28\no,16,130827,29\no,17,131008,30\no,18,131119,31\no,19,140128,32\no,20,140304,33\no,21,140506,34\no,22,140603,35\no,23,140722,36\no,24,140902,37\no,26,141203,39\no,27,150127,40\no,28,150310,41\no,29,150428,42\no,30,150609,43\no,32,150915,45\no,33,151027,46\no,34,151208,47\no,35,160202,48\no,36,160315,49\no,37,160504,50\no,38,160608,51\no,39,160802,52\no,41,161025,54\no,42,161213,55\no,45,170510,58\no,46,170622,59\no,47,170809,60\no,48,170927,61\no,50,180104,63\no,51,180207,64\no,52,180322,65\no,54,180628,67\no,55,180816,68\no,56,180925,69\no,57,181128,70\no,58,190123,71\no,60,190409,73\no,62,190627,75\no,64,191007,77\no,65,191113,78\no,66,200107,79\no,69,200624,83\no,76,210428,90\no,77,210609,91\no,78,210803,92\no,80,211005,94\no,81,211104,95\no,86,220420,100\no,88,220608,102\no,89,220707,103\no,96,230222,110\no,99,230516,113\no,100,230629,114\no,102,230823,116\no,108,240305,122\no,112,240711,126\no,114,240925,128\no,116,250108,131\no,117,250213,132\no,119,250513,134\no,123,251028,139\no,126,260108,142\no,127,260202,143\no,128,260226,144\no,133,260629,149\no,134,260806,150\no,135,260820,151\no,137,u,153\noa,15,130708,28\noa,16,130918,29\noa,18,131120,31\noa,19,140128,32\noa,20,140306,33\noa,21,140422,34\noa,22,140617,35\noa,24,140910,37\noa,26,141202,39\noa,27,150129,40\noa,28,150310,41\noa,29,150428,42\noa,30,150610,43\noa,33,151103,46\noa,34,151216,47\noa,35,160204,48\noa,36,160331,49\noa,37,160616,50\noa,42,170121,55\noa,44,171211,60\noa,45,180215,61\noa,48,181108,69\noa,49,181207,70\noa,50,190218,71\noa,51,190321,72\noa,52,190517,73\noa,53,190711,74\noa,55,191203,77\noa,56,200206,78\noa,59,200630,83\noa,64,210525,91\noa,65,211020,92\noa,69,220509,100\noa,76,230626,114\noa,85,241029,128\noa,87,250122,132\noa,94,260113,143\noa,95,260211,144\noa,100,260701,149\noa,101,260826,151\nsa,1.5,130925,28\nsa,1.6,140411,28\nsa,2.0,141017,34\nsa,2.1,150107,34\nsa,3.2,150824,38\nsa,4.2,160802,44\nsa,5.0,161215,51\nsa,5.2,170421,51\nsa,5.4,170517,51\nsa,6.2,171026,56\nsa,6.4,180219,56\nsa,7.2,180620,59\nsa,7.4,180912,59\nsa,8.2,181221,63\nsa,9.2,190402,67\nsa,9.4,190725,67\nsa,10.0,190822,71\nsa,10.2,191009,71\nsa,11.0,191205,75\nsa,11.2,200322,75\nsa,12.1,200707,79\nsa,13.2,210120,83\nsa,14.2,210625,87\nsa,16.0,211125,92\nsa,16.2,220306,92\nsa,18.1,220909,99\nsa,19.1,221108,102\nsa,26.0,240607,122\nwva,4.4,131209,30\nwva,4.4.3,140602,33\nwva,37,140903,37\nwva,39,141112,39\nwva,40,150121,40\nwva,41,150311,41\nwva,42,150415,42\nwva,43,150527,43\nwva,45,150901,45\nwva,46,151014,46\nwva,47,151202,47\nwva,48,160126,48\nwva,49,160309,49\nwva,50,160413,50\nwva,51,160608,51\nwva,52,160727,52\nwva,54,161019,54\nwva,55,161206,55\nwva,58,170425,58\nwva,59,170606,59\nwva,60,170801,60\nwva,61,170905,61\nwva,63,171205,63\nwva,64,180123,64\nwva,65,180306,65\nwva,67,180531,67\nwva,68,180724,68\nwva,69,180904,69\nwva,70,181017,70\nwva,71,181204,71\nwva,72,190129,72\nwva,73,190312,73\nwva,74,190424,74\nwva,75,190604,75\nwva,77,190910,77\nwva,78,191022,78\nwva,79,191217,79\nwva,83,200519,83\nwva,90,210413,90\nwva,91,210525,91\nwva,92,210720,92\nwva,94,210921,94\nwva,95,211019,95\nwva,100,220329,100\nwva,102,220524,102\nwva,103,220621,103\nwva,110,230207,110\nwva,113,230502,113\nwva,114,230530,114\nwva,116,230815,116\nwva,122,240220,122\nwva,126,240611,126\nwva,128,240820,128\nwva,129,240917,129\nwva,131,241112,131\nwva,132,250114,132\nwva,134,250304,134\nwva,139,250805,139\nwva,142,251028,142\nwva,143,251202,143\nwva,144,260113,144\nwva,149,260602,149\nwva,150,260630,150\nwva,151,260728,151\nwva,153,260908,153\nwva,154,260922,154\ny,1.0,u,25\ny,1.5,u,22\ny,1.6,u,25\ny,1.7,u,25\ny,1.20,u,25\ny,2.5,u,25\ny,3.2,u,25\ny,4.6,u,25\ny,5.3,u,25\ny,5.4,u,25\ny,7.4,u,25\ny,9.6,u,25\ny,10.5,u,25\ny,11.4,u,25\ny,11.5,u,25\ny,12.7,u,25\ny,13.9,u,28\ny,13.10,u,28\ny,13.11,u,28\ny,13.12,u,30\ny,14.2,u,32\ny,14.4,u,33\ny,14.5,u,34\ny,14.7,u,35\ny,14.8,u,36\ny,14.10,u,37\ny,15.2,u,40\ny,15.4,u,41\ny,15.6,u,42\ny,15.7,u,43\ny,15.10,u,45\ny,15.12,u,46\ny,16.2,u,47\ny,16.3,u,47\ny,16.4,u,49\ny,16.6,u,50\ny,16.7,u,51\ny,16.9,u,52\ny,16.11,u,54\ny,17.1,u,55\ny,17.6,u,58\ny,17.7,u,59\ny,17.9,u,60\ny,17.10,u,61\ny,18.1,u,63\ny,18.2,u,63\ny,18.3,u,64\ny,18.4,u,65\ny,18.7,u,67\ny,18.9,u,68\ny,18.10,u,69\ny,18.11,u,70\ny,19.1,u,71\ny,19.3,u,72\ny,19.4,u,73\ny,19.5,u,75\ny,19.6,u,75\ny,19.7,u,75\ny,19.10,u,77\ny,19.11,u,78\ny,19.12,u,78\ny,20.2,u,79\ny,20.6,u,81\ny,20.7,u,83\ny,21.2,u,88\ny,21.5,u,90\ny,21.6,210928,91\ny,21.8,210928,92\ny,21.11,211029,94\ny,22.4,u,92\ny,22.9,220827,104\ny,23.7,230706,114\ny,24.2,240325,120\ny,24.9,241001,126\ny,25.2,250424,132\ny,25.3,250423,132\ny,26.3,260304,144\ny,26.7,260723,149\ny,26.8,260801,150\nu,10.5,u,31\nu,10.7,u,31\nu,10.8,u,31\nu,10.10,u,31\nu,11.0,u,31\nu,11.2,u,40\nu,11.3,u,40\nu,11.4,u,40\nu,11.5,u,40\nu,11.8,u,57\nu,11.9,u,57\nu,12.0,u,57\nu,12.1,u,57\nu,12.2,u,57\nu,12.3,u,57\nu,12.4,u,57\nu,12.5,u,57\nu,12.6,u,57\nu,12.7,u,57\nu,12.8,u,57\nu,12.9,u,57\nu,12.10,u,57\nu,12.11,u,57\nu,12.12,u,57\nu,12.13,u,57\nu,12.14,u,57\nu,13.0,u,57\nu,13.1,u,57\nu,13.2,u,57\nu,13.4,210928,78\nu,13.5,230825,78\nu,13.6,231217,78\nu,13.7,230624,78\nu,13.8,220430,78\nu,13.9,220518,78\nu,15.0,220824,78\nu,15.1,221111,78\nu,15.2,230423,78\nu,15.4,231025,100\nu,15.5,230822,100\nu,16.0,230824,100\nu,16.1,231015,100\nu,16.2,231209,100\nu,16.3,240308,100\nu,16.4,241003,100\nu,16.5,240530,100\nu,16.6,240723,100\nu,17.0,240824,100\nu,17.1,240926,100\nu,17.2,241129,100\nu,17.3,250107,100\nu,17.4,250226,100\nu,17.5,250408,100\nu,17.7,250611,123\nu,17.8,250730,123\nu,18.0,250817,123\nu,18.1,251004,123\nu,18.2,251104,123\nu,18.3,251212,123\nu,18.4,260109,123\nu,18.5,260128,123\nu,18.6,260321,123\nu,18.8,260503,123\nu,18.9,260702,123\nu,18.10,260808,123\nu,19.0,260824,123\nq,6.0,u,37\nq,6.1,u,37\nq,6.2,u,37\nq,6.3,u,37\nq,6.4,u,37\nq,6.6,u,37\nq,6.7,u,37\nq,6.8,u,37\nq,6.9,u,37\nq,7.0,u,37\nq,7.1,u,37\nq,7.2,u,37\nq,7.3,u,37\nq,7.4,u,37\nq,7.5,u,37\nq,7.6,u,37\nq,7.7,u,37\nq,7.8,u,37\nq,7.9,u,37\nq,8.0,u,37\nq,8.2,u,57\nq,8.3,u,57\nq,8.4,u,57\nq,8.5,u,57\nq,8.6,u,57\nq,8.7,u,57\nq,8.8,u,57\nq,8.9,u,57\nq,9.1,u,57\nq,9.7,u,66\nq,9.8,u,66\nq,10.0,u,66\nq,10.1,u,66\nq,10.2,u,66\nq,10.3,u,66\nq,10.4,u,66\nq,10.5,u,66\nq,10.7,200909,66\nq,11.0,u,77\nq,11.2,210130,77\nq,11.3,210331,77\nq,11.9,u,89\nq,12.0,211104,89\nq,12.1,211105,89\nq,12.2,211207,89\nq,12.5,220407,89\nq,12.7,220521,89\nq,12.8,220630,89\nq,12.9,220726,89\nq,13.0,220815,89\nq,13.1,220910,89\nq,13.2,221026,89\nq,13.3,221109,89\nq,13.5,230206,98\nq,13.6,230209,98\nq,13.7,230421,98\nq,13.8,230421,98\nq,14.0,231212,98\nq,14.1,230716,98\nq,14.3,230913,109\nq,14.4,231031,109\nq,14.5,231112,109\nq,14.6,231224,109\nq,14.7,240118,109\nq,14.8,240304,109\nq,14.9,240409,109\nq,15.0,240417,109\nq,15.1,240518,109\nq,15.2,241024,109\nq,15.3,240728,109\nq,15.4,240907,109\nq,15.5,240924,109\nq,15.6,241024,109\nq,15.7,241203,109\nq,15.8,241211,109\nq,15.9,250201,109\nq,19.2,250715,121\nq,19.3,250831,121\nq,19.4,250920,121\nq,19.5,251023,121\nq,19.6,251117,121\nq,19.7,251218,121\nq,19.8,260120,121\nq,19.9,260309,121\nq,20.0,260406,121\nq,20.1,260430,121\nq,20.2,260610,121\nq,20.3,260617,121\nq,20.4,260728,121\nq,20.5,260817,121\nk,1.0,170301,37\nk,2.5,170701,48\nk,3.1,220301,84\nfb,68,u,48\nfb,74,u,50\nfb,75,u,50\nfb,76,u,50\nfb,77,u,50\nfb,78,u,50\nfb,79,u,50\nfb,80,u,51\nfb,81,u,51\nfb,82,u,51\nfb,83,u,51\nfb,84,u,51\nfb,86,u,51\nfb,87,u,52\nfb,88,u,52\nfb,89,u,52\nfb,90,u,52\nfb,91,u,52\nfb,92,u,52\nfb,93,u,52\nfb,94,u,52\nfb,96,u,53\nfb,97,u,53\nfb,98,u,53\nfb,99,u,53\nfb,100,u,54\nfb,101,u,54\nfb,103,u,54\nfb,104,u,54\nfb,105,u,54\nfb,106,u,55\nfb,107,u,55\nfb,108,u,55\nfb,109,u,55\nfb,110,u,55\nfb,111,u,55\nfb,113,u,56\nfb,114,u,56\nfb,115,u,56\nfb,116,u,56\nfb,118,u,57\nfb,119,u,57\nfb,120,u,57\nfb,121,u,57\nfb,122,u,58\nfb,123,u,58\nfb,124,u,58\nfb,125,u,58\nfb,126,u,58\nfb,127,u,58\nfb,128,u,58\nfb,129,u,58\nfb,130,u,59\nfb,131,u,59\nfb,132,u,59\nfb,133,u,59\nfb,134,u,59\nfb,135,u,59\nfb,136,u,59\nfb,137,u,59\nfb,138,u,60\nfb,140,u,60\nfb,142,u,61\nfb,143,u,61\nfb,144,u,61\nfb,145,u,61\nfb,146,u,61\nfb,147,u,61\nfb,148,u,61\nfb,150,u,62\nfb,151,u,62\nfb,152,u,62\nfb,153,u,63\nfb,154,u,63\nfb,155,u,63\nfb,156,u,63\nfb,157,u,64\nfb,158,u,64\nfb,159,u,64\nfb,160,u,64\nfb,161,u,64\nfb,162,u,64\nfb,163,u,65\nfb,164,u,65\nfb,165,u,65\nfb,166,u,65\nfb,167,u,65\nfb,168,u,65\nfb,170,u,66\nfb,171,u,66\nfb,172,u,66\nfb,173,u,66\nfb,174,u,66\nfb,175,u,67\nfb,176,u,67\nfb,177,u,67\nfb,178,u,67\nfb,180,u,67\nfb,181,u,67\nfb,182,u,67\nfb,183,u,68\nfb,184,u,68\nfb,185,u,68\nfb,186,u,68\nfb,187,u,68\nfb,188,u,68\nfb,202,u,71\nfb,227,u,75\nfb,228,u,75\nfb,229,u,75\nfb,230,u,75\nfb,231,u,75\nfb,235,u,76\nfb,236,u,76\nfb,237,u,76\nfb,238,u,76\nfb,240,u,77\nfb,241,u,77\nfb,242,u,77\nfb,243,u,77\nfb,244,u,78\nfb,245,u,78\nfb,246,u,78\nfb,247,u,78\nfb,248,u,78\nfb,249,u,78\nfb,250,u,78\nfb,251,u,79\nfb,252,u,79\nfb,253,u,79\nfb,254,u,79\nfb,255,u,79\nfb,257,u,80\nfb,258,u,80\nfb,259,u,80\nfb,260,u,80\nfb,261,u,80\nfb,262,u,80\nfb,263,u,80\nfb,264,u,80\nfb,265,u,80\nfb,267,u,81\nfb,268,u,81\nfb,269,u,81\nfb,270,u,81\nfb,271,u,81\nfb,272,u,83\nfb,273,u,83\nfb,274,u,83\nfb,275,u,83\nfb,400,230210,109\nfb,436,231013,117\nfb,438,231028,118\nfb,440,231112,119\nfb,441,231120,119\nfb,442,231129,119\nfb,444,231213,120\nfb,445,231221,120\nfb,446,240106,120\nfb,447,240112,120\nfb,449,240202,121\nfb,450,240205,121\nfb,451,240217,121\nfb,452,240225,122\nfb,453,240228,122\nfb,454,240304,122\nfb,466,u,126\nfb,469,u,126\nfb,471,240710,126\nfb,472,240711,126\nfb,475,240801,127\nfb,476,240809,127\nfb,477,240816,127\nfb,478,240821,128\nfb,479,240831,128\nfb,480,240907,128\nfb,481,240914,128\nfb,482,240920,129\nfb,483,240927,129\nfb,484,241004,129\nfb,485,241011,129\nfb,487,241026,130\nfb,488,241102,130\nfb,489,241109,130\nfb,494,241226,131\nfb,497,250126,132\nia,24,u,62\nia,25,u,62\nia,26,u,63\nia,27,u,63\nia,28,u,63\nia,29,u,63\nia,30,u,63\nia,31,u,64\nia,32,u,64\nia,33,u,64\nia,34,u,64\nia,35,u,65\nia,36,u,65\nia,37,u,65\nia,38,u,65\nia,39,u,65\nia,40,u,65\nia,41,u,65\nia,43,u,66\nia,44,u,66\nia,45,u,66\nia,46,u,66\nia,47,u,66\nia,48,u,67\nia,49,u,67\nia,50,u,67\nia,51,u,67\nia,52,u,67\nia,53,u,67\nia,54,u,67\nia,55,u,67\nia,56,u,68\nia,57,u,68\nia,58,u,68\nia,59,u,68\nia,60,u,68\nia,61,u,68\nia,65,u,69\nia,66,u,69\nia,68,u,69\nia,72,u,70\nia,74,u,71\nia,75,u,71\nia,79,u,71\nia,81,u,72\nia,82,u,72\nia,83,u,72\nia,84,u,73\nia,86,u,73\nia,95,u,74\nia,97,u,80\nia,98,u,80\nia,103,u,80\nia,104,u,80\nia,117,u,80\nia,118,u,80\nia,119,u,80\nia,120,u,80\nia,121,u,80\nia,127,u,80\nia,128,u,80\nia,129,u,80\nia,130,u,80\nia,131,u,80\nia,132,u,80\nia,133,u,80\nia,134,u,80\nia,135,u,80\nia,136,u,80\nia,138,u,81\nia,139,u,81\nia,140,u,81\nia,141,u,81\nia,142,u,81\nia,143,u,83\nia,144,u,83\nia,145,u,83\nia,146,u,83\nia,164,u,92\nia,230,u,92\nia,259,221104,106\nia,281,u,109\nia,289,231221,114\nia,290,231230,114\nia,295,u,115\nia,296,u,115\nia,297,u,115\nia,298,240111,115\nia,299,u,115\nia,300,u,116\nia,301,240112,116\nia,303,u,117\nia,304,u,117\nia,305,u,117\nia,307,u,118\nia,308,240119,118\nia,310,u,119\nia,312,u,120\nia,313,u,120\nia,314,u,120\nia,315,240119,120\nia,316,240125,120\nia,318,240216,121\nia,320,240304,121\nia,321,240307,122\nia,347,240911,127\nia,349,240920,128\nia,366,u,132\nia,367,250215,132\nia,382,250619,137\nia,383,250618,137\nia,384,250616,137\nia,385,250627,137\nia,387,250709,137\nia,392,250812,138\nia,394,250826,139\nia,395,250913,139\nia,396,250920,139\nia,397,250919,139\nia,401,251008,141\nia,404,251031,141\nia,406,251116,141\nia,407,251123,142\nia,408,251128,142\nia,409,251216,143\nia,410,251217,143\nia,411,260107,143\nia,438,260722,150\nia,443,260821,151\nia,444,260827,151\n".split("\n").forEach(n=>{if(n=n.trim())if("releases"!==n){if(f){const a=n.split(",");if(a.length>=3){const[n,u,o,f]=a,i=[n,u,e(o.trim())];f&&i.push(f.trim()),s[n]||(s[n]=[]),s[n].push(i)}return}if(n.startsWith("20")||n.startsWith("pre_baseline"))return o=e(n),void(u[o]=[]);{const a=n.split(",");if(a.length>=3){const[n,s,f,i]=a,r=[n,s,e(f.trim())];if(i&&r.push(i.trim()),!u[o])throw new Error(`Timeline entry for date ${o} is undefined. This should not happen.`);u[o].push(r)}}}else f=!0});const i={};Object.keys(a).forEach(n=>{var a;i[n]=[...null!==(a=s[n])&&void 0!==a?a:[]]}),Object.keys(u).forEach(n=>{u[n].forEach(n=>{const a=n[0];i[a]&&(i[a].some(a=>a[1]===n[1])||i[a].push(n))})}),Object.keys(i).forEach(a=>{i[a].sort((a,e)=>n(a[1],e[1]))});let r=!1;function c(){r=!1}const t=Object.keys(a).filter(n=>void 0===a[n].engine).map(n=>{const{longName:e}=a[n];return{shortName:n,longName:e}}),b=["webview_android","samsunginternet_android","opera_android","opera","ya_android","uc_android","qq_android","kai_os","facebook_android","instagram_android"],l=a=>{const e=[],u=[];return a.forEach(n=>{t.some(a=>a.longName===n.browser)?e.push(n):u.push(n)}),e.sort((a,e)=>a.browsere.browser?1:n(a.version,e.version)),u.sort((a,e)=>{const u=b.indexOf(a.browser),s=b.indexOf(e.browser);return u!==s?u-s:n(a.version,e.version)}),[...e,...u]};let w=!1;const v=n=>{if(!1===n.includeDownstreamBrowsers&&!0===n.includeKaiOS)throw new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.")},y=(n,e,u,s,o)=>{var f;const i={browser:e,version:u,release_date:"u"===s?"unknown":s};return o&&(i.engine_version=o,i.engine=null===(f=a[n])||void 0===f?void 0:f.engine),i};function d(e){var s,o,f,c,b,d,p;let g=null!=e?e:{},q={listAllCompatibleVersions:null!==(s=g.listAllCompatibleVersions)&&void 0!==s&&s,includeDownstreamBrowsers:null!==(o=g.includeDownstreamBrowsers)&&void 0!==o&&o,widelyAvailableOnDate:null!==(f=g.widelyAvailableOnDate)&&void 0!==f?f:void 0,targetYear:null!==(c=g.targetYear)&&void 0!==c?c:void 0,includeKaiOS:null!==(b=g.includeKaiOS)&&void 0!==b&&b,overrideLastUpdated:null!==(d=g.overrideLastUpdated)&&void 0!==d?d:void 0,suppressWarnings:null!==(p=g.suppressWarnings)&&void 0!==p&&p},m=new Date;if(q.widelyAvailableOnDate||q.targetYear){if(q.targetYear&&q.widelyAvailableOnDate)throw new Error("You cannot use targetYear and widelyAvailableOnDate at the same time. Please remove one of these options and try again.");q.widelyAvailableOnDate?m=new Date(q.widelyAvailableOnDate):q.targetYear&&(m=new Date(`${q.targetYear}-12-31`))}else m=new Date;if((q.widelyAvailableOnDate||void 0===q.targetYear)&&m.setMonth(m.getMonth()-30),!q.suppressWarnings){if(((n,a)=>{if(r||"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST_IGNORE_OLD_DATA||process.env.BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA))return;const e=new Date;e.setMonth(e.getMonth()-2),n>e&&(null!=a?a:1788456871688)(new Date).getFullYear())throw new Error("There are no browser versions compatible with Baseline in the future")}const h=m{_[n]=void 0}),Object.keys(u).forEach(n=>{const a=u[n];let e=!1;e="pre_baseline"===n||new Date(n)<=m,e&&a.forEach(a=>{const e=a[0];"pre_baseline"!==n&&(_[e]=a)})});const O=[];return Object.keys(a).forEach(e=>{var u,s;const{longName:o}=a[e];if(!q.includeKaiOS&&"k"===e)return;const f=t.some(n=>n.shortName===e);if(q.includeDownstreamBrowsers||f)if(h)if(q.listAllCompatibleVersions){O.push({browser:o,version:"0",release_date:""});(null!==(u=i[e])&&void 0!==u?u:[]).forEach(n=>{O.push(y(e,o,n[1],n[2],n[3]))})}else O.push({browser:o,version:"0",release_date:""});else{const a=_[e];if(!a)return;const u=a[1];if(q.listAllCompatibleVersions){(null!==(s=i[e])&&void 0!==s?s:[]).forEach(a=>{const s=a[1];n(s,u)>=0&&O.push(y(e,o,s,a[2],a[3]))})}else O.push(y(e,o,u,a[2],a[3]))}}),l(O)}function p(a){var e,u,s,o,f;w=!0;let i=null!=a?a:{},r={outputFormat:null!==(e=i.outputFormat)&&void 0!==e?e:"array",includeDownstreamBrowsers:null!==(u=i.includeDownstreamBrowsers)&&void 0!==u&&u,useSupports:null!==(s=i.useSupports)&&void 0!==s&&s,includeKaiOS:null!==(o=i.includeKaiOS)&&void 0!==o&&o,suppressWarnings:null!==(f=i.suppressWarnings)&&void 0!==f&&f};v(r);let c=(new Date).getFullYear()+1;const b=[...Array(c).keys()].slice(2015),l={};b.forEach(n=>{l[n]={},d({targetYear:n,suppressWarnings:r.suppressWarnings}).forEach(a=>{l[n]&&(l[n][a.browser]=a)})});const y=d({suppressWarnings:r.suppressWarnings}),p={};y.forEach(n=>{p[n.browser]=n});const g=new Date;g.setMonth(g.getMonth()+30);const q=d({widelyAvailableOnDate:g.toISOString().slice(0,10),suppressWarnings:r.suppressWarnings}),m={};q.forEach(n=>{m[n.browser]=n});const h=d({targetYear:2002,listAllCompatibleVersions:!0,suppressWarnings:r.suppressWarnings}),_=[];if(t.map(n=>n.longName).forEach(a=>{var e,u,s,o;let f=h.filter(n=>n.browser==a).sort((a,e)=>n(a.version,e.version)),i=null!==(u=null===(e=p[a])||void 0===e?void 0:e.version)&&void 0!==u?u:"0",t=null!==(o=null===(s=m[a])||void 0===s?void 0:s.version)&&void 0!==o?o:"0";b.forEach(e=>{var u;if(l[e]){let s=(null!==(u=l[e][a])&&void 0!==u?u:{version:"0"}).version,o=f.findIndex(a=>0===n(a.version,s));(e===c-1?f:f.slice(0,o)).forEach(a=>{let u=n(a.version,i)>=0,s=n(a.version,t)>=0,o=Object.assign(Object.assign({},a),{year:e<=2015?"pre_baseline":e-1});r.useSupports?(u&&(o.supports="widely"),s&&(o.supports="newly")):o=Object.assign(Object.assign({},o),{wa_compatible:u}),_.push(o)}),f=f.slice(o,f.length)}})}),r.includeDownstreamBrowsers){d({targetYear:2002,listAllCompatibleVersions:!0,includeDownstreamBrowsers:!0,includeKaiOS:r.includeKaiOS,suppressWarnings:r.suppressWarnings}).filter(n=>!t.map(n=>n.longName).includes(n.browser)).forEach(n=>{const a="Gecko"===n.engine?"firefox":"chrome";let e=_.find(e=>e.browser===a&&e.version===n.engine_version);e&&(r.useSupports?_.push(Object.assign(Object.assign({},n),{year:e.year,supports:e.supports})):_.push(Object.assign(Object.assign({},n),{year:e.year,wa_compatible:e.wa_compatible})))})}if(_.sort((a,e)=>{if("pre_baseline"===a.year&&"pre_baseline"!==e.year)return-1;if("pre_baseline"===e.year&&"pre_baseline"!==a.year)return 1;if("pre_baseline"!==a.year&&"pre_baseline"!==e.year){if(a.yeare.year)return 1}return a.browsere.browser?1:n(a.version,e.version)}),"object"===r.outputFormat){const n={};return _.forEach(a=>{n[a.browser]||(n[a.browser]={});let e={year:a.year,release_date:a.release_date,engine:a.engine,engine_version:a.engine_version};n[a.browser][a.version]=r.useSupports?a.supports?Object.assign(Object.assign({},e),{supports:a.supports}):e:Object.assign(Object.assign({},e),{wa_compatible:a.wa_compatible})}),null!=n?n:{}}if("csv"===r.outputFormat){let n=`"browser","version","year","${r.useSupports?"supports":"wa_compatible"}","release_date","engine","engine_version"`;return _.forEach(a=>{var e,u,s,o;let f={browser:a.browser,version:a.version,year:a.year,release_date:null!==(e=a.release_date)&&void 0!==e?e:"NULL",engine:null!==(u=a.engine)&&void 0!==u?u:"NULL",engine_version:null!==(s=a.engine_version)&&void 0!==s?s:"NULL"};f=r.useSupports?Object.assign(Object.assign({},f),{supports:null!==(o=a.supports)&&void 0!==o?o:""}):Object.assign(Object.assign({},f),{wa_compatible:a.wa_compatible}),n+=`\n"${f.browser}","${f.version}","${f.year}","${r.useSupports?f.supports:f.wa_compatible}","${f.release_date}","${f.engine}","${f.engine_version}"`}),n}return _}function g(n){var e,s,o,f;const i=null!=n?n:{},r=null!==(e=i.groupBy)&&void 0!==e?e:"date",c=null!==(s=i.listAllBrowsers)&&void 0!==s&&s,b=null!==(o=i.includeDownstreamBrowsers)&&void 0!==o&&o,w=null!==(f=i.includeKaiOS)&&void 0!==f&&f;if(!1===b&&!0===w)throw new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.");const v={},d=[];if(Object.keys(u).forEach(n=>{const e=u[n];if("pre_baseline"===n)return;const s=new Set;e.forEach(n=>{const a=n[0],e=v[a],u=n[1];e&&e[1]===u||s.add(a),v[a]=n});const o=[];if(Object.keys(a).forEach(n=>{const{longName:e}=a[n];if(!w&&"k"===n)return;const u=t.some(a=>a.shortName===n);if(!b&&!u)return;const f=s.has(n);if(c||f){const a=v[n];a&&o.push(y(n,e,a[1],a[2],a[3]))}}),o.length>0){const a=l(o);d.push({date:n,browsers:a})}}),"browser"===r){const n={};return Object.keys(a).forEach(e=>{const{longName:u}=a[e];if(!w&&"k"===e)return;const s=t.some(n=>n.shortName===e);(b||s)&&(n[u]=[])}),d.forEach(a=>{a.browsers.forEach(e=>{const{browser:u}=e,s=function(n,a){var e={};for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&a.indexOf(u)<0&&(e[u]=n[u]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(u=Object.getOwnPropertySymbols(n);s NOTE: cannot be used with `targetYear`. + */ + widelyAvailableOnDate?: string | number; + /** + * Pass a year between 2015 and the current year to get browser versions compatible with all + * Newly Available features as of the end of the year specified. + * > NOTE: cannot be used with `widelyAvailableOnDate`. + */ + targetYear?: number; + /** + * Pass a boolean that determines whether KaiOS is included in browser mappings. KaiOS implements + * the Gecko engine used in Firefox. However, KaiOS also has a different interaction paradigm to + * other browsers and requires extra consideration beyond simple feature compatibility to provide + * an optimal user experience. Defaults to `false`. + */ + includeKaiOS?: boolean; + overrideLastUpdated?: number; + /** + * Pass a boolean to suppress the warning about stale data. + * Defaults to `false`. + */ + suppressWarnings?: boolean; +}; +export type AllVersionsOptions = { + /** + * Whether to return the output as a JavaScript `Array` (`"array"`), `Object` (`"object"`) or a CSV string (`"csv"`). + * Defaults to `"array"`. + */ + outputFormat?: string; + /** + * Whether to include browsers that use the same engines as a core Baseline browser. + * Defaults to `false`. + */ + includeDownstreamBrowsers?: boolean; + /** + * Whether to use the new "supports" property in place of "wa_compatible" + * Defaults to `false` + */ + useSupports?: boolean; + /** + * Whether to include KaiOS in the output. KaiOS implements the Gecko engine used in Firefox. + * However, KaiOS also has a different interaction paradigm to other browsers and requires extra + * consideration beyond simple feature compatibility to provide an optimal user experience. + */ + includeKaiOS?: boolean; + /** + * Pass a boolean to suppress the warning about old data. + * Defaults to `false`. + */ + suppressWarnings?: boolean; +}; +export interface AllBrowsersBrowserVersion extends BrowserVersion { + year: number | string; + supports?: string; + wa_compatible?: boolean; +} +export type NestedBrowserVersions = { + [browser: string]: { + [version: string]: AllBrowsersBrowserVersion; + }; +}; +export type TimelineOptions = { + /** + * Whether to return the timeline as a chronologically sorted array of events grouped by date ("date"), + * or as an object grouped by browser with their respective history of version changes ("browser"). + * Defaults to "date". + */ + groupBy?: "date" | "browser"; + /** + * Whether to include all compatible browsers in each timeline event, + * or only the browsers that changed on that date. + * Only applicable when groupBy is "date". + * Defaults to `false`. + */ + listAllBrowsers?: boolean; + /** + * Whether to include browsers that use the same engines as a core Baseline browser. + * Defaults to `false`. + */ + includeDownstreamBrowsers?: boolean; + /** + * Whether to include KaiOS in the timeline. + * Defaults to `false`. + */ + includeKaiOS?: boolean; +}; +export type TimelineEvent = { + date: string; + browsers: BrowserVersion[]; +}; +export type BrowserTimelineEntry = { + date: string; + version: string; + release_date?: string; + engine?: string; + engine_version?: string; +}; +export type BrowserTimeline = { + [browser: string]: BrowserTimelineEntry[]; +}; diff --git a/node_modules/baseline-browser-mapping/dist/utils.d.ts b/node_modules/baseline-browser-mapping/dist/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8474fdc70b56a7e2905b0d3425533132cd9ad9a --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/utils.d.ts @@ -0,0 +1 @@ +export declare const compareVersions: (nextVersion: string, prevVersion: string) => 1 | 0 | -1; diff --git a/node_modules/baseline-browser-mapping/package.json b/node_modules/baseline-browser-mapping/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ec16f6e53b74302cb4750da7319ef61cad2f5f3e --- /dev/null +++ b/node_modules/baseline-browser-mapping/package.json @@ -0,0 +1,68 @@ +{ + "name": "baseline-browser-mapping", + "main": "./dist/index.cjs", + "version": "2.11.21", + "description": "A library for obtaining browser versions with their maximum supported Baseline feature set and Widely Available status.", + "exports": { + ".": { + "require": "./dist/index.cjs", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./legacy": { + "require": "./dist/index.cjs", + "types": "./dist/index.d.ts" + } + }, + "jsdelivr": "./dist/index.js", + "files": [ + "dist/*", + "!dist/scripts/*", + "LICENSE.txt", + "README.md" + ], + "types": "./dist/index.d.ts", + "type": "module", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "fix-cli-permissions": "output=$(npx baseline-browser-mapping 2>&1); path=$(printf '%s\n' \"$output\" | sed -n 's/^.*: \\(.*\\): Permission denied$/\\1/p; t; s/^\\(.*\\): Permission denied$/\\1/p'); if [ -n \"$path\" ]; then echo \"Permission denied for: $path\"; echo \"Removing $path ...\"; rm -rf \"$path\"; else echo \"$output\"; fi", + "test:format": "npx prettier --check .", + "test:lint": "npx eslint .", + "test:legacy-test": "node spec/legacy-tests/legacy-test.cjs; node dist/cli.cjs", + "test:jasmine": "npx jasmine", + "test:jasmine-browser": "npx jasmine-browser-runner runSpecs --config ./spec/support/jasmine-browser.js", + "test": "npm run build && npm run fix-cli-permissions && npm run test:format && npm run test:lint && npm run test:jasmine && npm run test:jasmine-browser", + "build": "rm -rf dist; npx prettier . --write; rollup -c; rm -rf ./dist/scripts/expose-data.d.ts ./dist/cli.d.ts", + "refresh-downstream": "npx tsx scripts/refresh-downstream.ts", + "refresh-static": "npx tsx scripts/refresh-static.ts", + "update-timeline": "npx tsx scripts/create-timeline.ts; npx prettier ./src/data/timeline.js --write", + "update-data-dependencies": "npm i @mdn/browser-compat-data@latest web-features@latest -D", + "check-timeline-changes": "git diff --name-only | grep -q '^src/data/timeline.js$' && echo 'changes-available=TRUE' || echo 'changes-available=FALSE'" + }, + "license": "Apache-2.0", + "devDependencies": { + "@mdn/browser-compat-data": "^8.1.0", + "@rollup/plugin-terser": "^1.0.0", + "@rollup/plugin-typescript": "^12.1.3", + "@types/node": "^22.19.21", + "eslint-plugin-new-with-error": "^5.0.0", + "jasmine": "^5.8.0", + "jasmine-browser-runner": "^3.0.0", + "jasmine-spec-reporter": "^7.0.0", + "prettier": "^3.5.3", + "rollup": "^4.44.0", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.35.0", + "web-features": "^3.37.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/web-platform-dx/baseline-browser-mapping.git" + } +} diff --git a/node_modules/binary-extensions/binary-extensions.json b/node_modules/binary-extensions/binary-extensions.json new file mode 100644 index 0000000000000000000000000000000000000000..ac08048e40e2df28fc71773efd5731e3d39778e2 --- /dev/null +++ b/node_modules/binary-extensions/binary-extensions.json @@ -0,0 +1,263 @@ +[ + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "afdesign", + "afphoto", + "afpub", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "appimage", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "flatpak", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "odp", + "ods", + "odt", + "oga", + "ogg", + "ogv", + "otf", + "ott", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rpm", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "snap", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx" +] diff --git a/node_modules/binary-extensions/binary-extensions.json.d.ts b/node_modules/binary-extensions/binary-extensions.json.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94a248c2bcff7d66060ed1968cd12897d340b4a0 --- /dev/null +++ b/node_modules/binary-extensions/binary-extensions.json.d.ts @@ -0,0 +1,3 @@ +declare const binaryExtensionsJson: readonly string[]; + +export = binaryExtensionsJson; diff --git a/node_modules/binary-extensions/index.d.ts b/node_modules/binary-extensions/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f469ac5fb0fe5fd6cbd8816db9257c718d8d2c85 --- /dev/null +++ b/node_modules/binary-extensions/index.d.ts @@ -0,0 +1,14 @@ +/** +List of binary file extensions. + +@example +``` +import binaryExtensions = require('binary-extensions'); + +console.log(binaryExtensions); +//=> ['3ds', '3g2', …] +``` +*/ +declare const binaryExtensions: readonly string[]; + +export = binaryExtensions; diff --git a/node_modules/binary-extensions/index.js b/node_modules/binary-extensions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d46e46886711415a0a1064443c20e8a3704714c3 --- /dev/null +++ b/node_modules/binary-extensions/index.js @@ -0,0 +1 @@ +module.exports = require('./binary-extensions.json'); diff --git a/node_modules/binary-extensions/license b/node_modules/binary-extensions/license new file mode 100644 index 0000000000000000000000000000000000000000..5493a1a6e3f9a54b9ed8da6b1c83df252204f753 --- /dev/null +++ b/node_modules/binary-extensions/license @@ -0,0 +1,10 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/binary-extensions/package.json b/node_modules/binary-extensions/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4710c339aeb2d5885d2df14567c614d83e820cc7 --- /dev/null +++ b/node_modules/binary-extensions/package.json @@ -0,0 +1,40 @@ +{ + "name": "binary-extensions", + "version": "2.3.0", + "description": "List of binary file extensions", + "license": "MIT", + "repository": "sindresorhus/binary-extensions", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "sideEffects": false, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "binary-extensions.json", + "binary-extensions.json.d.ts" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "json", + "list", + "array" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/binary-extensions/readme.md b/node_modules/binary-extensions/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..88519b3a6dacab294ec8ec61b1c706533c72f697 --- /dev/null +++ b/node_modules/binary-extensions/readme.md @@ -0,0 +1,25 @@ +# binary-extensions + +> List of binary file extensions + +The list is just a [JSON file](binary-extensions.json) and can be used anywhere. + +## Install + +```sh +npm install binary-extensions +``` + +## Usage + +```js +const binaryExtensions = require('binary-extensions'); + +console.log(binaryExtensions); +//=> ['3ds', '3g2', …] +``` + +## Related + +- [is-binary-path](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file +- [text-extensions](https://github.com/sindresorhus/text-extensions) - List of text file extensions diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..de3226673c3874b1c6506db022393c753495655c --- /dev/null +++ b/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aeea256173bdf7893b4e98a1363f16f9199f3318 --- /dev/null +++ b/node_modules/brace-expansion/README.md @@ -0,0 +1,151 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str, [options]) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +The `options` object can provide a `max` value to cap the number +of expansions allowed. This is limited to `100_000` by default, +to prevent DoS attacks. + +```js +const expansions = expand('{1..100}'.repeat(5), { + max: 100, +}) +// expansions.length will be 100, not 100^5 +``` + +The `options` object can also provide a `maxLength` value to cap the +total number of characters across all expansions. This is limited to +`4_000_000` by default, to prevent memory exhaustion from inputs whose +result count stays under `max` while each result grows very long. + +```js +const expansions = expand('{a,b}'.repeat(1500), { + maxLength: 10_000, +}) +``` + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0b707aa348b02ca3374e1e50f66e07ebcd910568 --- /dev/null +++ b/node_modules/brace-expansion/index.js @@ -0,0 +1,382 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +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'; + +var EXPANSION_MAX = 100000 + +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +var EXPANSION_MAX_LENGTH = 4000000 + +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 +// 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 = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + 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, options) { + if (!str) + return []; + + options = options || {}; + var max = options.max == null ? EXPANSION_MAX : options.max; + var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH : options.maxLength; + + // 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), max, maxLength, 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; +} + +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +// +// `base[a]` is the length of the part of `acc[a]` that predates the current +// empty-drop baseline (see `expand`). The matching baselines for the results +// are appended to `outBase`, which the caller carries forward alongside them. +function combine( + acc, + base, + pre, + values, + max, + maxLength, + dropEmpties, + outBase +) { + var out = [] + var length = 0 + for (var a = 0; a < acc.length; a++) { + for (var v = 0; v < values.length; v++) { + if (out.length >= max) return out + var expansion = acc[a] + pre + values[v] + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. "Empty" + // means "adds nothing past the baseline", not "empty overall". + if (dropEmpties && expansion.length === base[a]) continue + if (length + expansion.length > maxLength) return out + out.push(expansion) + outBase.push(base[a]) + length += expansion.length + } + } + return out +} + +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence( + body, + isAlphaSequence, + max, + maxLength +) { + var n = body.split(/\.\./) + var N = [] + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N + } + /* c8 ignore stop */ + var x = numeric(n[0]) + var y = numeric(n[1]) + var width = Math.max(n[0].length, n[1].length) + var incr = + n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1 + var test = lte + var reverse = y < x + if (reverse) { + incr *= -1 + test = gte + } + var pad = n.some(isPadded) + + var length = 0 + for (var i = x; test(i, y) && N.length < max; 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 + } + } + } + } + if (length + c.length > maxLength) break + N.push(c) + length += c.length + } + return N +} + +function expand( + str, + max, + maxLength, + isTop +) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + var acc = [''] + + // Bash drops empty results, but only when the *first* group of the run is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + // + // The old implementation recursed on `m.post`, so the drop tested only the + // expansion of the current call's substring. The `{a},b}` rewrite below turns + // `isTop` back on part-way through a string, starting a fresh such run, so + // the drop must ignore whatever `acc` already holds from earlier groups. + // `accBase[a]` records how much of `acc[a]` predates the current run; + // `combine` treats an expansion as empty when it adds nothing past that. + var accBase = [0] + var dropEmpties = false + var firstGroup = true + var nextBase + + for (;;) { + var m = balanced('{', '}', str); + + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, accBase, str, [''], max, maxLength, dropEmpties, []) + } + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + + // For compatibility reasons, `${` is not eligible for brace expansion, and + // on the 1.x line it suppresses expansion of the rest of the string too: + // the whole remainder is literal. The 2.x and 5.x lines instead keep + // expanding the tail, which is what bash does, but changing that here would + // be a breaking change for 1.x consumers. Routed through `combine` so the + // result is still bounded by `max` and `maxLength`. + if (/\$$/.test(pre)) { + return combine(acc, accBase, str, [''], max, maxLength, dropEmpties, []) + } + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + 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; + // The rewritten string is expanded as if it were a fresh top-level one, + // so start a new empty-drop run: anchor the baseline at what `acc` + // holds now, and let the next expanding group decide whether to drop. + isTop = true + firstGroup = true + dropEmpties = false + accBase = [] + for (var b = 0; b < acc.length; b++) { + accBase.push(acc[b].length) + } + continue + } + // Nothing here expands, so the whole remaining string is literal. + return combine( + acc, + accBase, + pre + '{' + m.body + '}' + m.post, + [''], + max, + maxLength, + dropEmpties, + [] + ) + } + + if (firstGroup) { + dropEmpties = isTop && !isSequence + firstGroup = false + } + + var values; + if (isSequence) { + values = expandSequence(m.body, isAlphaSequence, max, maxLength); + } else { + var n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], max, maxLength, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + nextBase = [] + acc = combine( + acc, + accBase, + pre + n[0], + [''], + max, + maxLength, + dropEmpties && !m.post.length, + nextBase + ) + accBase = nextBase + if (!m.post.length) break + str = m.post + continue + } + /* c8 ignore stop */ + } + + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. A value is dropped when it adds nothing past the + // baseline, which is what `combine` tests. + var dropsEmpties = dropEmpties && !m.post.length && !pre + for (var d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d].length !== accBase[d]) { + dropsEmpties = false + } + } + + values = [] + var valuesLength = 0 + outer: for (var j = 0; j < n.length; j++) { + var expanded = expand(n[j], max, maxLength, false) + for (var k = 0; k < expanded.length; k++) { + var v = expanded[k] + if (dropsEmpties && !v) continue + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer + } + values.push(v) + valuesLength += v.length + } + } + } + + nextBase = [] + acc = combine( + acc, + accBase, + pre, + values, + max, + maxLength, + dropEmpties && !m.post.length, + nextBase + ) + accBase = nextBase + if (!m.post.length) break + str = m.post + } + + return acc +} diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..95d403979e5e0f26d745071674166e9d7d8f9970 --- /dev/null +++ b/node_modules/brace-expansion/package.json @@ -0,0 +1,50 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.18", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "publishConfig": { + "tag": "1.x" + } +} diff --git a/node_modules/braces/LICENSE b/node_modules/braces/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9af4a67d206f24ecdbb5fdff2839041ca0bbd346 --- /dev/null +++ b/node_modules/braces/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/braces/README.md b/node_modules/braces/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f59dd604566f1239274c4caf6d88b90b4ddeb25d --- /dev/null +++ b/node_modules/braces/README.md @@ -0,0 +1,586 @@ +# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save braces +``` + +## v3.0.0 Released!! + +See the [changelog](CHANGELOG.md) for details. + +## Why use braces? + +Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. + +- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) +- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. +- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. +- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). +- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). +- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` +- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` +- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` +- [Supports escaping](#escaping) - To prevent evaluation of special characters. + +## Usage + +The main export is a function that takes one or more brace `patterns` and `options`. + +```js +const braces = require('braces'); +// braces(patterns[, options]); + +console.log(braces(['{01..05}', '{a..e}'])); +//=> ['(0[1-5])', '([a-e])'] + +console.log(braces(['{01..05}', '{a..e}'], { expand: true })); +//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] +``` + +### Brace Expansion vs. Compilation + +By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. + +**Compiled** + +```js +console.log(braces('a/{x,y,z}/b')); +//=> ['a/(x|y|z)/b'] +console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); +//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] +``` + +**Expanded** + +Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): + +```js +console.log(braces('a/{x,y,z}/b', { expand: true })); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] + +console.log(braces.expand('{01..10}')); +//=> ['01','02','03','04','05','06','07','08','09','10'] +``` + +### Lists + +Expand lists (like Bash "sets"): + +```js +console.log(braces('a/{foo,bar,baz}/*.js')); +//=> ['a/(foo|bar|baz)/*.js'] + +console.log(braces.expand('a/{foo,bar,baz}/*.js')); +//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] +``` + +### Sequences + +Expand ranges of characters (like Bash "sequences"): + +```js +console.log(braces.expand('{1..3}')); // ['1', '2', '3'] +console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] +console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] +console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] + +// supports zero-padded ranges +console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] +console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] +``` + +See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. + +### Steppped ranges + +Steps, or increments, may be used with ranges: + +```js +console.log(braces.expand('{2..10..2}')); +//=> ['2', '4', '6', '8', '10'] + +console.log(braces('{2..10..2}')); +//=> ['(2|4|6|8|10)'] +``` + +When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. + +### Nesting + +Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. + +**"Expanded" braces** + +```js +console.log(braces.expand('a{b,c,/{x,y}}/e')); +//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] + +console.log(braces.expand('a/{x,{1..5},y}/c')); +//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] +``` + +**"Optimized" braces** + +```js +console.log(braces('a{b,c,/{x,y}}/e')); +//=> ['a(b|c|/(x|y))/e'] + +console.log(braces('a/{x,{1..5},y}/c')); +//=> ['a/(x|([1-5])|y)/c'] +``` + +### Escaping + +**Escaping braces** + +A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: + +```js +console.log(braces.expand('a\\{d,c,b}e')); +//=> ['a{d,c,b}e'] + +console.log(braces.expand('a{d,c,b\\}e')); +//=> ['a{d,c,b}e'] +``` + +**Escaping commas** + +Commas inside braces may also be escaped: + +```js +console.log(braces.expand('a{b\\,c}d')); +//=> ['a{b,c}d'] + +console.log(braces.expand('a{d\\,c,b}e')); +//=> ['ad,ce', 'abe'] +``` + +**Single items** + +Following bash conventions, a brace pattern is also not expanded when it contains a single character: + +```js +console.log(braces.expand('a{b}c')); +//=> ['a{b}c'] +``` + +## Options + +### options.maxLength + +**Type**: `Number` + +**Default**: `10,000` + +**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. + +```js +console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error +``` + +### options.expand + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). + +```js +console.log(braces('a/{b,c}/d', { expand: true })); +//=> [ 'a/b/d', 'a/c/d' ] +``` + +### options.nodupes + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Remove duplicates from the returned array. + +### options.rangeLimit + +**Type**: `Number` + +**Default**: `1000` + +**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. + +You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. + +**Examples** + +```js +// pattern exceeds the "rangeLimit", so it's optimized automatically +console.log(braces.expand('{1..1000}')); +//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + +// pattern does not exceed "rangeLimit", so it's NOT optimized +console.log(braces.expand('{1..100}')); +//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] +``` + +### options.transform + +**Type**: `Function` + +**Default**: `undefined` + +**Description**: Customize range expansion. + +**Example: Transforming non-numeric values** + +```js +const alpha = braces.expand('x/{a..e}/y', { + transform(value, index) { + // When non-numeric values are passed, "value" is a character code. + return 'foo/' + String.fromCharCode(value) + '-' + index; + }, +}); +console.log(alpha); +//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] +``` + +**Example: Transforming numeric values** + +```js +const numeric = braces.expand('{1..5}', { + transform(value) { + // when numeric values are passed, "value" is a number + return 'foo/' + value * 2; + }, +}); +console.log(numeric); +//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] +``` + +### options.quantifiers + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + +Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + +The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. + +**Examples** + +```js +const braces = require('braces'); +console.log(braces('a/b{1,3}/{x,y,z}')); +//=> [ 'a/b(1|3)/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true })); +//=> [ 'a/b{1,3}/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true })); +//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] +``` + +### options.keepEscaping + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Do not strip backslashes that were used for escaping from the result. + +## What is "brace expansion"? + +Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). + +In addition to "expansion", braces are also used for matching. In other words: + +- [brace expansion](#brace-expansion) is for generating new lists +- [brace matching](#brace-matching) is for filtering existing lists + +
+More about brace expansion (click to expand) + +There are two main types of brace expansion: + +1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` +2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". + +Here are some example brace patterns to illustrate how they work: + +**Sets** + +``` +{a,b,c} => a b c +{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 +``` + +**Sequences** + +``` +{1..9} => 1 2 3 4 5 6 7 8 9 +{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 +{1..20..3} => 1 4 7 10 13 16 19 +{a..j} => a b c d e f g h i j +{j..a} => j i h g f e d c b a +{a..z..3} => a d g j m p s v y +``` + +**Combination** + +Sets and sequences can be mixed together or used along with any other strings. + +``` +{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 +foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar +``` + +The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. + +## Brace matching + +In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. + +For example, the pattern `foo/{1..3}/bar` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +``` + +But not: + +``` +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +## Brace matching pitfalls + +Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. + +### tldr + +**"brace bombs"** + +- brace expansion can eat up a huge amount of processing resources +- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially +- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) + +For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. + +### The solution + +Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. + +### Geometric complexity + +At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. + +For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: + +``` +{1,2}{3,4} => (2X2) => 13 14 23 24 +{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 +``` + +But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: + +``` +{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 + 249 257 258 259 267 268 269 347 348 349 357 + 358 359 367 368 369 +``` + +Now, imagine how this complexity grows given that each element is a n-tuple: + +``` +{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) +{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) +``` + +Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. + +**More information** + +Interested in learning more about brace expansion? + +- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) +- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) +- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) + +
+ +## Performance + +Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. + +### Better algorithms + +Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. + +Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. + +**The proof is in the numbers** + +Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------------------- | ------------------- | ---------------------------- | +| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes) | +| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | +| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | +| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | +| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | +| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | +| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | +| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | +| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | +| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | +| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | +| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | +| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | +| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | +| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | +| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | +| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | + +### Faster algorithms + +When you need expansion, braces is still much faster. + +_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------- | --------------------------- | ---------------------------- | +| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | +| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | +| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | +| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | +| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | +| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | +| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | +| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | + +If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm benchmark +``` + +### Latest results + +Braces is more accurate, without sacrificing performance. + +```bash +● expand - range (expanded) + braces x 53,167 ops/sec ±0.12% (102 runs sampled) + minimatch x 11,378 ops/sec ±0.10% (102 runs sampled) +● expand - range (optimized for regex) + braces x 373,442 ops/sec ±0.04% (100 runs sampled) + minimatch x 3,262 ops/sec ±0.18% (100 runs sampled) +● expand - nested ranges (expanded) + braces x 33,921 ops/sec ±0.09% (99 runs sampled) + minimatch x 10,855 ops/sec ±0.28% (100 runs sampled) +● expand - nested ranges (optimized for regex) + braces x 287,479 ops/sec ±0.52% (98 runs sampled) + minimatch x 3,219 ops/sec ±0.28% (101 runs sampled) +● expand - set (expanded) + braces x 238,243 ops/sec ±0.19% (97 runs sampled) + minimatch x 538,268 ops/sec ±0.31% (96 runs sampled) +● expand - set (optimized for regex) + braces x 321,844 ops/sec ±0.10% (97 runs sampled) + minimatch x 140,600 ops/sec ±0.15% (100 runs sampled) +● expand - nested sets (expanded) + braces x 165,371 ops/sec ±0.42% (96 runs sampled) + minimatch x 337,720 ops/sec ±0.28% (100 runs sampled) +● expand - nested sets (optimized for regex) + braces x 242,948 ops/sec ±0.12% (99 runs sampled) + minimatch x 87,403 ops/sec ±0.79% (96 runs sampled) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| ----------- | ------------------------------------------------------------- | +| 197 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | +| 1 | [hemanth](https://github.com/hemanth) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +- [GitHub Profile](https://github.com/jonschlinkert) +- [Twitter Profile](https://twitter.com/jonschlinkert) +- [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +--- + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d222c13b579d2d476dc26d692219dbaee1665b88 --- /dev/null +++ b/node_modules/braces/index.js @@ -0,0 +1,170 @@ +'use strict'; + +const stringify = require('./lib/stringify'); +const compile = require('./lib/compile'); +const expand = require('./lib/expand'); +const parse = require('./lib/parse'); + +/** + * 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 = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const 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 = (input, options = {}) => 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 = (input, options = {}) => { + 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 = (input, options = {}) => { + 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 = (input, options = {}) => { + 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 = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; + +/** + * Expose "braces" + */ + +module.exports = braces; diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js new file mode 100644 index 0000000000000000000000000000000000000000..dce69beb90ece5c3b0ca234a949418f9f34eedbc --- /dev/null +++ b/node_modules/braces/lib/compile.js @@ -0,0 +1,60 @@ +'use strict'; + +const fill = require('fill-range'); +const utils = require('./utils'); + +const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + 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) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); +}; + +module.exports = compile; diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..2bb3b8840382c56700869b3a9e1f958fcce01efd --- /dev/null +++ b/node_modules/braces/lib/constants.js @@ -0,0 +1,57 @@ +'use strict'; + +module.exports = { + MAX_LENGTH: 10000, + + // 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 */ +}; diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js new file mode 100644 index 0000000000000000000000000000000000000000..35b2c41d6afdb8f0197959e26079f266e48370d3 --- /dev/null +++ b/node_modules/braces/lib/expand.js @@ -0,0 +1,113 @@ +'use strict'; + +const fill = require('fill-range'); +const stringify = require('./stringify'); +const utils = require('./utils'); + +const append = (queue = '', stash = '', enclose = false) => { + const 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 (const item of queue) { + if (Array.isArray(item)) { + for (const 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 = (ast, options = {}) => { + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + 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) { + const 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; + } + + const 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++) { + const 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; diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..3a6988e629f52aee6609dc5ec290a5e9ff47cecb --- /dev/null +++ b/node_modules/braces/lib/parse.js @@ -0,0 +1,331 @@ +'use strict'; + +const stringify = require('./stringify'); + +/** + * 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 +} = require('./constants'); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const 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})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * 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 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) { + const 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++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const 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; + } + + const 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; + const 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) { + const 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(); + + const 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) + const parent = stack[stack.length - 1]; + const 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; diff --git a/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..8bcf872c31894f81a8c64d9202fd607e4fd7ea2b --- /dev/null +++ b/node_modules/braces/lib/stringify.js @@ -0,0 +1,32 @@ +'use strict'; + +const utils = require('./utils'); + +module.exports = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const 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 (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..d19311fe044ad5157624077670dc297e8b53da49 --- /dev/null +++ b/node_modules/braces/lib/utils.js @@ -0,0 +1,122 @@ +'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 = (min, max, step = 1, limit) => { + 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 = (block, n = 0, type) => { + const 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 = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; +}; diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c3c056e469726cdb0d0cb6cec73b3f79abf0eb23 --- /dev/null +++ b/node_modules/braces/package.json @@ -0,0 +1,77 @@ +{ + "name": "braces", + "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", + "version": "3.0.3", + "homepage": "https://github.com/micromatch/braces", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Elan Shanker (https://github.com/es128)", + "Eugene Sharygin (https://github.com/eush77)", + "hemanth.hm (http://h3manth.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/braces", + "bugs": { + "url": "https://github.com/micromatch/braces/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha", + "benchmark": "node benchmark" + }, + "dependencies": { + "fill-range": "^7.1.1" + }, + "devDependencies": { + "ansi-colors": "^3.2.4", + "bash-path": "^2.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1" + }, + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "braces", + "expand", + "expansion", + "filepath", + "fill", + "fs", + "glob", + "globbing", + "letter", + "match", + "matches", + "matching", + "number", + "numerical", + "path", + "range", + "ranges", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "plugins": [ + "gulp-format-md" + ] + } +} diff --git a/node_modules/browserslist/LICENSE b/node_modules/browserslist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..042c18918ef034391a2bab8661a59714b2a00446 --- /dev/null +++ b/node_modules/browserslist/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2014 Andrey Sitnik and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/browserslist/README.md b/node_modules/browserslist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c7af38840bac5a971620c2920685c5d4e7260740 --- /dev/null +++ b/node_modules/browserslist/README.md @@ -0,0 +1,66 @@ +# Browserslist + +Browserslist logo by Anton Popov + +The config to share target browsers and Node.js versions between different +front-end tools. It is used in: + +- [Autoprefixer] +- [Babel] +- [postcss-preset-env] +- [eslint-plugin-compat] +- [stylelint-no-unsupported-browser-features] +- [postcss-normalize] +- [obsolete-webpack-plugin] + +All tools will find target browsers automatically, +when you add the following to `package.json`: + +```json + "browserslist": [ + "defaults and fully supports es6-module", + "maintained node versions" + ] +``` + +Or in `.browserslistrc` config: + +```yaml +# Browsers that we support + +defaults and fully supports es6-module +maintained node versions +``` + +Developers set their version lists using queries like `last 2 versions` +to be free from updating versions manually. +Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries. + +You can check how config works at our playground: [`browsersl.ist`](https://browsersl.ist/) + +
+ browsersl.ist website + + +
+ +--- + +  Browserslist is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups. + +--- + +[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features +[obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin +[eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat +[postcss-preset-env]: https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env +[postcss-normalize]: https://github.com/csstools/postcss-normalize +[`browsersl.ist`]: https://browsersl.ist/ +[`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite +[Autoprefixer]: https://github.com/postcss/autoprefixer +[Can I Use]: https://caniuse.com/ +[Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env + +## Docs +Read full docs **[here](https://github.com/browserslist/browserslist#readme)**. diff --git a/node_modules/browserslist/browser.js b/node_modules/browserslist/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..1a681fd3e2c2961af31e1e778b18723a0e119035 --- /dev/null +++ b/node_modules/browserslist/browser.js @@ -0,0 +1,54 @@ +var BrowserslistError = require('./error') + +function noop() {} + +module.exports = { + loadQueries: function loadQueries() { + throw new BrowserslistError( + 'Sharable configs are not supported in client-side build of Browserslist' + ) + }, + + getStat: function getStat(opts) { + return opts.stats + }, + + loadConfig: function loadConfig(opts) { + if (opts.config) { + throw new BrowserslistError( + 'Browserslist config are not supported in client-side build' + ) + } + }, + + loadCountry: function loadCountry() { + throw new BrowserslistError( + 'Country statistics are not supported ' + + 'in client-side build of Browserslist' + ) + }, + + loadFeature: function loadFeature() { + throw new BrowserslistError( + 'Supports queries are not available in client-side build of Browserslist' + ) + }, + + currentNode: function currentNode(resolve, context) { + return resolve(['maintained node versions'], context)[0] + }, + + parseConfig: noop, + + readConfig: noop, + + findConfig: noop, + + findConfigFile: noop, + + clearCaches: noop, + + oldDataWarning: noop, + + env: {} +} diff --git a/node_modules/browserslist/cli.js b/node_modules/browserslist/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..78c08d743a8e478c346029e241b1f795b646fbd2 --- /dev/null +++ b/node_modules/browserslist/cli.js @@ -0,0 +1,156 @@ +#!/usr/bin/env node + +var fs = require('fs') +var updateDb = require('update-browserslist-db') + +var browserslist = require('./') +var pkg = require('./package.json') + +var args = process.argv.slice(2) + +var USAGE = + 'Usage:\n' + + ' npx browserslist\n' + + ' npx browserslist "QUERIES"\n' + + ' npx browserslist --json "QUERIES"\n' + + ' npx browserslist --config="path/to/browserlist/file"\n' + + ' npx browserslist --coverage "QUERIES"\n' + + ' npx browserslist --coverage=US "QUERIES"\n' + + ' npx browserslist --coverage=US,RU,global "QUERIES"\n' + + ' npx browserslist --env="environment name defined in config"\n' + + ' npx browserslist --stats="path/to/browserlist/stats/file"\n' + + ' npx browserslist --mobile-to-desktop\n' + + ' npx browserslist --ignore-unknown-versions\n' + +function isArg(arg) { + return args.some(function (str) { + return str === arg || str.indexOf(arg + '=') === 0 + }) +} + +function error(msg) { + process.stderr.write('browserslist: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(pkg.description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist ' + pkg.version + '\n') +} else if (isArg('--update-db')) { + /* c8 ignore next 8 */ + process.stdout.write( + 'The --update-db command is deprecated.\n' + + 'Please use npx update-browserslist-db@latest instead.\n' + ) + process.stdout.write('Browserslist DB update will still be made.\n') + updateDb(function (str) { + process.stdout.write(str) + }) +} else { + var mode = 'browsers' + var opts = {} + var queries + var areas + + for (var i = 0; i < args.length; i++) { + if (args[i][0] !== '-') { + queries = args[i].replace(/^["']|["']$/g, '') + continue + } + + var arg = args[i].split('=') + var name = arg[0] + var value = arg[1] + + if (value) value = value.replace(/^["']|["']$/g, '') + + if (name === '--config' || name === '-b') { + opts.config = value + } else if (name === '--env' || name === '-e') { + opts.env = value + } else if (name === '--stats' || name === '-s') { + opts.stats = value + } else if (name === '--coverage' || name === '-c') { + if (mode !== 'json') mode = 'coverage' + if (value) { + areas = value.split(',') + } else { + areas = ['global'] + } + } else if (name === '--json') { + mode = 'json' + } else if (name === '--mobile-to-desktop') { + /* c8 ignore next */ + opts.mobileToDesktop = true + } else if (name === '--ignore-unknown-versions') { + /* c8 ignore next */ + opts.ignoreUnknownVersions = true + } else { + error('Unknown arguments ' + args[i] + '.\n\n' + USAGE) + } + } + + var browsers + try { + browsers = browserslist(queries, opts) + } catch (e) { + if (e.name === 'BrowserslistError') { + error(e.message) + } /* c8 ignore start */ else { + throw e + } /* c8 ignore end */ + } + + var coverage + if (mode === 'browsers') { + browsers.forEach(function (browser) { + process.stdout.write(browser + '\n') + }) + } else if (areas) { + coverage = areas.map(function (area) { + var stats + if (area !== 'global') { + stats = area + } else if (opts.stats) { + stats = JSON.parse(fs.readFileSync(opts.stats)) + } + var result = browserslist.coverage(browsers, stats) + var round = Math.round(result * 100) / 100.0 + + return [area, round] + }) + + if (mode === 'coverage') { + var prefix = 'These browsers account for ' + process.stdout.write(prefix) + coverage.forEach(function (data, index) { + var area = data[0] + var round = data[1] + var end = 'globally' + if (area && area !== 'global') { + end = 'in the ' + area.toUpperCase() + } else if (opts.stats) { + end = 'in custom statistics' + } + + if (index !== 0) { + process.stdout.write(prefix.replace(/./g, ' ')) + } + + process.stdout.write(round + '% of all users ' + end + '\n') + }) + } + } + + if (mode === 'json') { + var data = { browsers: browsers } + if (coverage) { + data.coverage = coverage.reduce(function (object, j) { + object[j[0]] = j[1] + return object + }, {}) + } + process.stdout.write(JSON.stringify(data, null, ' ') + '\n') + } +} diff --git a/node_modules/browserslist/error.d.ts b/node_modules/browserslist/error.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..12ff92133a997520119a8473ff3a69d7b413d6bd --- /dev/null +++ b/node_modules/browserslist/error.d.ts @@ -0,0 +1,7 @@ +declare class BrowserslistError extends Error { + constructor(message: any) + name: 'BrowserslistError' + browserslist: true +} + +export = BrowserslistError diff --git a/node_modules/browserslist/error.js b/node_modules/browserslist/error.js new file mode 100644 index 0000000000000000000000000000000000000000..6e5da7a823f4af93000b3a6798de0c31cec26340 --- /dev/null +++ b/node_modules/browserslist/error.js @@ -0,0 +1,12 @@ +function BrowserslistError(message) { + this.name = 'BrowserslistError' + this.message = message + this.browserslist = true + if (Error.captureStackTrace) { + Error.captureStackTrace(this, BrowserslistError) + } +} + +BrowserslistError.prototype = Error.prototype + +module.exports = BrowserslistError diff --git a/node_modules/browserslist/index.d.ts b/node_modules/browserslist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a08176cc1ab9dfcac2e6ce65146ef051ace07140 --- /dev/null +++ b/node_modules/browserslist/index.d.ts @@ -0,0 +1,224 @@ +/** + * Return array of browsers by selection queries. + * + * ```js + * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8'] + * ``` + * + * @param queries Browser queries. + * @param opts Options. + * @returns Array with browser names in Can I Use. + */ +declare function browserslist( + queries?: string | readonly string[] | null, + opts?: browserslist.Options +): string[] + +declare namespace browserslist { + interface Query { + compose: 'or' | 'and' + type: string + query: string + not?: true + } + + interface Options { + /** + * Path to processed file. It will be used to find config files. + */ + path?: string | false + /** + * Processing environment. It will be used to take right queries + * from config file. + */ + env?: string + /** + * Custom browser usage statistics for "> 1% in my stats" query. + */ + stats?: Stats | string + /** + * Path to config file with queries. + */ + config?: string + /** + * Do not throw on unknown version in direct query. + */ + ignoreUnknownVersions?: boolean + /** + * Throw an error if env is not found. + */ + throwOnMissing?: boolean + /** + * Disable security checks for extend query. + */ + dangerousExtend?: boolean + /** + * Alias mobile browsers to the desktop version when Can I Use + * doesn’t have data about the specified version. + */ + mobileToDesktop?: boolean + } + + type Config = { + defaults: string[] + [section: string]: string[] | undefined + } + + interface Stats { + [browser: string]: { + [version: string]: number + } + } + + /** + * Browser names aliases. + */ + let aliases: { + [alias: string]: string | undefined + } + + /** + * Aliases to work with joined versions like `ios_saf 7.0-7.1`. + */ + let versionAliases: { + [browser: string]: + | { + [version: string]: string | undefined + } + | undefined + } + + /** + * Can I Use only provides a few versions for some browsers (e.g. `and_chr`). + * + * Fallback to a similar browser for unknown versions. + */ + let desktopNames: { + [browser: string]: string | undefined + } + + let data: { + [browser: string]: + | { + name: string + versions: string[] + released: string[] + releaseDate: { + [version: string]: number | undefined | null + } + } + | undefined + } + + let nodeVersions: string[] + + interface Usage { + [version: string]: number + } + + let usage: { + global?: Usage + custom?: Usage | null + [country: string]: Usage | undefined | null + } + + let cache: { + [feature: string]: { + [name: string]: { + [version: string]: string + } + } + } + + /** + * Default browsers query + */ + let defaults: readonly string[] + + /** + * Which statistics should be used. Country code or custom statistics. + * Pass `"my stats"` to load statistics from `Browserslist` files. + */ + type StatsOptions = string | 'my stats' | Stats | { dataByBrowser: Stats } + + /** + * Return browsers market coverage. + * + * ```js + * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1 + * ``` + * + * @param browsers Browsers names in Can I Use. + * @param stats Which statistics should be used. + * @returns Total market coverage for all selected browsers. + */ + function coverage(browsers: readonly string[], stats?: StatsOptions): number + + /** + * Get queries AST to analyze the config content. + * + * @param queries Browser queries. + * @param opts Options. + * @returns An array of the data of each query in the config. + */ + function parse( + queries?: string | readonly string[] | null, + opts?: browserslist.Options + ): Query[] + + /** + * Return queries for specific file inside the project. + * + * ```js + * browserslist.loadConfig({ + * file: process.cwd() + * }) ?? browserslist.defaults + * ``` + */ + function loadConfig(options: LoadConfigOptions): string[] | undefined + + function clearCaches(): void + + function parseConfig(string: string): Config + + function readConfig(file: string): Config + + function findConfig(...pathSegments: string[]): Config | undefined + + function findConfigFile(...pathSegments: string[]): string | undefined + + interface LoadConfigOptions { + /** + * Path to config file + * */ + config?: string + + /** + * Path to file inside the project to find Browserslist config + * in closest folder + */ + path?: string + + /** + * Environment to choose part of config. + */ + env?: string + } +} + +declare global { + namespace NodeJS { + interface ProcessEnv { + BROWSERSLIST?: string + BROWSERSLIST_CONFIG?: string + BROWSERSLIST_DANGEROUS_EXTEND?: string + BROWSERSLIST_DISABLE_CACHE?: string + BROWSERSLIST_ENV?: string + BROWSERSLIST_IGNORE_OLD_DATA?: string + BROWSERSLIST_STATS?: string + BROWSERSLIST_ROOT_PATH?: string + } + } +} + +export = browserslist diff --git a/node_modules/browserslist/index.js b/node_modules/browserslist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f3150385589fb9405dc5a8acd4994cbcca0a929f --- /dev/null +++ b/node_modules/browserslist/index.js @@ -0,0 +1,1350 @@ +var bbm = require('baseline-browser-mapping') +var jsReleases = require('node-releases/data/processed/envs.json') +var agents = require('caniuse-lite/dist/unpacker/agents').agents +var e2c = require('electron-to-chromium/versions') +var jsEOL = require('node-releases/data/release-schedule/release-schedule.json') +var path = require('path') + +var BrowserslistError = require('./error') +var env = require('./node') +var parseWithoutCache = require('./parse') // Will load browser.js in webpack + +var YEAR = 365.259641 * 24 * 60 * 60 * 1000 +var ANDROID_EVERGREEN_FIRST = '37' +var OP_MOB_BLINK_FIRST = 14 +var FIREFOX_ESR_VERSION = '140' + +// Helpers + +function isVersionsMatch(versionA, versionB) { + return (versionA + '.').indexOf(versionB + '.') === 0 +} + +function isEolReleased(name) { + var version = name.slice(1) + return browserslist.nodeVersions.some(function (i) { + return isVersionsMatch(i, version) + }) +} + +function normalize(versions) { + return versions.filter(function (version) { + return typeof version === 'string' + }) +} + +function normalizeElectron(version) { + var versionToUse = version + if (version.split('.').length === 3) { + versionToUse = version.split('.').slice(0, -1).join('.') + } + return versionToUse +} + +function nameMapper(name) { + return function mapName(version) { + return name + ' ' + version + } +} + +function getMajor(version) { + return parseInt(version.split('.')[0]) +} + +function getMajorVersions(released, number) { + if (released.length === 0) return [] + var majorVersions = uniq(released.map(getMajor)) + var minimum = majorVersions[majorVersions.length - number] + if (!minimum) { + return released + } + var selected = [] + for (var i = released.length - 1; i >= 0; i--) { + if (minimum > getMajor(released[i])) break + selected.unshift(released[i]) + } + return selected +} + +function uniq(array) { + var filtered = [] + for (var i = 0; i < array.length; i++) { + if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]) + } + return filtered +} + +function fillUsage(result, name, data) { + for (var i in data) { + result[name + ' ' + i] = data[i] + } +} + +function generateFilter(sign, version) { + if (sign === '>') { + return function (v) { + return parseLatestFloat(v) > parseLatestFloat(version) + } + } else if (sign === '>=') { + return function (v) { + return parseLatestFloat(v) >= parseLatestFloat(version) + } + } else if (sign === '<') { + return function (v) { + return parseFloat(v) < parseFloat(version) + } + } else { + return function (v) { + return parseFloat(v) <= parseFloat(version) + } + } + + function parseLatestFloat(v) { + return parseFloat(v.split('-')[1] || v) + } +} + +function generateSemverFilter(sign, version) { + version = version.split('.').map(parseSimpleInt) + version[1] = version[1] || 0 + version[2] = version[2] || 0 + if (sign === '>') { + return function (v) { + v = v.split('.').map(parseSimpleInt) + return compareSemver(v, version) > 0 + } + } else if (sign === '>=') { + return function (v) { + v = v.split('.').map(parseSimpleInt) + return compareSemver(v, version) >= 0 + } + } else if (sign === '<') { + return function (v) { + v = v.split('.').map(parseSimpleInt) + return compareSemver(version, v) > 0 + } + } else { + return function (v) { + v = v.split('.').map(parseSimpleInt) + return compareSemver(version, v) >= 0 + } + } +} + +function parseSimpleInt(x) { + return parseInt(x) +} + +function compare(a, b) { + if (a < b) return -1 + if (a > b) return +1 + return 0 +} + +function compareSemver(a, b) { + return ( + compare(parseInt(a[0]), parseInt(b[0])) || + compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) || + compare(parseInt(a[2] || '0'), parseInt(b[2] || '0')) + ) +} + +// this follows the npm-like semver behavior +function semverFilterLoose(operator, range) { + range = range.split('.').map(parseSimpleInt) + if (typeof range[1] === 'undefined') { + range[1] = 'x' + } + // ignore any patch version because we only return minor versions + // range[2] = 'x' + switch (operator) { + case '<=': + return function (version) { + version = version.split('.').map(parseSimpleInt) + return compareSemverLoose(version, range) <= 0 + } + case '>=': + default: + return function (version) { + version = version.split('.').map(parseSimpleInt) + return compareSemverLoose(version, range) >= 0 + } + } +} + +// this follows the npm-like semver behavior +function compareSemverLoose(version, range) { + if (version[0] !== range[0]) { + return version[0] < range[0] ? -1 : +1 + } + if (range[1] === 'x') { + return 0 + } + if (version[1] !== range[1]) { + return version[1] < range[1] ? -1 : +1 + } + return 0 +} + +function resolveVersion(data, version) { + if (data.versions.indexOf(version) !== -1) { + return version + } else if (browserslist.versionAliases[data.name][version]) { + return browserslist.versionAliases[data.name][version] + } else { + return false + } +} + +function normalizeVersion(data, version) { + var resolved = resolveVersion(data, version) + if (resolved) { + return resolved + } else if (data.versions.length === 1) { + return data.versions[0] + } else { + return false + } +} + +function filterByYear(since, context) { + since = since / 1000 + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name, context) + if (!data) return selected + var versions = Object.keys(data.releaseDate).filter(function (v) { + var date = data.releaseDate[v] + return date !== null && date >= since + }) + return selected.concat(versions.map(nameMapper(data.name))) + }, []) +} + +function cloneData(data) { + return { + name: data.name, + versions: data.versions, + released: data.released, + releaseDate: data.releaseDate + } +} + +function byName(name, context) { + name = name.toLowerCase() + name = browserslist.aliases[name] || name + if (context.mobileToDesktop && browserslist.desktopNames[name]) { + var desktop = browserslist.data[browserslist.desktopNames[name]] + if (name === 'android') { + return normalizeAndroidData(cloneData(browserslist.data[name]), desktop) + } else { + var cloned = cloneData(desktop) + cloned.name = name + return cloned + } + } + return browserslist.data[name] +} + +function normalizeAndroidVersions(androidVersions, chromeVersions) { + var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST) + return androidVersions + .filter(function (version) { + return /^(?:[2-4]\.|[34]$)/.test(version) + }) + .concat(chromeVersions.slice(iFirstEvergreen)) +} + +var DANGEROUS_KEYS = ['__proto__', 'constructor', 'prototype'] + +function copyObject(obj) { + var copy = {} + for (var key in obj) { + if (DANGEROUS_KEYS.indexOf(key) === -1) { + copy[key] = obj[key] + } + } + return copy +} + +function normalizeAndroidData(android, chrome) { + android.released = normalizeAndroidVersions(android.released, chrome.released) + android.versions = normalizeAndroidVersions(android.versions, chrome.versions) + android.releaseDate = copyObject(android.releaseDate) + android.released.forEach(function (v) { + if (android.releaseDate[v] === undefined) { + android.releaseDate[v] = chrome.releaseDate[v] + } + }) + return android +} + +function checkName(name, context) { + var data = byName(name, context) + if (!data) throw new BrowserslistError('Unknown browser ' + name) + return data +} + +function unknownQuery(query) { + return new BrowserslistError( + 'Unknown browser query `' + + query + + '`. ' + + 'Maybe you are using old Browserslist or made typo in query.' + ) +} + +// Adjusts last X versions queries for some mobile browsers, +// where caniuse data jumps from a legacy version to the latest +function filterJumps(list, name, nVersions, context) { + var jump = 1 + switch (name) { + case 'android': + if (context.mobileToDesktop) return list + var released = browserslist.data.chrome.released + jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST) + break + case 'op_mob': + var latest = browserslist.data.op_mob.released.slice(-1)[0] + jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1 + break + default: + return list + } + if (nVersions <= jump) { + return list.slice(-1) + } + return list.slice(jump - 1 - nVersions) +} + +function isSupported(flags, withPartial) { + return ( + typeof flags === 'string' && + (flags.indexOf('y') >= 0 || (withPartial && flags.indexOf('a') >= 0)) + ) +} + +function resolve(queries, context) { + return parseQueries(queries).reduce(function (result, node, index) { + if (node.not && index === 0) { + throw new BrowserslistError( + 'Write any browsers query (for instance, `defaults`) ' + + 'before `' + + node.query + + '`' + ) + } + var type = QUERIES[node.type] + var array = type.select.call(browserslist, context, node).map(function (j) { + var parts = j.split(' ') + if (parts[1] === '0') { + return parts[0] + ' ' + byName(parts[0], context).versions[0] + } else { + return j + } + }) + + if (node.compose === 'and') { + if (node.not) { + return result.filter(function (j) { + return array.indexOf(j) === -1 + }) + } else { + return result.filter(function (j) { + return array.indexOf(j) !== -1 + }) + } + } else { + if (node.not) { + var filter = {} + array.forEach(function (j) { + filter[j] = true + }) + return result.filter(function (j) { + return !filter[j] + }) + } + for (var i = 0; i < array.length; i++) { + result.push(array[i]) + } + return result + } + }, []) +} + +function prepareOpts(opts) { + if (typeof opts === 'undefined') opts = {} + + if (typeof opts.path === 'undefined') { + opts.path = path.resolve ? path.resolve('.') : '.' + } + + return opts +} + +function prepareQueries(queries, opts) { + if (typeof queries === 'undefined' || queries === null) { + var config = browserslist.loadConfig(opts) + if (config) { + queries = config + } else { + queries = browserslist.defaults + } + } + + return queries +} + +function checkQueries(queries) { + if (!(typeof queries === 'string' || Array.isArray(queries))) { + throw new BrowserslistError( + 'Browser queries must be an array or string. Got ' + typeof queries + '.' + ) + } +} + +var CACHE_MAX_ENTRIES = 500 + +function boundedCacheSet(map, key, value) { + if (map.size >= CACHE_MAX_ENTRIES) { + map.delete(map.keys().next().value) + } + map.set(key, value) +} + +var cache = new Map() +var parseCache = new Map() + +function browserslist(queries, opts) { + opts = prepareOpts(opts) + queries = prepareQueries(queries, opts) + checkQueries(queries) + + var needsPath = parseQueries(queries).some(function (node) { + return QUERIES[node.type].needsPath + }) + var context = { + ignoreUnknownVersions: opts.ignoreUnknownVersions, + dangerousExtend: opts.dangerousExtend, + throwOnMissing: opts.throwOnMissing, + mobileToDesktop: opts.mobileToDesktop, + env: opts.env + } + // Removing to avoid using context.path without marking query as needsPath + if (needsPath) { + context.path = opts.path + } + + env.oldDataWarning(browserslist.data) + var stats = env.getStat(opts, browserslist.data) + if (stats) { + context.customUsage = {} + for (var browser in stats) { + fillUsage(context.customUsage, browser, stats[browser]) + } + } + + var cacheKey = JSON.stringify([queries, context]) + if (cache.has(cacheKey)) return cache.get(cacheKey) + + var result = uniq(resolve(queries, context)).sort(function (name1, name2) { + name1 = name1.split(' ') + name2 = name2.split(' ') + if (name1[0] === name2[0]) { + // assumptions on caniuse data + // 1) version ranges never overlaps + // 2) if version is not a range, it never contains `-` + var version1 = name1[1].split('-')[0] + var version2 = name2[1].split('-')[0] + return compareSemver(version2.split('.'), version1.split('.')) + } else { + return compare(name1[0], name2[0]) + } + }) + if (!env.env.BROWSERSLIST_DISABLE_CACHE) { + boundedCacheSet(cache, cacheKey, result) + } + return result +} + +function parseQueries(queries) { + var cacheKey = JSON.stringify(queries) + if (parseCache.has(cacheKey)) return parseCache.get(cacheKey) + var result = parseWithoutCache(QUERIES, queries) + if (!env.env.BROWSERSLIST_DISABLE_CACHE) { + boundedCacheSet(parseCache, cacheKey, result) + } + return result +} + +function loadCustomUsage(context, config) { + var stats = env.loadStat(context, config, browserslist.data) + if (stats) { + context.customUsage = {} + for (var browser in stats) { + fillUsage(context.customUsage, browser, stats[browser]) + } + } + if (!context.customUsage) { + throw new BrowserslistError('Custom usage statistics was not provided') + } + return context.customUsage +} + +browserslist.parse = function (queries, opts) { + opts = prepareOpts(opts) + queries = prepareQueries(queries, opts) + checkQueries(queries) + return parseQueries(queries) +} + +// Will be filled by Can I Use data below +browserslist.cache = {} +browserslist.data = {} +browserslist.usage = { + global: {}, + custom: null +} + +// Default browsers query +browserslist.defaults = ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'not dead'] + +// Browser names aliases +browserslist.aliases = { + fx: 'firefox', + ff: 'firefox', + ios: 'ios_saf', + explorer: 'ie', + blackberry: 'bb', + explorermobile: 'ie_mob', + operamini: 'op_mini', + operamobile: 'op_mob', + chromeandroid: 'and_chr', + firefoxandroid: 'and_ff', + ucandroid: 'and_uc', + qqandroid: 'and_qq' +} + +// Can I Use only provides a few versions for some browsers (e.g. and_chr). +// Fallback to a similar browser for unknown versions +// Note op_mob is not included as its chromium versions are not in sync with Opera desktop +browserslist.desktopNames = { + and_chr: 'chrome', + and_ff: 'firefox', + ie_mob: 'ie', + android: 'chrome' // has extra processing logic +} + +// Aliases to work with joined versions like `ios_saf 7.0-7.1` +browserslist.versionAliases = {} + +browserslist.clearCaches = env.clearCaches +browserslist.parseConfig = env.parseConfig +browserslist.readConfig = env.readConfig +browserslist.findConfigFile = env.findConfigFile +browserslist.findConfig = env.findConfig +browserslist.loadConfig = env.loadConfig + +browserslist.coverage = function (browsers, stats) { + var data + if (typeof stats === 'undefined') { + data = browserslist.usage.global + } else if (stats === 'my stats') { + var opts = {} + opts.path = path.resolve ? path.resolve('.') : '.' + var customStats = env.getStat(opts) + if (!customStats) { + throw new BrowserslistError('Custom usage statistics was not provided') + } + data = {} + for (var browser in customStats) { + fillUsage(data, browser, customStats[browser]) + } + } else if (typeof stats === 'string') { + if (stats.length > 2) { + stats = stats.toLowerCase() + } else { + stats = stats.toUpperCase() + } + env.loadCountry(browserslist.usage, stats, browserslist.data) + data = browserslist.usage[stats] + } else { + if ('dataByBrowser' in stats) { + stats = stats.dataByBrowser + } + data = {} + for (var name in stats) { + for (var version in stats[name]) { + data[name + ' ' + version] = stats[name][version] + } + } + } + + return browsers.reduce(function (all, i) { + var usage = data[i] + if (usage === undefined) { + usage = data[i.replace(/ \S+$/, ' 0')] + } + return all + (usage || 0) + }, 0) +} + +function nodeQuery(context, node) { + var matched = browserslist.nodeVersions.filter(function (i) { + return isVersionsMatch(i, node.version) + }) + if (matched.length === 0) { + if (context.ignoreUnknownVersions) { + return [] + } else { + throw new BrowserslistError( + 'Unknown version ' + node.version + ' of Node.js' + ) + } + } + return ['node ' + matched[matched.length - 1]] +} + +function sinceQuery(context, node) { + var year = parseInt(node.year) + var month = parseInt(node.month || '01') - 1 + var day = parseInt(node.day || '01') + return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context) +} + +function bbmTransform(bbmVersions) { + var browsers = { + chrome: 'chrome', + chrome_android: 'and_chr', + edge: 'edge', + firefox: 'firefox', + firefox_android: 'and_ff', + safari: 'safari', + safari_ios: 'ios_saf', + webview_android: 'android', + samsunginternet_android: 'samsung', + opera_android: 'op_mob', + opera: 'opera', + qq_android: 'and_qq', + uc_android: 'and_uc', + kai_os: 'kaios' + } + + return bbmVersions + .filter(function (version) { + return Object.keys(browsers).indexOf(version.browser) !== -1 + }) + .map(function (version) { + return browsers[version.browser] + ' >= ' + version.version + }) +} + +function coverQuery(context, node) { + var coverage = parseFloat(node.coverage) + var usage = browserslist.usage.global + if (node.place) { + if (node.place.match(/^my\s+stats$/i)) { + if (!context.customUsage) { + throw new BrowserslistError('Custom usage statistics was not provided') + } + usage = context.customUsage + } else { + var place + if (node.place.length === 2) { + place = node.place.toUpperCase() + } else { + place = node.place.toLowerCase() + } + env.loadCountry(browserslist.usage, place, browserslist.data) + usage = browserslist.usage[place] + } + } else if (node.config) { + usage = loadCustomUsage(context, node.config) + } + var versions = Object.keys(usage).sort(function (a, b) { + return usage[b] - usage[a] + }) + var covered = 0 + var result = [] + var version + for (var i = 0; i < versions.length; i++) { + version = versions[i] + if (usage[version] === 0) break + covered += usage[version] + result.push(version) + if (covered >= coverage) break + } + return result +} + +var QUERIES = { + last_major_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+major\s+versions?$/i, + select: function (context, node) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name, context) + if (!data) return selected + var list = getMajorVersions(data.released, node.versions) + list = list.map(nameMapper(data.name)) + list = filterJumps(list, data.name, node.versions, context) + return selected.concat(list) + }, []) + } + }, + last_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+versions?$/i, + select: function (context, node) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name, context) + if (!data) return selected + var list = data.released.slice(-node.versions) + list = list.map(nameMapper(data.name)) + list = filterJumps(list, data.name, node.versions, context) + return selected.concat(list) + }, []) + } + }, + last_electron_major_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i, + select: function (context, node) { + var validVersions = getMajorVersions(Object.keys(e2c), node.versions) + return validVersions.map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + last_node_major_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i, + select: function (context, node) { + return getMajorVersions(browserslist.nodeVersions, node.versions).map( + function (version) { + return 'node ' + version + } + ) + } + }, + last_browser_major_versions: { + matches: ['versions', 'browser'], + regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i, + select: function (context, node) { + var data = checkName(node.browser, context) + var validVersions = getMajorVersions(data.released, node.versions) + var list = validVersions.map(nameMapper(data.name)) + list = filterJumps(list, data.name, node.versions, context) + return list + } + }, + last_electron_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+electron\s+versions?$/i, + select: function (context, node) { + return Object.keys(e2c) + .slice(-node.versions) + .map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + last_node_versions: { + matches: ['versions'], + regexp: /^last\s+(\d+)\s+node\s+versions?$/i, + select: function (context, node) { + return browserslist.nodeVersions + .slice(-node.versions) + .map(function (version) { + return 'node ' + version + }) + } + }, + last_browser_versions: { + matches: ['versions', 'browser'], + regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i, + select: function (context, node) { + var data = checkName(node.browser, context) + var list = data.released.slice(-node.versions).map(nameMapper(data.name)) + list = filterJumps(list, data.name, node.versions, context) + return list + } + }, + unreleased_versions: { + matches: [], + regexp: /^unreleased\s+versions$/i, + select: function (context) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name, context) + if (!data) return selected + var list = data.versions.filter(function (v) { + return data.released.indexOf(v) === -1 + }) + list = list.map(nameMapper(data.name)) + return selected.concat(list) + }, []) + } + }, + unreleased_electron_versions: { + matches: [], + regexp: /^unreleased\s+electron\s+versions?$/i, + select: function () { + return [] + } + }, + unreleased_browser_versions: { + matches: ['browser'], + regexp: /^unreleased\s+(\w+)\s+versions?$/i, + select: function (context, node) { + var data = checkName(node.browser, context) + return data.versions + .filter(function (v) { + return data.released.indexOf(v) === -1 + }) + .map(nameMapper(data.name)) + } + }, + last_years: { + matches: ['years'], + regexp: /^last\s+((\d+\.)?\d+)\s+years?$/i, + select: function (context, node) { + return filterByYear(Date.now() - YEAR * node.years, context) + } + }, + since_y: { + matches: ['year'], + regexp: /^since (\d+)$/i, + select: sinceQuery + }, + since_y_m: { + matches: ['year', 'month'], + regexp: /^since (\d+)-(\d+)$/i, + select: sinceQuery + }, + since_y_m_d: { + matches: ['year', 'month', 'day'], + regexp: /^since (\d+)-(\d+)-(\d+)$/i, + select: sinceQuery + }, + baseline: { + matches: ['year', 'availability', 'date', 'downstream', 'kaios'], + // Matches: + // baseline 2024 + // baseline newly available + // baseline widely available + // baseline widely available on 2024-06-01 + // ...with downstream + // ...including kaios + regexp: + /^baseline\s+(?!\s)(?:(\d+)|(newly|widely)\s+(?!\s)available(?:\s+(?!\s)on\s+(?!\s)(\d{4}-\d{2}-\d{2}))?)?(\s+(?!\s)with\s+(?!\s)downstream)?(\s+(?!\s)including\s+(?!\s)kaios)?$/i, + select: function (context, node) { + var availability = node.availability && node.availability.toLowerCase() + if (availability === 'newly' && node.date) { + throw new BrowserslistError( + 'Using newly available with a date is not supported, please use "widely available on YYYY-MM-DD" and add 30 months to the date you specified.' + ) + } + + var options = { + includeDownstreamBrowsers: !!node.downstream, + includeKaiOS: !!node.kaios, + suppressWarnings: true + } + if (node.year) { + options.targetYear = node.year + } else if (node.date) { + options.widelyAvailableOnDate = node.date + } else if (availability === 'newly') { + options.widelyAvailableOnDate = new Date().setMonth( + new Date().getMonth() + 30 + ) + } + + var baselineVersions + if (options.includeKaiOS && !options.includeDownstreamBrowsers) { + // baseline-browser-mapping counts KaiOS as a downstream browser and + // refuses to return it alone, so take KaiOS from the downstream list + // and everything else from the core one + options.includeDownstreamBrowsers = true + var downstream = bbm.getCompatibleVersions(options) + options.includeDownstreamBrowsers = false + options.includeKaiOS = false + baselineVersions = bbm.getCompatibleVersions(options).concat( + downstream.filter(function (version) { + return version.browser === 'kai_os' + }) + ) + } else { + baselineVersions = bbm.getCompatibleVersions(options) + } + return resolve(bbmTransform(baselineVersions), context) + } + }, + popularity: { + matches: ['sign', 'popularity'], + regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/, + select: function (context, node) { + var popularity = parseFloat(node.popularity) + var usage = browserslist.usage.global + return Object.keys(usage).reduce(function (result, version) { + if (node.sign === '>') { + if (usage[version] > popularity) { + result.push(version) + } + } else if (node.sign === '<') { + if (usage[version] < popularity) { + result.push(version) + } + } else if (node.sign === '<=') { + if (usage[version] <= popularity) { + result.push(version) + } + } else if (usage[version] >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + popularity_in_my_stats: { + matches: ['sign', 'popularity'], + regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/, + select: function (context, node) { + var popularity = parseFloat(node.popularity) + if (!context.customUsage) { + throw new BrowserslistError('Custom usage statistics was not provided') + } + var usage = context.customUsage + return Object.keys(usage).reduce(function (result, version) { + var percentage = usage[version] + if (percentage == null) { + return result + } + + if (node.sign === '>') { + if (percentage > popularity) { + result.push(version) + } + } else if (node.sign === '<') { + if (percentage < popularity) { + result.push(version) + } + } else if (node.sign === '<=') { + if (percentage <= popularity) { + result.push(version) + } + } else if (percentage >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + popularity_in_config_stats: { + matches: ['sign', 'popularity', 'config'], + regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/, + select: function (context, node) { + var popularity = parseFloat(node.popularity) + var usage = loadCustomUsage(context, node.config) + return Object.keys(usage).reduce(function (result, version) { + var percentage = usage[version] + if (percentage == null) { + return result + } + + if (node.sign === '>') { + if (percentage > popularity) { + result.push(version) + } + } else if (node.sign === '<') { + if (percentage < popularity) { + result.push(version) + } + } else if (node.sign === '<=') { + if (percentage <= popularity) { + result.push(version) + } + } else if (percentage >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + popularity_in_place: { + matches: ['sign', 'popularity', 'place'], + regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/, + select: function (context, node) { + var popularity = parseFloat(node.popularity) + var place = node.place + if (place.length === 2) { + place = place.toUpperCase() + } else { + place = place.toLowerCase() + } + env.loadCountry(browserslist.usage, place, browserslist.data) + var usage = browserslist.usage[place] + return Object.keys(usage).reduce(function (result, version) { + var percentage = usage[version] + if (percentage == null) { + return result + } + + if (node.sign === '>') { + if (percentage > popularity) { + result.push(version) + } + } else if (node.sign === '<') { + if (percentage < popularity) { + result.push(version) + } + } else if (node.sign === '<=') { + if (percentage <= popularity) { + result.push(version) + } + } else if (percentage >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + cover: { + matches: ['coverage'], + regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i, + select: coverQuery + }, + cover_in: { + matches: ['coverage', 'place'], + regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i, + select: coverQuery + }, + cover_config: { + matches: ['coverage', 'config'], + regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i, + select: coverQuery + }, + supports: { + matches: ['supportType', 'feature'], + regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/, + select: function (context, node) { + env.loadFeature(browserslist.cache, node.feature) + var withPartial = node.supportType !== 'fully' + var features = browserslist.cache[node.feature] + var result = [] + for (var name in features) { + var data = byName(name, context) + // Only check desktop when latest released mobile has support + var iMax = data.released.length - 1 + while (iMax >= 0) { + if (data.released[iMax] in features[name]) break + iMax-- + } + var checkDesktop = + context.mobileToDesktop && + name in browserslist.desktopNames && + isSupported(features[name][data.released[iMax]], withPartial) + data.versions.forEach(function (version) { + var flags = features[name][version] + if (flags === undefined && checkDesktop) { + flags = features[browserslist.desktopNames[name]][version] + } + if (isSupported(flags, withPartial)) { + result.push(name + ' ' + version) + } + }) + } + return result + } + }, + electron_range: { + matches: ['from', 'to'], + regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, + select: function (context, node) { + var fromToUse = normalizeElectron(node.from) + var toToUse = normalizeElectron(node.to) + var from = parseFloat(node.from) + var to = parseFloat(node.to) + if (!e2c[fromToUse]) { + throw new BrowserslistError('Unknown version ' + from + ' of electron') + } + if (!e2c[toToUse]) { + throw new BrowserslistError('Unknown version ' + to + ' of electron') + } + return Object.keys(e2c) + .filter(semverFilterLoose('>=', node.from)) + .filter(semverFilterLoose('<=', node.to)) + .map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + node_range: { + matches: ['from', 'to'], + regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i, + select: function (context, node) { + return browserslist.nodeVersions + .filter(semverFilterLoose('>=', node.from)) + .filter(semverFilterLoose('<=', node.to)) + .map(function (v) { + return 'node ' + v + }) + } + }, + browser_range: { + matches: ['browser', 'from', 'to'], + regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i, + select: function (context, node) { + var data = checkName(node.browser, context) + var from = parseFloat(normalizeVersion(data, node.from) || node.from) + var to = parseFloat(normalizeVersion(data, node.to) || node.to) + function filter(v) { + var parsed = parseFloat(v) + return parsed >= from && parsed <= to + } + return data.released.filter(filter).map(nameMapper(data.name)) + } + }, + electron_ray: { + matches: ['sign', 'version'], + regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i, + select: function (context, node) { + var versionToUse = normalizeElectron(node.version) + return Object.keys(e2c) + .filter(generateFilter(node.sign, versionToUse)) + .map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + node_ray: { + matches: ['sign', 'version'], + regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i, + select: function (context, node) { + return browserslist.nodeVersions + .filter(generateSemverFilter(node.sign, node.version)) + .map(function (v) { + return 'node ' + v + }) + } + }, + browser_ray: { + matches: ['browser', 'sign', 'version'], + regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+|esr)$/i, + select: function (context, node) { + var version = node.version + var data = checkName(node.browser, context) + var alias = browserslist.versionAliases[data.name][version.toLowerCase()] + if (alias) version = alias + if (!/[\d.]+/.test(version)) { + throw new BrowserslistError( + 'Unknown version ' + version + ' of ' + node.browser + ) + } + return data.released + .filter(generateFilter(node.sign, version)) + .map(function (v) { + return data.name + ' ' + v + }) + } + }, + firefox_esr: { + matches: [], + regexp: /^(firefox|ff|fx)\s+esr$/i, + select: function () { + return ['firefox ' + FIREFOX_ESR_VERSION] + } + }, + opera_mini_all: { + matches: [], + regexp: /(operamini|op_mini)\s+all/i, + select: function () { + return ['op_mini all'] + } + }, + electron_version: { + matches: ['version'], + regexp: /^electron\s+([\d.]+)$/i, + select: function (context, node) { + var versionToUse = normalizeElectron(node.version) + var chrome = e2c[versionToUse] + if (!chrome) { + throw new BrowserslistError( + 'Unknown version ' + node.version + ' of electron' + ) + } + return ['chrome ' + chrome] + } + }, + node_major_version: { + matches: ['version'], + regexp: /^node\s+(\d+)$/i, + select: nodeQuery + }, + node_minor_version: { + matches: ['version'], + regexp: /^node\s+(\d+\.\d+)$/i, + select: nodeQuery + }, + node_patch_version: { + matches: ['version'], + regexp: /^node\s+(\d+\.\d+\.\d+)$/i, + select: nodeQuery + }, + current_node: { + matches: [], + regexp: /^current\s+node$/i, + select: function (context) { + return [env.currentNode(resolve, context)] + } + }, + maintained_node: { + matches: [], + regexp: /^maintained\s+node\s+versions$/i, + select: function (context) { + var now = Date.now() + var queries = Object.keys(jsEOL) + .filter(function (key) { + return ( + now < Date.parse(jsEOL[key].end) && + now > Date.parse(jsEOL[key].start) && + isEolReleased(key) + ) + }) + .map(function (key) { + return 'node ' + key.slice(1) + }) + return resolve(queries, context) + } + }, + phantomjs_1_9: { + matches: [], + regexp: /^phantomjs\s+1.9$/i, + select: function () { + return ['safari 5'] + } + }, + phantomjs_2_1: { + matches: [], + regexp: /^phantomjs\s+2.1$/i, + select: function () { + return ['safari 6'] + } + }, + browser_version: { + matches: ['browser', 'version'], + regexp: /^(\w+)\s+(tp|[\d.]+)$/i, + select: function (context, node) { + var version = node.version + if (/^tp$/i.test(version)) version = 'TP' + var data = checkName(node.browser, context) + var alias = normalizeVersion(data, version) + if (alias) { + version = alias + } else { + if (version.indexOf('.') === -1) { + alias = version + '.0' + } else { + alias = version.replace(/\.0$/, '') + } + alias = normalizeVersion(data, alias) + if (alias) { + version = alias + } else if (context.ignoreUnknownVersions) { + return [] + } else { + throw new BrowserslistError( + 'Unknown version ' + version + ' of ' + node.browser + ) + } + } + return [data.name + ' ' + version] + } + }, + browserslist_config: { + matches: [], + regexp: /^browserslist config$/i, + needsPath: true, + select: function (context) { + return browserslist(undefined, context) + } + }, + extends: { + matches: ['config'], + regexp: /^extends (.+)$/i, + needsPath: true, + select: function (context, node) { + return resolve(env.loadQueries(context, node.config), context) + } + }, + defaults: { + matches: [], + regexp: /^defaults$/i, + select: function (context) { + return resolve(browserslist.defaults, context) + } + }, + dead: { + matches: [], + regexp: /^dead$/i, + select: function (context) { + var dead = [ + 'Baidu >= 0', + 'ie <= 11', + 'ie_mob <= 11', + 'bb <= 10', + 'op_mob <= 12.1', + 'samsung 4' + ] + return resolve(dead, context) + } + }, + unknown: { + matches: [], + regexp: /^(\w+)$/i, + select: function (context, node) { + if (byName(node.query, context)) { + throw new BrowserslistError( + 'Specify versions in Browserslist query for browser ' + node.query + ) + } else { + throw unknownQuery(node.query) + } + } + } +} + +// Get and convert Can I Use data + +;(function () { + for (var name in agents) { + var browser = agents[name] + browserslist.data[name] = { + name: name, + versions: normalize(agents[name].versions), + released: normalize(agents[name].versions.slice(0, -3)), + releaseDate: agents[name].release_date + } + fillUsage(browserslist.usage.global, name, browser.usage_global) + + browserslist.versionAliases[name] = {} + for (var i = 0; i < browser.versions.length; i++) { + var full = browser.versions[i] + if (!full) continue + + if (full.indexOf('-') !== -1) { + var interval = full.split('-') + for (var j = 0; j < interval.length; j++) { + browserslist.versionAliases[name][interval[j]] = full + } + } + } + } + + browserslist.nodeVersions = jsReleases.map(function (release) { + return release.version + }) +})() + +browserslist.versionAliases.firefox.esr = FIREFOX_ESR_VERSION + +module.exports = browserslist diff --git a/node_modules/browserslist/node.js b/node_modules/browserslist/node.js new file mode 100644 index 0000000000000000000000000000000000000000..57464e29a32326b02ded833f0b67b57409c1b877 --- /dev/null +++ b/node_modules/browserslist/node.js @@ -0,0 +1,504 @@ +var feature = require('caniuse-lite/dist/unpacker/feature').default +var region = require('caniuse-lite/dist/unpacker/region').default +var fs = require('fs') +var path = require('path') + +var BrowserslistError = require('./error') + +var IS_SECTION = /^\s*\[(.+)]\s*$/ +var CONFIG_PATTERN = /^browserslist-config-/ +var SCOPED_CONFIG__PATTERN = + /^@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/ +var FORMAT = + 'Browserslist config should be a string or an array ' + + 'of strings with browser queries' +var PATHTYPE_UNKNOWN = 'unknown' +var PATHTYPE_DIR = 'directory' +var PATHTYPE_FILE = 'file' + +var dataTimeChecked = false +var statCache = {} +var configPathCache = {} +var parseConfigCache = {} + +function checkExtend(name) { + var use = ' Use `dangerousExtend` option to disable.' + if (!CONFIG_PATTERN.test(name) && !SCOPED_CONFIG__PATTERN.test(name)) { + throw new BrowserslistError( + 'Browserslist config needs `browserslist-config-` prefix. ' + use + ) + } + if (name.replace(/^@[^/]+\//, '').indexOf('.') !== -1) { + throw new BrowserslistError( + '`.` not allowed in Browserslist config name. ' + use + ) + } + if (name.indexOf('node_modules') !== -1) { + throw new BrowserslistError( + '`node_modules` not allowed in Browserslist config.' + use + ) + } +} + +function getPathType(filepath) { + var stats + try { + stats = fs.existsSync(filepath) && fs.statSync(filepath) + } catch (err) { + /* c8 ignore start */ + if ( + err.code !== 'ENOENT' && + err.code !== 'EACCES' && + err.code !== 'ERR_ACCESS_DENIED' + ) { + throw err + } + /* c8 ignore end */ + } + + if (stats && stats.isDirectory()) return PATHTYPE_DIR + if (stats && stats.isFile()) return PATHTYPE_FILE + + return PATHTYPE_UNKNOWN +} + +function isFile(file) { + return getPathType(file) === PATHTYPE_FILE +} + +function isDirectory(dir) { + return getPathType(dir) === PATHTYPE_DIR +} + +function eachParent(file, callback, cache) { + var loc = path.resolve(file) + var pathsForCacheResult = [] + var result + do { + if (!pathInRoot(loc)) { + break + } + if (cache && loc in cache) { + result = cache[loc] + break + } + pathsForCacheResult.push(loc) + + if (!isDirectory(loc)) { + continue + } + + var locResult = callback(loc) + if (typeof locResult !== 'undefined') { + result = locResult + break + } + } while (loc !== (loc = path.dirname(loc))) + + if (cache && !process.env.BROWSERSLIST_DISABLE_CACHE) { + pathsForCacheResult.forEach(function (cachePath) { + cache[cachePath] = result + }) + } + return result +} + +function pathInRoot(p) { + if (!process.env.BROWSERSLIST_ROOT_PATH) return true + var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH) + if (path.relative(rootPath, p).substring(0, 2) === '..') { + return false + } + return true +} + +function check(section) { + if (Array.isArray(section)) { + for (var i = 0; i < section.length; i++) { + if (typeof section[i] !== 'string') { + throw new BrowserslistError(FORMAT) + } + } + } else if (typeof section !== 'string') { + throw new BrowserslistError(FORMAT) + } +} + +function pickEnv(config, opts) { + if (typeof config !== 'object') return config + + var name + if (typeof opts.env === 'string') { + name = opts.env + } else if (process.env.BROWSERSLIST_ENV) { + name = process.env.BROWSERSLIST_ENV + } else if (process.env.NODE_ENV) { + name = process.env.NODE_ENV + } else { + name = 'production' + } + + if (opts.throwOnMissing) { + if (name && name !== 'defaults' && !config[name]) { + throw new BrowserslistError( + 'Missing config for Browserslist environment `' + name + '`' + ) + } + } + + return config[name] || config.defaults +} + +function parsePackage(file) { + var text = fs + .readFileSync(file) + .toString() + .replace(/^\uFEFF/m, '') + var list + if (text.indexOf('"browserslist"') >= 0) { + list = JSON.parse(text).browserslist + } else if (text.indexOf('"browserlist"') >= 0) { + var config = JSON.parse(text) + if (config.browserlist && !config.browserslist) { + throw new BrowserslistError( + '`browserlist` key instead of `browserslist` in ' + file + ) + } + } + if (Array.isArray(list) || typeof list === 'string') { + list = { defaults: list } + } + for (var i in list) { + check(list[i]) + } + + return list +} + +function parsePackageOrReadConfig(file) { + if (file in parseConfigCache) { + return parseConfigCache[file] + } + + var isPackage = path.basename(file) === 'package.json' + var result = isPackage ? parsePackage(file) : module.exports.readConfig(file) + + if (!process.env.BROWSERSLIST_DISABLE_CACHE) { + parseConfigCache[file] = result + } + return result +} + +function latestReleaseTime(agents) { + var latest = 0 + for (var name in agents) { + var dates = agents[name].releaseDate || {} + for (var key in dates) { + if (latest < dates[key]) { + latest = dates[key] + } + } + } + return latest * 1000 +} + +function getMonthsPassed(date) { + var now = new Date() + var past = new Date(date) + + var years = now.getFullYear() - past.getFullYear() + var months = now.getMonth() - past.getMonth() + + return years * 12 + months +} + +function normalizeStats(data, stats) { + if (!data) { + data = {} + } + if (stats && 'dataByBrowser' in stats) { + stats = stats.dataByBrowser + } + + if (typeof stats !== 'object') return undefined + + var normalized = Object.create(null) + for (var i in stats) { + var versions = Object.keys(stats[i]) + var known = Object.prototype.hasOwnProperty.call(data, i) && data[i] + if (versions.length === 1 && known && known.versions.length === 1) { + var normal = known.versions[0] + normalized[i] = Object.create(null) + normalized[i][normal] = stats[i][versions[0]] + } else { + normalized[i] = stats[i] + } + } + + return normalized +} + +function normalizeUsageData(usageData, data) { + for (var browser in usageData) { + var browserUsage = usageData[browser] + // https://github.com/browserslist/browserslist/issues/431#issuecomment-565230615 + // caniuse-db returns { 0: "percentage" } for `and_*` regional stats + if ('0' in browserUsage) { + var versions = data[browser].versions + browserUsage[versions[versions.length - 1]] = browserUsage[0] + delete browserUsage[0] + } + } +} + +module.exports = { + loadQueries: function loadQueries(ctx, name) { + if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) { + checkExtend(name) + } + var queries = require(require.resolve(name, { paths: ['.', ctx.path] })) + if (typeof queries === 'object' && queries !== null && queries.__esModule) { + queries = queries.default + } + if (queries) { + if (Array.isArray(queries)) { + return queries + } else if (typeof queries === 'object') { + if (!queries.defaults) queries.defaults = [] + return pickEnv(queries, ctx, name) + } + } + throw new BrowserslistError( + '`' + + name + + '` config exports not an array of queries' + + ' or an object of envs' + ) + }, + + loadStat: function loadStat(ctx, name, data) { + if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) { + checkExtend(name) + } + var stats = require( + // Use forward slashes for module paths, also on Windows. + require.resolve(path.posix.join(name, 'browserslist-stats.json'), { + paths: ['.'] + }) + ) + return normalizeStats(data, stats) + }, + + getStat: function getStat(opts, data) { + var stats + if (opts.stats) { + stats = opts.stats + } else if (process.env.BROWSERSLIST_STATS) { + stats = process.env.BROWSERSLIST_STATS + } else if (opts.path && path.resolve && fs.existsSync) { + stats = eachParent( + opts.path, + function (dir) { + var file = path.join(dir, 'browserslist-stats.json') + return isFile(file) ? file : undefined + }, + statCache + ) + } + if (typeof stats === 'string') { + try { + stats = JSON.parse(fs.readFileSync(stats)) + } catch (e) { + throw new BrowserslistError("Can't read " + stats) + } + } + return normalizeStats(data, stats) + }, + + loadConfig: function loadConfig(opts) { + if (process.env.BROWSERSLIST) { + return process.env.BROWSERSLIST + } else if (opts.config || process.env.BROWSERSLIST_CONFIG) { + var file = opts.config || process.env.BROWSERSLIST_CONFIG + return pickEnv(parsePackageOrReadConfig(file), opts) + } else if (opts.path) { + return pickEnv(module.exports.findConfig(opts.path), opts) + } else { + return undefined + } + }, + + loadCountry: function loadCountry(usage, country, data) { + var code = country.replace(/[^\w-]/g, '') + if (!usage[code]) { + var compressed + try { + compressed = require('caniuse-lite/data/regions/' + code + '.js') + } catch (e) { + throw new BrowserslistError('Unknown region name `' + code + '`.') + } + var usageData = region(compressed) + normalizeUsageData(usageData, data) + usage[country] = Object.create(null) + for (var i in usageData) { + for (var j in usageData[i]) { + usage[country][i + ' ' + j] = usageData[i][j] + } + } + } + }, + + loadFeature: function loadFeature(features, name) { + name = name.replace(/[^\w-]/g, '') + if (features[name]) return + var compressed + try { + compressed = require('caniuse-lite/data/features/' + name + '.js') + } catch (e) { + throw new BrowserslistError('Unknown feature name `' + name + '`.') + } + var stats = feature(compressed).stats + features[name] = {} + for (var i in stats) { + features[name][i] = {} + for (var j in stats[i]) { + features[name][i][j] = stats[i][j] + } + } + }, + + parseConfig: function parseConfig(string) { + var result = { defaults: [] } + var sections = ['defaults'] + + string + .toString() + .replace(/#[^\n]*/g, '') + .split(/\n|,/) + .map(function (line) { + return line.trim() + }) + .filter(function (line) { + return line !== '' + }) + .forEach(function (line) { + if (IS_SECTION.test(line)) { + sections = line.match(IS_SECTION)[1].trim().split(' ') + sections.forEach(function (section) { + if (result[section]) { + throw new BrowserslistError( + 'Duplicate section ' + section + ' in Browserslist config' + ) + } + result[section] = [] + }) + } else { + sections.forEach(function (section) { + result[section].push(line) + }) + } + }) + + return result + }, + + readConfig: function readConfig(file) { + if (!isFile(file)) { + throw new BrowserslistError("Can't read " + file + ' config') + } + + return module.exports.parseConfig(fs.readFileSync(file)) + }, + + findConfigFile: function findConfigFile(from) { + return eachParent( + from, + function (dir) { + var config = path.join(dir, 'browserslist') + var pkg = path.join(dir, 'package.json') + var rc = path.join(dir, '.browserslistrc') + + var pkgBrowserslist + if (isFile(pkg)) { + try { + pkgBrowserslist = parsePackage(pkg) + } catch (e) { + if (e.name === 'BrowserslistError') throw e + console.warn( + '[Browserslist] Could not parse ' + pkg + '. Ignoring it.' + ) + } + } + + if (isFile(config) && pkgBrowserslist) { + throw new BrowserslistError( + dir + ' contains both browserslist and package.json with browsers' + ) + } else if (isFile(rc) && pkgBrowserslist) { + throw new BrowserslistError( + dir + + ' contains both .browserslistrc and package.json with browsers' + ) + } else if (isFile(config) && isFile(rc)) { + throw new BrowserslistError( + dir + ' contains both .browserslistrc and browserslist' + ) + } else if (isFile(config)) { + return config + } else if (isFile(rc)) { + return rc + } else if (pkgBrowserslist) { + return pkg + } + }, + configPathCache + ) + }, + + findConfig: function findConfig(from) { + var configFile = this.findConfigFile(from) + + return configFile ? parsePackageOrReadConfig(configFile) : undefined + }, + + clearCaches: function clearCaches() { + dataTimeChecked = false + statCache = {} + configPathCache = {} + parseConfigCache = {} + + this.cache = {} + }, + + oldDataWarning: function oldDataWarning(agentsObj) { + if (dataTimeChecked) return + dataTimeChecked = true + if (process.env.BROWSERSLIST_IGNORE_OLD_DATA) return + + var latest = latestReleaseTime(agentsObj) + var monthsPassed = getMonthsPassed(latest) + + if (latest !== 0 && monthsPassed >= 6) { + if (process.env.BROWSERSLIST_TRACE_WARNING) { + console.info('Last browser release in DB: ' + String(new Date(latest))) + console.trace() + } + + var months = monthsPassed + ' ' + (monthsPassed > 1 ? 'months' : 'month') + console.warn( + 'Browserslist: browsers data (caniuse-lite) is ' + + months + + ' old. Please run:\n' + + ' npx update-browserslist-db@latest\n' + + ' Why you should do it regularly: ' + + 'https://github.com/browserslist/update-db#readme' + ) + } + }, + + currentNode: function currentNode() { + return 'node ' + process.versions.node + }, + + env: process.env +} diff --git a/node_modules/browserslist/node_modules/.bin/baseline-browser-mapping b/node_modules/browserslist/node_modules/.bin/baseline-browser-mapping new file mode 100644 index 0000000000000000000000000000000000000000..b52b3b0930145d6628f6c8fa770cdac7a5857684 --- /dev/null +++ b/node_modules/browserslist/node_modules/.bin/baseline-browser-mapping @@ -0,0 +1,2 @@ +#!/usr/bin/env node +"use strict";const{getCompatibleVersions:e}=require("./index.cjs"),a=process.argv.slice(2),s={};for(let e=0;e i === arg) +} + +function error(msg) { + process.stderr.write('update-browserslist-db: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write(getPackage().name + ' ' + getPackage().version + '\n') +} else { + try { + updateDb() + } catch (e) { + if (e.name === 'BrowserslistUpdateError') { + error(e.message) + } else { + throw e + } + } +} diff --git a/node_modules/browserslist/package.json b/node_modules/browserslist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4114dbd950c3df20a719364c71e442c92daa9079 --- /dev/null +++ b/node_modules/browserslist/package.json @@ -0,0 +1,45 @@ +{ + "name": "browserslist", + "version": "4.28.9", + "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset", + "keywords": [ + "browsers", + "caniuse", + "target" + ], + "license": "MIT", + "author": "Andrey Sitnik ", + "repository": "browserslist/browserslist", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "browserslist": "cli.js" + }, + "browser": { + "./node.js": "./browser.js", + "path": false + }, + "types": "./index.d.ts", + "dependencies": { + "baseline-browser-mapping": "^2.11.20", + "caniuse-lite": "^1.0.30001810", + "electron-to-chromium": "^1.5.420", + "node-releases": "^2.0.54", + "update-browserslist-db": "^1.3.2" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } +} diff --git a/node_modules/browserslist/parse.js b/node_modules/browserslist/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..5bd74725e8157445cb6fff0a715e22f9fed261f4 --- /dev/null +++ b/node_modules/browserslist/parse.js @@ -0,0 +1,136 @@ +var SPACE = /\s/ + +function flatten(array) { + if (!Array.isArray(array)) return [array] + // Iterative flatten: `reduce`+`concat` copies the accumulator on every step, + // which is O(n²) once a query resolves to many nodes. + var result = [] + var stack = [array] + while (stack.length) { + var item = stack.pop() + if (Array.isArray(item)) { + for (var i = item.length - 1; i >= 0; i--) { + stack.push(item[i]) + } + } else { + result.push(item) + } + } + return result +} + +function matchQuery(all, query) { + var node = { query: query } + if (query.indexOf('not ') === 0) { + node.not = true + query = query.slice(4) + } + + for (var name in all) { + var type = all[name] + var match = query.match(type.regexp) + if (match) { + node.type = name + for (var i = 0; i < type.matches.length; i++) { + node[type.matches[i]] = match[i + 1] + } + return node + } + } + + node.type = 'unknown' + return node +} + +function pushClause(all, qs, text, compose) { + var node = matchQuery(all, text.trim()) + node.compose = compose + qs.push(node) +} + +// Splits a query block into clauses on the `\s+and\s+`, `\s+or\s+` and `,\s*` +// delimiters in a single left-to-right pass. The previous implementation grew +// a suffix one character at a time and re-tested anchored `\s+…` regexps at +// every length, which backtracks across whitespace runs and is O(n²) — a +// small padded query could freeze the event loop for tens of seconds. +function parseBlock(all, block, qs) { + if (block.length === 0) return + + var len = block.length + var clauseStart = 0 + // Compose for the clause currently being read; the leftmost clause is `or`. + var compose = 'or' + var i = 0 + + while (i < len) { + var ch = block[i] + + if (ch === ',') { + // `,\s*` delimiter. A delimiter at the very start (i === 0) has no left + // clause — the original never emits one there. + if (i !== 0) pushClause(all, qs, block.slice(clauseStart, i), compose) + i++ + while (i < len && SPACE.test(block[i])) i++ + compose = 'or' + clauseStart = i + continue + } + + if (SPACE.test(ch)) { + // Possible `\s+and\s+` or `\s+or\s+`. Scan the whitespace run once + // (linear, no backtracking), then check the following keyword. + var q = i + while (q < len && SPACE.test(block[q])) q++ + + if ( + q + 3 < len && + (block[q] === 'a' || block[q] === 'A') && + (block[q + 1] === 'n' || block[q + 1] === 'N') && + (block[q + 2] === 'd' || block[q + 2] === 'D') && + SPACE.test(block[q + 3]) + ) { + // The leading `\s+` of `\s+and\s+` absorbs whitespace at the block + // start, so a delimiter at i === 0 has no left clause. + if (i !== 0) pushClause(all, qs, block.slice(clauseStart, i), compose) + var afterAnd = q + 3 + while (afterAnd < len && SPACE.test(block[afterAnd])) afterAnd++ + compose = 'and' + i = afterAnd + clauseStart = afterAnd + continue + } else if ( + q + 2 < len && + (block[q] === 'o' || block[q] === 'O') && + (block[q + 1] === 'r' || block[q + 1] === 'R') && + SPACE.test(block[q + 2]) + ) { + if (i !== 0) pushClause(all, qs, block.slice(clauseStart, i), compose) + var afterOr = q + 2 + while (afterOr < len && SPACE.test(block[afterOr])) afterOr++ + compose = 'or' + i = afterOr + clauseStart = afterOr + continue + } else { + // Whitespace inside a clause; skip the run and keep reading. + i = q + continue + } + } + + i++ + } + + pushClause(all, qs, block.slice(clauseStart), compose) +} + +module.exports = function parse(all, queries) { + if (!Array.isArray(queries)) queries = [queries] + return flatten( + queries.map(function (block) { + var qs = [] + parseBlock(all, block, qs) + return qs + }) + ) +} diff --git a/node_modules/buffer-from/LICENSE b/node_modules/buffer-from/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e4bf1d69b1bb0df5acf1278e583264acdc1eefc5 --- /dev/null +++ b/node_modules/buffer-from/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016, 2018 Linus Unnebäck + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/buffer-from/index.js b/node_modules/buffer-from/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e1a58b5e8a06fd24ce5321aa6b08255dc9d0716d --- /dev/null +++ b/node_modules/buffer-from/index.js @@ -0,0 +1,72 @@ +/* eslint-disable node/no-deprecated-api */ + +var toString = Object.prototype.toString + +var isModern = ( + typeof Buffer !== 'undefined' && + typeof Buffer.alloc === 'function' && + typeof Buffer.allocUnsafe === 'function' && + typeof Buffer.from === 'function' +) + +function isArrayBuffer (input) { + return toString.call(input).slice(8, -1) === 'ArrayBuffer' +} + +function fromArrayBuffer (obj, byteOffset, length) { + byteOffset >>>= 0 + + var maxLength = obj.byteLength - byteOffset + + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds") + } + + if (length === undefined) { + length = maxLength + } else { + length >>>= 0 + + if (length > maxLength) { + throw new RangeError("'length' is out of bounds") + } + } + + return isModern + ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) + : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + return isModern + ? Buffer.from(string, encoding) + : new Buffer(string, encoding) +} + +function bufferFrom (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + return isModern + ? Buffer.from(value) + : new Buffer(value) +} + +module.exports = bufferFrom diff --git a/node_modules/buffer-from/package.json b/node_modules/buffer-from/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6ac5327bf8621ef03a3df8039518a98ba3d1648a --- /dev/null +++ b/node_modules/buffer-from/package.json @@ -0,0 +1,19 @@ +{ + "name": "buffer-from", + "version": "1.1.2", + "license": "MIT", + "repository": "LinusU/buffer-from", + "files": [ + "index.js" + ], + "scripts": { + "test": "standard && node test" + }, + "devDependencies": { + "standard": "^12.0.1" + }, + "keywords": [ + "buffer", + "buffer from" + ] +} diff --git a/node_modules/buffer-from/readme.md b/node_modules/buffer-from/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..9880a558a7c91fefb0e6908318fbd991b6b93dcf --- /dev/null +++ b/node_modules/buffer-from/readme.md @@ -0,0 +1,69 @@ +# Buffer From + +A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. + +## Installation + +```sh +npm install --save buffer-from +``` + +## Usage + +```js +const bufferFrom = require('buffer-from') + +console.log(bufferFrom([1, 2, 3, 4])) +//=> + +const arr = new Uint8Array([1, 2, 3, 4]) +console.log(bufferFrom(arr.buffer, 1, 2)) +//=> + +console.log(bufferFrom('test', 'utf8')) +//=> + +const buf = bufferFrom('test') +console.log(bufferFrom(buf)) +//=> +``` + +## API + +### bufferFrom(array) + +- `array` <Array> + +Allocates a new `Buffer` using an `array` of octets. + +### bufferFrom(arrayBuffer[, byteOffset[, length]]) + +- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer +- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` +- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a TypedArray instance, the +newly created `Buffer` will share the same allocated memory as the TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +### bufferFrom(buffer) + +- `buffer` <Buffer> An existing `Buffer` to copy data from + +Copies the passed `buffer` data onto a new `Buffer` instance. + +### bufferFrom(string[, encoding]) + +- `string` <String> A string to encode. +- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `string`. If +provided, the `encoding` parameter identifies the character encoding of +`string`. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/node_modules/cac/LICENSE b/node_modules/cac/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0fa9bb51149d336039c8c335c05f3ab4b1aa2609 --- /dev/null +++ b/node_modules/cac/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) EGOIST <0x142857@gmail.com> (https://github.com/egoist) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/cac/README.md b/node_modules/cac/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3fd3d16614daca9068be7ab84c7a81d345425db4 --- /dev/null +++ b/node_modules/cac/README.md @@ -0,0 +1,536 @@ +2017-07-26 9 27 05 + +[![NPM version](https://img.shields.io/npm/v/cac.svg?style=flat)](https://npmjs.com/package/cac) [![NPM downloads](https://img.shields.io/npm/dm/cac.svg?style=flat)](https://npmjs.com/package/cac) [![CircleCI](https://circleci.com/gh/cacjs/cac/tree/master.svg?style=shield)](https://circleci.com/gh/cacjs/cac/tree/master) [![Codecov](https://badgen.net/codecov/c/github/cacjs/cac/master)](https://codecov.io/gh/cacjs/cac) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe) [![install size](https://badgen.net/packagephobia/install/cac)](https://packagephobia.now.sh/result?p=cac) + +## Introduction + +**C**ommand **A**nd **C**onquer is a JavaScript library for building CLI apps. + +## Features + +- **Super light-weight**: No dependency, just a single file. +- **Easy to learn**. There're only 4 APIs you need to learn for building simple CLIs: `cli.option` `cli.version` `cli.help` `cli.parse`. +- **Yet so powerful**. Enable features like default command, git-like subcommands, validation for required arguments and options, variadic arguments, dot-nested options, automated help message generation and so on. +- **Developer friendly**. Written in TypeScript. + +## Table of Contents + + + +- [Install](#install) +- [Usage](#usage) + - [Simple Parsing](#simple-parsing) + - [Display Help Message and Version](#display-help-message-and-version) + - [Command-specific Options](#command-specific-options) + - [Dash in option names](#dash-in-option-names) + - [Brackets](#brackets) + - [Negated Options](#negated-options) + - [Variadic Arguments](#variadic-arguments) + - [Dot-nested Options](#dot-nested-options) + - [Default Command](#default-command) + - [Supply an array as option value](#supply-an-array-as-option-value) + - [Error Handling](#error-handling) + - [With TypeScript](#with-typescript) + - [With Deno](#with-deno) +- [Projects Using CAC](#projects-using-cac) +- [References](#references) + - [CLI Instance](#cli-instance) + - [cac(name?)](#cacname) + - [cli.command(name, description, config?)](#clicommandname-description-config) + - [cli.option(name, description, config?)](#clioptionname-description-config) + - [cli.parse(argv?)](#cliparseargv) + - [cli.version(version, customFlags?)](#cliversionversion-customflags) + - [cli.help(callback?)](#clihelpcallback) + - [cli.outputHelp()](#clioutputhelp) + - [cli.usage(text)](#cliusagetext) + - [Command Instance](#command-instance) + - [command.option()](#commandoption) + - [command.action(callback)](#commandactioncallback) + - [command.alias(name)](#commandaliasname) + - [command.allowUnknownOptions()](#commandallowunknownoptions) + - [command.example(example)](#commandexampleexample) + - [command.usage(text)](#commandusagetext) + - [Events](#events) +- [FAQ](#faq) + - [How is the name written and pronounced?](#how-is-the-name-written-and-pronounced) + - [Why not use Commander.js?](#why-not-use-commanderjs) +- [Project Stats](#project-stats) +- [Contributing](#contributing) +- [Author](#author) + + + +## Install + +```bash +yarn add cac +``` + +## Usage + +### Simple Parsing + +Use CAC as simple argument parser: + +```js +// examples/basic-usage.js +const cli = require('cac')() + +cli.option('--type ', 'Choose a project type', { + default: 'node', +}) + +const parsed = cli.parse() + +console.log(JSON.stringify(parsed, null, 2)) +``` + +2018-11-26 12 28 03 + +### Display Help Message and Version + +```js +// examples/help.js +const cli = require('cac')() + +cli.option('--type [type]', 'Choose a project type', { + default: 'node', +}) +cli.option('--name ', 'Provide your name') + +cli.command('lint [...files]', 'Lint files').action((files, options) => { + console.log(files, options) +}) + +// Display help message when `-h` or `--help` appears +cli.help() +// Display version number when `-v` or `--version` appears +// It's also used in help message +cli.version('0.0.0') + +cli.parse() +``` + +2018-11-25 8 21 14 + +### Command-specific Options + +You can attach options to a command. + +```js +const cli = require('cac')() + +cli + .command('rm ', 'Remove a dir') + .option('-r, --recursive', 'Remove recursively') + .action((dir, options) => { + console.log('remove ' + dir + (options.recursive ? ' recursively' : '')) + }) + +cli.help() + +cli.parse() +``` + +A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. If you really want to use unknown options, use [`command.allowUnknownOptions`](#commandallowunknownoptions). + +command options + +### Dash in option names + +Options in kebab-case should be referenced in camelCase in your code: + +```js +cli + .command('dev', 'Start dev server') + .option('--clear-screen', 'Clear screen') + .action((options) => { + console.log(options.clearScreen) + }) +``` + +In fact `--clear-screen` and `--clearScreen` are both mapped to `options.clearScreen`. + +### Brackets + +When using brackets in command name, angled brackets indicate required command arguments, while square bracket indicate optional arguments. + +When using brackets in option name, angled brackets indicate that a string / number value is required, while square bracket indicate that the value can also be `true`. + +```js +const cli = require('cac')() + +cli + .command('deploy ', 'Deploy a folder to AWS') + .option('--scale [level]', 'Scaling level') + .action((folder, options) => { + // ... + }) + +cli + .command('build [project]', 'Build a project') + .option('--out ', 'Output directory') + .action((folder, options) => { + // ... + }) + +cli.parse() +``` + +### Negated Options + +To allow an option whose value is `false`, you need to manually specify a negated option: + +```js +cli + .command('build [project]', 'Build a project') + .option('--no-config', 'Disable config file') + .option('--config ', 'Use a custom config file') +``` + +This will let CAC set the default value of `config` to true, and you can use `--no-config` flag to set it to `false`. + +### Variadic Arguments + +The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to add `...` to the start of argument name, just like the rest operator in JavaScript. Here is an example: + +```js +const cli = require('cac')() + +cli + .command('build [...otherFiles]', 'Build your app') + .option('--foo', 'Foo option') + .action((entry, otherFiles, options) => { + console.log(entry) + console.log(otherFiles) + console.log(options) + }) + +cli.help() + +cli.parse() +``` + +2018-11-25 8 25 30 + +### Dot-nested Options + +Dot-nested options will be merged into a single option. + +```js +const cli = require('cac')() + +cli + .command('build', 'desc') + .option('--env ', 'Set envs') + .example('--env.API_SECRET xxx') + .action((options) => { + console.log(options) + }) + +cli.help() + +cli.parse() +``` + +2018-11-25 9 37 53 + +### Default Command + +Register a command that will be used when no other command is matched. + +```js +const cli = require('cac')() + +cli + // Simply omit the command name, just brackets + .command('[...files]', 'Build files') + .option('--minimize', 'Minimize output') + .action((files, options) => { + console.log(files) + console.log(options.minimize) + }) + +cli.parse() +``` + +### Supply an array as option value + +```bash +node cli.js --include project-a +# The parsed options will be: +# { include: 'project-a' } + +node cli.js --include project-a --include project-b +# The parsed options will be: +# { include: ['project-a', 'project-b'] } +``` + +### Error Handling + +To handle command errors globally: + +```js +try { + // Parse CLI args without running the command + cli.parse(process.argv, { run: false }) + // Run the command yourself + // You only need `await` when your command action returns a Promise + await cli.runMatchedCommand() +} catch (error) { + // Handle error here.. + // e.g. + // console.error(error.stack) + // process.exit(1) +} +``` + +### With TypeScript + +First you need `@types/node` to be installed as a dev dependency in your project: + +```bash +yarn add @types/node --dev +``` + +Then everything just works out of the box: + +```js +const { cac } = require('cac') +// OR ES modules +import { cac } from 'cac' +``` + +### With Deno + +```ts +import { cac } from 'https://unpkg.com/cac/mod.ts' + +const cli = cac('my-program') +``` + +## Projects Using CAC + +Projects that use **CAC**: + +- [VuePress](https://github.com/vuejs/vuepress): :memo: Minimalistic Vue-powered static site generator. +- [SAO](https://github.com/egoist/sao): ⚔️ Futuristic scaffolding tool. +- [DocPad](https://github.com/docpad/docpad): 🏹 Powerful Static Site Generator. +- [Poi](https://github.com/egoist/poi): ⚡️ Delightful web development. +- [bili](https://github.com/egoist/bili): 🥂 Schweizer Armeemesser for bundling JavaScript libraries. +- [Lad](https://github.com/ladjs/lad): 👦 Lad scaffolds a Koa webapp and API framework for Node.js. +- [Lass](https://github.com/lassjs/lass): 💁🏻 Scaffold a modern package boilerplate for Node.js. +- [Foy](https://github.com/zaaack/foy): 🏗 A lightweight and modern task runner and build tool for general purpose. +- [Vuese](https://github.com/vuese/vuese): 🤗 One-stop solution for vue component documentation. +- [NUT](https://github.com/nut-project/nut): 🌰 A framework born for microfrontends +- Feel free to add yours here... + +## References + +**💁 Check out [the generated docs](https://cac-api-doc.egoist.sh/classes/_cac_.cac.html) from source code if you want a more in-depth API references.** + +Below is a brief overview. + +### CLI Instance + +CLI instance is created by invoking the `cac` function: + +```js +const cac = require('cac') +const cli = cac() +``` + +#### cac(name?) + +Create a CLI instance, optionally specify the program name which will be used to display in help and version message. When not set we use the basename of `argv[1]`. + +#### cli.command(name, description, config?) + +- Type: `(name: string, description: string) => Command` + +Create a command instance. + +The option also accepts a third argument `config` for additional command config: + +- `config.allowUnknownOptions`: `boolean` Allow unknown options in this command. +- `config.ignoreOptionDefaultValue`: `boolean` Don't use the options's default value in parsed options, only display them in help message. + +#### cli.option(name, description, config?) + +- Type: `(name: string, description: string, config?: OptionConfig) => CLI` + +Add a global option. + +The option also accepts a third argument `config` for additional option config: + +- `config.default`: Default value for the option. +- `config.type`: `any[]` When set to `[]`, the option value returns an array type. You can also use a conversion function such as `[String]`, which will invoke the option value with `String`. + +#### cli.parse(argv?) + +- Type: `(argv = process.argv) => ParsedArgv` + +```ts +interface ParsedArgv { + args: string[] + options: { + [k: string]: any + } +} +``` + +When this method is called, `cli.rawArgs` `cli.args` `cli.options` `cli.matchedCommand` will also be available. + +#### cli.version(version, customFlags?) + +- Type: `(version: string, customFlags = '-v, --version') => CLI` + +Output version number when `-v, --version` flag appears. + +#### cli.help(callback?) + +- Type: `(callback?: HelpCallback) => CLI` + +Output help message when `-h, --help` flag appears. + +Optional `callback` allows post-processing of help text before it is displayed: + +```ts +type HelpCallback = (sections: HelpSection[]) => void + +interface HelpSection { + title?: string + body: string +} +``` + +#### cli.outputHelp() + +- Type: `() => CLI` + +Output help message. + +#### cli.usage(text) + +- Type: `(text: string) => CLI` + +Add a global usage text. This is not used by sub-commands. + +### Command Instance + +Command instance is created by invoking the `cli.command` method: + +```js +const command = cli.command('build [...files]', 'Build given files') +``` + +#### command.option() + +Basically the same as `cli.option` but this adds the option to specific command. + +#### command.action(callback) + +- Type: `(callback: ActionCallback) => Command` + +Use a callback function as the command action when the command matches user inputs. + +```ts +type ActionCallback = ( + // Parsed CLI args + // The last arg will be an array if it's a variadic argument + ...args: string | string[] | number | number[] + // Parsed CLI options + options: Options +) => any + +interface Options { + [k: string]: any +} +``` + +#### command.alias(name) + +- Type: `(name: string) => Command` + +Add an alias name to this command, the `name` here can't contain brackets. + +#### command.allowUnknownOptions() + +- Type: `() => Command` + +Allow unknown options in this command, by default CAC will log an error when unknown options are used. + +#### command.example(example) + +- Type: `(example: CommandExample) => Command` + +Add an example which will be displayed at the end of help message. + +```ts +type CommandExample = ((name: string) => string) | string +``` + +#### command.usage(text) + +- Type: `(text: string) => Command` + +Add a usage text for this command. + +### Events + +Listen to commands: + +```js +// Listen to the `foo` command +cli.on('command:foo', () => { + // Do something +}) + +// Listen to the default command +cli.on('command:!', () => { + // Do something +}) + +// Listen to unknown commands +cli.on('command:*', () => { + console.error('Invalid command: %s', cli.args.join(' ')) + process.exit(1) +}) +``` + +## FAQ + +### How is the name written and pronounced? + +CAC, or cac, pronounced `C-A-C`. + +This project is dedicated to our lovely C.C. sama. Maybe CAC stands for C&C as well :P + + + +### Why not use Commander.js? + +CAC is very similar to Commander.js, while the latter does not support dot nested options, i.e. something like `--env.API_SECRET foo`. Besides, you can't use unknown options in Commander.js either. + +_And maybe more..._ + +Basically I made CAC to fulfill my own needs for building CLI apps like [Poi](https://poi.js.org), [SAO](https://sao.vercel.app) and all my CLI apps. It's small, simple but powerful :P + +## Project Stats + +![Alt](https://repobeats.axiom.co/api/embed/58caf6203631bcdb9bbe22f0728a0af1683dc0bb.svg 'Repobeats analytics image') + +## Contributing + +1. Fork it! +2. Create your feature branch: `git checkout -b my-new-feature` +3. Commit your changes: `git commit -am 'Add some feature'` +4. Push to the branch: `git push origin my-new-feature` +5. Submit a pull request :D + +## Author + +**CAC** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
+Authored and maintained by egoist with help from contributors ([list](https://github.com/cacjs/cac/contributors)). + +> [Website](https://egoist.sh) · GitHub [@egoist](https://github.com/egoist) · Twitter [@\_egoistlily](https://twitter.com/_egoistlily) diff --git a/node_modules/cac/deno/CAC.ts b/node_modules/cac/deno/CAC.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ced3b1f69b8c7422b6b1acb4eff1144a9e68a42 --- /dev/null +++ b/node_modules/cac/deno/CAC.ts @@ -0,0 +1,331 @@ +import { EventEmitter } from "https://deno.land/std@0.114.0/node/events.ts"; +import mri from "https://cdn.skypack.dev/mri"; +import Command, { GlobalCommand, CommandConfig, HelpCallback, CommandExample } from "./Command.ts"; +import { OptionConfig } from "./Option.ts"; +import { getMriOptions, setDotProp, setByType, getFileName, camelcaseOptionName } from "./utils.ts"; +import { processArgs } from "./deno.ts"; +interface ParsedArgv { + args: ReadonlyArray; + options: { + [k: string]: any; + }; +} + +class CAC extends EventEmitter { + /** The program name to display in help and version message */ + name: string; + commands: Command[]; + globalCommand: GlobalCommand; + matchedCommand?: Command; + matchedCommandName?: string; + /** + * Raw CLI arguments + */ + + rawArgs: string[]; + /** + * Parsed CLI arguments + */ + + args: ParsedArgv['args']; + /** + * Parsed CLI options, camelCased + */ + + options: ParsedArgv['options']; + showHelpOnExit?: boolean; + showVersionOnExit?: boolean; + /** + * @param name The program name to display in help and version message + */ + + constructor(name = '') { + super(); + this.name = name; + this.commands = []; + this.rawArgs = []; + this.args = []; + this.options = {}; + this.globalCommand = new GlobalCommand(this); + this.globalCommand.usage(' [options]'); + } + /** + * Add a global usage text. + * + * This is not used by sub-commands. + */ + + + usage(text: string) { + this.globalCommand.usage(text); + return this; + } + /** + * Add a sub-command + */ + + + command(rawName: string, description?: string, config?: CommandConfig) { + const command = new Command(rawName, description || '', config, this); + command.globalCommand = this.globalCommand; + this.commands.push(command); + return command; + } + /** + * Add a global CLI option. + * + * Which is also applied to sub-commands. + */ + + + option(rawName: string, description: string, config?: OptionConfig) { + this.globalCommand.option(rawName, description, config); + return this; + } + /** + * Show help message when `-h, --help` flags appear. + * + */ + + + help(callback?: HelpCallback) { + this.globalCommand.option('-h, --help', 'Display this message'); + this.globalCommand.helpCallback = callback; + this.showHelpOnExit = true; + return this; + } + /** + * Show version number when `-v, --version` flags appear. + * + */ + + + version(version: string, customFlags = '-v, --version') { + this.globalCommand.version(version, customFlags); + this.showVersionOnExit = true; + return this; + } + /** + * Add a global example. + * + * This example added here will not be used by sub-commands. + */ + + + example(example: CommandExample) { + this.globalCommand.example(example); + return this; + } + /** + * Output the corresponding help message + * When a sub-command is matched, output the help message for the command + * Otherwise output the global one. + * + */ + + + outputHelp() { + if (this.matchedCommand) { + this.matchedCommand.outputHelp(); + } else { + this.globalCommand.outputHelp(); + } + } + /** + * Output the version number. + * + */ + + + outputVersion() { + this.globalCommand.outputVersion(); + } + + private setParsedInfo({ + args, + options + }: ParsedArgv, matchedCommand?: Command, matchedCommandName?: string) { + this.args = args; + this.options = options; + + if (matchedCommand) { + this.matchedCommand = matchedCommand; + } + + if (matchedCommandName) { + this.matchedCommandName = matchedCommandName; + } + + return this; + } + + unsetMatchedCommand() { + this.matchedCommand = undefined; + this.matchedCommandName = undefined; + } + /** + * Parse argv + */ + + + parse(argv = processArgs, { + /** Whether to run the action for matched command */ + run = true + } = {}): ParsedArgv { + this.rawArgs = argv; + + if (!this.name) { + this.name = argv[1] ? getFileName(argv[1]) : 'cli'; + } + + let shouldParse = true; // Search sub-commands + + for (const command of this.commands) { + const parsed = this.mri(argv.slice(2), command); + const commandName = parsed.args[0]; + + if (command.isMatched(commandName)) { + shouldParse = false; + const parsedInfo = { ...parsed, + args: parsed.args.slice(1) + }; + this.setParsedInfo(parsedInfo, command, commandName); + this.emit(`command:${commandName}`, command); + } + } + + if (shouldParse) { + // Search the default command + for (const command of this.commands) { + if (command.name === '') { + shouldParse = false; + const parsed = this.mri(argv.slice(2), command); + this.setParsedInfo(parsed, command); + this.emit(`command:!`, command); + } + } + } + + if (shouldParse) { + const parsed = this.mri(argv.slice(2)); + this.setParsedInfo(parsed); + } + + if (this.options.help && this.showHelpOnExit) { + this.outputHelp(); + run = false; + this.unsetMatchedCommand(); + } + + if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) { + this.outputVersion(); + run = false; + this.unsetMatchedCommand(); + } + + const parsedArgv = { + args: this.args, + options: this.options + }; + + if (run) { + this.runMatchedCommand(); + } + + if (!this.matchedCommand && this.args[0]) { + this.emit('command:*'); + } + + return parsedArgv; + } + + private mri(argv: string[], + /** Matched command */ + command?: Command): ParsedArgv { + // All added options + const cliOptions = [...this.globalCommand.options, ...(command ? command.options : [])]; + const mriOptions = getMriOptions(cliOptions); // Extract everything after `--` since mri doesn't support it + + let argsAfterDoubleDashes: string[] = []; + const doubleDashesIndex = argv.indexOf('--'); + + if (doubleDashesIndex > -1) { + argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1); + argv = argv.slice(0, doubleDashesIndex); + } + + let parsed = mri(argv, mriOptions); + parsed = Object.keys(parsed).reduce((res, name) => { + return { ...res, + [camelcaseOptionName(name)]: parsed[name] + }; + }, { + _: [] + }); + const args = parsed._; + const options: { + [k: string]: any; + } = { + '--': argsAfterDoubleDashes + }; // Set option default value + + const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue; + let transforms = Object.create(null); + + for (const cliOption of cliOptions) { + if (!ignoreDefault && cliOption.config.default !== undefined) { + for (const name of cliOption.names) { + options[name] = cliOption.config.default; + } + } // If options type is defined + + + if (Array.isArray(cliOption.config.type)) { + if (transforms[cliOption.name] === undefined) { + transforms[cliOption.name] = Object.create(null); + transforms[cliOption.name]['shouldTransform'] = true; + transforms[cliOption.name]['transformFunction'] = cliOption.config.type[0]; + } + } + } // Set option values (support dot-nested property name) + + + for (const key of Object.keys(parsed)) { + if (key !== '_') { + const keys = key.split('.'); + setDotProp(options, keys, parsed[key]); + setByType(options, transforms); + } + } + + return { + args, + options + }; + } + + runMatchedCommand() { + const { + args, + options, + matchedCommand: command + } = this; + if (!command || !command.commandAction) return; + command.checkUnknownOptions(); + command.checkOptionValue(); + command.checkRequiredArgs(); + const actionArgs: any[] = []; + command.args.forEach((arg, index) => { + if (arg.variadic) { + actionArgs.push(args.slice(index)); + } else { + actionArgs.push(args[index]); + } + }); + actionArgs.push(options); + return command.commandAction.apply(this, actionArgs); + } + +} + +export default CAC; \ No newline at end of file diff --git a/node_modules/cac/deno/Command.ts b/node_modules/cac/deno/Command.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fd04a058a5d7ef12c941f86dcf087bf8ffc14dc --- /dev/null +++ b/node_modules/cac/deno/Command.ts @@ -0,0 +1,269 @@ +import CAC from "./CAC.ts"; +import Option, { OptionConfig } from "./Option.ts"; +import { removeBrackets, findAllBrackets, findLongest, padRight, CACError } from "./utils.ts"; +import { platformInfo } from "./deno.ts"; +interface CommandArg { + required: boolean; + value: string; + variadic: boolean; +} +interface HelpSection { + title?: string; + body: string; +} +interface CommandConfig { + allowUnknownOptions?: boolean; + ignoreOptionDefaultValue?: boolean; +} +type HelpCallback = (sections: HelpSection[]) => void | HelpSection[]; +type CommandExample = ((bin: string) => string) | string; + +class Command { + options: Option[]; + aliasNames: string[]; + /* Parsed command name */ + + name: string; + args: CommandArg[]; + commandAction?: (...args: any[]) => any; + usageText?: string; + versionNumber?: string; + examples: CommandExample[]; + helpCallback?: HelpCallback; + globalCommand?: GlobalCommand; + + constructor(public rawName: string, public description: string, public config: CommandConfig = {}, public cli: CAC) { + this.options = []; + this.aliasNames = []; + this.name = removeBrackets(rawName); + this.args = findAllBrackets(rawName); + this.examples = []; + } + + usage(text: string) { + this.usageText = text; + return this; + } + + allowUnknownOptions() { + this.config.allowUnknownOptions = true; + return this; + } + + ignoreOptionDefaultValue() { + this.config.ignoreOptionDefaultValue = true; + return this; + } + + version(version: string, customFlags = '-v, --version') { + this.versionNumber = version; + this.option(customFlags, 'Display version number'); + return this; + } + + example(example: CommandExample) { + this.examples.push(example); + return this; + } + /** + * Add a option for this command + * @param rawName Raw option name(s) + * @param description Option description + * @param config Option config + */ + + + option(rawName: string, description: string, config?: OptionConfig) { + const option = new Option(rawName, description, config); + this.options.push(option); + return this; + } + + alias(name: string) { + this.aliasNames.push(name); + return this; + } + + action(callback: (...args: any[]) => any) { + this.commandAction = callback; + return this; + } + /** + * Check if a command name is matched by this command + * @param name Command name + */ + + + isMatched(name: string) { + return this.name === name || this.aliasNames.includes(name); + } + + get isDefaultCommand() { + return this.name === '' || this.aliasNames.includes('!'); + } + + get isGlobalCommand(): boolean { + return this instanceof GlobalCommand; + } + /** + * Check if an option is registered in this command + * @param name Option name + */ + + + hasOption(name: string) { + name = name.split('.')[0]; + return this.options.find(option => { + return option.names.includes(name); + }); + } + + outputHelp() { + const { + name, + commands + } = this.cli; + const { + versionNumber, + options: globalOptions, + helpCallback + } = this.cli.globalCommand; + let sections: HelpSection[] = [{ + body: `${name}${versionNumber ? `/${versionNumber}` : ''}` + }]; + sections.push({ + title: 'Usage', + body: ` $ ${name} ${this.usageText || this.rawName}` + }); + const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0; + + if (showCommands) { + const longestCommandName = findLongest(commands.map(command => command.rawName)); + sections.push({ + title: 'Commands', + body: commands.map(command => { + return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`; + }).join('\n') + }); + sections.push({ + title: `For more info, run any command with the \`--help\` flag`, + body: commands.map(command => ` $ ${name}${command.name === '' ? '' : ` ${command.name}`} --help`).join('\n') + }); + } + + let options = this.isGlobalCommand ? globalOptions : [...this.options, ...(globalOptions || [])]; + + if (!this.isGlobalCommand && !this.isDefaultCommand) { + options = options.filter(option => option.name !== 'version'); + } + + if (options.length > 0) { + const longestOptionName = findLongest(options.map(option => option.rawName)); + sections.push({ + title: 'Options', + body: options.map(option => { + return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? '' : `(default: ${option.config.default})`}`; + }).join('\n') + }); + } + + if (this.examples.length > 0) { + sections.push({ + title: 'Examples', + body: this.examples.map(example => { + if (typeof example === 'function') { + return example(name); + } + + return example; + }).join('\n') + }); + } + + if (helpCallback) { + sections = helpCallback(sections) || sections; + } + + console.log(sections.map(section => { + return section.title ? `${section.title}:\n${section.body}` : section.body; + }).join('\n\n')); + } + + outputVersion() { + const { + name + } = this.cli; + const { + versionNumber + } = this.cli.globalCommand; + + if (versionNumber) { + console.log(`${name}/${versionNumber} ${platformInfo}`); + } + } + + checkRequiredArgs() { + const minimalArgsCount = this.args.filter(arg => arg.required).length; + + if (this.cli.args.length < minimalArgsCount) { + throw new CACError(`missing required args for command \`${this.rawName}\``); + } + } + /** + * Check if the parsed options contain any unknown options + * + * Exit and output error when true + */ + + + checkUnknownOptions() { + const { + options, + globalCommand + } = this.cli; + + if (!this.config.allowUnknownOptions) { + for (const name of Object.keys(options)) { + if (name !== '--' && !this.hasOption(name) && !globalCommand.hasOption(name)) { + throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``); + } + } + } + } + /** + * Check if the required string-type options exist + */ + + + checkOptionValue() { + const { + options: parsedOptions, + globalCommand + } = this.cli; + const options = [...globalCommand.options, ...this.options]; + + for (const option of options) { + const value = parsedOptions[option.name.split('.')[0]]; // Check required option value + + if (option.required) { + const hasNegated = options.some(o => o.negated && o.names.includes(option.name)); + + if (value === true || value === false && !hasNegated) { + throw new CACError(`option \`${option.rawName}\` value is missing`); + } + } + } + } + +} + +class GlobalCommand extends Command { + constructor(cli: CAC) { + super('@@global@@', '', {}, cli); + } + +} + +export type { HelpCallback, CommandExample, CommandConfig }; +export { GlobalCommand }; +export default Command; \ No newline at end of file diff --git a/node_modules/cac/deno/Option.ts b/node_modules/cac/deno/Option.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee7ed2d834dca8a57144d57d10e0ddd1920cc26d --- /dev/null +++ b/node_modules/cac/deno/Option.ts @@ -0,0 +1,52 @@ +import { removeBrackets, camelcaseOptionName } from "./utils.ts"; +interface OptionConfig { + default?: any; + type?: any[]; +} +export default class Option { + /** Option name */ + name: string; + /** Option name and aliases */ + + names: string[]; + isBoolean?: boolean; // `required` will be a boolean for options with brackets + + required?: boolean; + config: OptionConfig; + negated: boolean; + + constructor(public rawName: string, public description: string, config?: OptionConfig) { + this.config = Object.assign({}, config); // You may use cli.option('--env.* [value]', 'desc') to denote a dot-nested option + + rawName = rawName.replace(/\.\*/g, ''); + this.negated = false; + this.names = removeBrackets(rawName).split(',').map((v: string) => { + let name = v.trim().replace(/^-{1,2}/, ''); + + if (name.startsWith('no-')) { + this.negated = true; + name = name.replace(/^no-/, ''); + } + + return camelcaseOptionName(name); + }).sort((a, b) => a.length > b.length ? 1 : -1); // Sort names + // Use the longest name (last one) as actual option name + + this.name = this.names[this.names.length - 1]; + + if (this.negated && this.config.default == null) { + this.config.default = true; + } + + if (rawName.includes('<')) { + this.required = true; + } else if (rawName.includes('[')) { + this.required = false; + } else { + // No arg needed, it's boolean flag + this.isBoolean = true; + } + } + +} +export type { OptionConfig }; \ No newline at end of file diff --git a/node_modules/cac/deno/deno.ts b/node_modules/cac/deno/deno.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f8e7d9b9af5472fa009cf0482fe49bde83b13fb --- /dev/null +++ b/node_modules/cac/deno/deno.ts @@ -0,0 +1,4 @@ +// Ignore the TypeScript errors +// Since this file will only be used in Deno runtime +export const processArgs = ['deno', 'cli'].concat(Deno.args); +export const platformInfo = `${Deno.build.os}-${Deno.build.arch} deno-${Deno.version.deno}`; \ No newline at end of file diff --git a/node_modules/cac/deno/index.ts b/node_modules/cac/deno/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..55aa29b7db3ed129aca119177bbe3d520d2eabb4 --- /dev/null +++ b/node_modules/cac/deno/index.ts @@ -0,0 +1,10 @@ +import CAC from "./CAC.ts"; +import Command from "./Command.ts"; +/** + * @param name The program name to display in help and version message + */ + +const cac = (name = '') => new CAC(name); + +export default cac; +export { cac, CAC, Command }; \ No newline at end of file diff --git a/node_modules/cac/deno/utils.ts b/node_modules/cac/deno/utils.ts new file mode 100644 index 0000000000000000000000000000000000000000..d75847b5aa677dc173692596629932bd7fc3aad4 --- /dev/null +++ b/node_modules/cac/deno/utils.ts @@ -0,0 +1,145 @@ +import Option from "./Option.ts"; +export const removeBrackets = (v: string) => v.replace(/[<[].+/, '').trim(); +export const findAllBrackets = (v: string) => { + const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g; + const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g; + const res = []; + + const parse = (match: string[]) => { + let variadic = false; + let value = match[1]; + + if (value.startsWith('...')) { + value = value.slice(3); + variadic = true; + } + + return { + required: match[0].startsWith('<'), + value, + variadic + }; + }; + + let angledMatch; + + while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(angledMatch)); + } + + let squareMatch; + + while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(squareMatch)); + } + + return res; +}; +interface MriOptions { + alias: { + [k: string]: string[]; + }; + boolean: string[]; +} +export const getMriOptions = (options: Option[]) => { + const result: MriOptions = { + alias: {}, + boolean: [] + }; + + for (const [index, option] of options.entries()) { + // We do not set default values in mri options + // Since its type (typeof) will be used to cast parsed arguments. + // Which mean `--foo foo` will be parsed as `{foo: true}` if we have `{default:{foo: true}}` + // Set alias + if (option.names.length > 1) { + result.alias[option.names[0]] = option.names.slice(1); + } // Set boolean + + + if (option.isBoolean) { + if (option.negated) { + // For negated option + // We only set it to `boolean` type when there's no string-type option with the same name + const hasStringTypeOption = options.some((o, i) => { + return i !== index && o.names.some(name => option.names.includes(name)) && typeof o.required === 'boolean'; + }); + + if (!hasStringTypeOption) { + result.boolean.push(option.names[0]); + } + } else { + result.boolean.push(option.names[0]); + } + } + } + + return result; +}; +export const findLongest = (arr: string[]) => { + return arr.sort((a, b) => { + return a.length > b.length ? -1 : 1; + })[0]; +}; +export const padRight = (str: string, length: number) => { + return str.length >= length ? str : `${str}${' '.repeat(length - str.length)}`; +}; +export const camelcase = (input: string) => { + return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => { + return p1 + p2.toUpperCase(); + }); +}; +export const setDotProp = (obj: { + [k: string]: any; +}, keys: string[], val: any) => { + let i = 0; + let length = keys.length; + let t = obj; + let x; + + for (; i < length; ++i) { + x = t[keys[i]]; + t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf('.') || !(+keys[i + 1] > -1) ? {} : []; + } +}; +export const setByType = (obj: { + [k: string]: any; +}, transforms: { + [k: string]: any; +}) => { + for (const key of Object.keys(transforms)) { + const transform = transforms[key]; + + if (transform.shouldTransform) { + obj[key] = Array.prototype.concat.call([], obj[key]); + + if (typeof transform.transformFunction === 'function') { + obj[key] = obj[key].map(transform.transformFunction); + } + } + } +}; +export const getFileName = (input: string) => { + const m = /([^\\\/]+)$/.exec(input); + return m ? m[1] : ''; +}; +export const camelcaseOptionName = (name: string) => { + // Camelcase the option name + // Don't camelcase anything after the dot `.` + return name.split('.').map((v, i) => { + return i === 0 ? camelcase(v) : v; + }).join('.'); +}; +export class CACError extends Error { + constructor(message: string) { + super(message); + this.name = this.constructor.name; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } + } + +} \ No newline at end of file diff --git a/node_modules/cac/dist/index.d.ts b/node_modules/cac/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84dcb6642e6633419d94a81f5764f90d10273cfc --- /dev/null +++ b/node_modules/cac/dist/index.d.ts @@ -0,0 +1,191 @@ +import { EventEmitter } from 'events'; + +interface OptionConfig { + default?: any; + type?: any[]; +} +declare class Option { + rawName: string; + description: string; + /** Option name */ + name: string; + /** Option name and aliases */ + names: string[]; + isBoolean?: boolean; + required?: boolean; + config: OptionConfig; + negated: boolean; + constructor(rawName: string, description: string, config?: OptionConfig); +} + +interface CommandArg { + required: boolean; + value: string; + variadic: boolean; +} +interface HelpSection { + title?: string; + body: string; +} +interface CommandConfig { + allowUnknownOptions?: boolean; + ignoreOptionDefaultValue?: boolean; +} +declare type HelpCallback = (sections: HelpSection[]) => void | HelpSection[]; +declare type CommandExample = ((bin: string) => string) | string; +declare class Command { + rawName: string; + description: string; + config: CommandConfig; + cli: CAC; + options: Option[]; + aliasNames: string[]; + name: string; + args: CommandArg[]; + commandAction?: (...args: any[]) => any; + usageText?: string; + versionNumber?: string; + examples: CommandExample[]; + helpCallback?: HelpCallback; + globalCommand?: GlobalCommand; + constructor(rawName: string, description: string, config: CommandConfig, cli: CAC); + usage(text: string): this; + allowUnknownOptions(): this; + ignoreOptionDefaultValue(): this; + version(version: string, customFlags?: string): this; + example(example: CommandExample): this; + /** + * Add a option for this command + * @param rawName Raw option name(s) + * @param description Option description + * @param config Option config + */ + option(rawName: string, description: string, config?: OptionConfig): this; + alias(name: string): this; + action(callback: (...args: any[]) => any): this; + /** + * Check if a command name is matched by this command + * @param name Command name + */ + isMatched(name: string): boolean; + get isDefaultCommand(): boolean; + get isGlobalCommand(): boolean; + /** + * Check if an option is registered in this command + * @param name Option name + */ + hasOption(name: string): Option | undefined; + outputHelp(): void; + outputVersion(): void; + checkRequiredArgs(): void; + /** + * Check if the parsed options contain any unknown options + * + * Exit and output error when true + */ + checkUnknownOptions(): void; + /** + * Check if the required string-type options exist + */ + checkOptionValue(): void; +} +declare class GlobalCommand extends Command { + constructor(cli: CAC); +} + +interface ParsedArgv { + args: ReadonlyArray; + options: { + [k: string]: any; + }; +} +declare class CAC extends EventEmitter { + /** The program name to display in help and version message */ + name: string; + commands: Command[]; + globalCommand: GlobalCommand; + matchedCommand?: Command; + matchedCommandName?: string; + /** + * Raw CLI arguments + */ + rawArgs: string[]; + /** + * Parsed CLI arguments + */ + args: ParsedArgv['args']; + /** + * Parsed CLI options, camelCased + */ + options: ParsedArgv['options']; + showHelpOnExit?: boolean; + showVersionOnExit?: boolean; + /** + * @param name The program name to display in help and version message + */ + constructor(name?: string); + /** + * Add a global usage text. + * + * This is not used by sub-commands. + */ + usage(text: string): this; + /** + * Add a sub-command + */ + command(rawName: string, description?: string, config?: CommandConfig): Command; + /** + * Add a global CLI option. + * + * Which is also applied to sub-commands. + */ + option(rawName: string, description: string, config?: OptionConfig): this; + /** + * Show help message when `-h, --help` flags appear. + * + */ + help(callback?: HelpCallback): this; + /** + * Show version number when `-v, --version` flags appear. + * + */ + version(version: string, customFlags?: string): this; + /** + * Add a global example. + * + * This example added here will not be used by sub-commands. + */ + example(example: CommandExample): this; + /** + * Output the corresponding help message + * When a sub-command is matched, output the help message for the command + * Otherwise output the global one. + * + */ + outputHelp(): void; + /** + * Output the version number. + * + */ + outputVersion(): void; + private setParsedInfo; + unsetMatchedCommand(): void; + /** + * Parse argv + */ + parse(argv?: string[], { + /** Whether to run the action for matched command */ + run, }?: { + run?: boolean | undefined; + }): ParsedArgv; + private mri; + runMatchedCommand(): any; +} + +/** + * @param name The program name to display in help and version message + */ +declare const cac: (name?: string) => CAC; + +export default cac; +export { CAC, Command, cac }; diff --git a/node_modules/cac/dist/index.js b/node_modules/cac/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8582dbf62dcc4152a4a07a581c1cf19e4e7a4777 --- /dev/null +++ b/node_modules/cac/dist/index.js @@ -0,0 +1,623 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var events = require('events'); + +function toArr(any) { + return any == null ? [] : Array.isArray(any) ? any : [any]; +} + +function toVal(out, key, val, opts) { + var x, old=out[key], nxt=( + !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) + : typeof val === 'boolean' ? val + : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) + : (x = +val,x * 0 === 0) ? x : val + ); + out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); +} + +function mri2 (args, opts) { + args = args || []; + opts = opts || {}; + + var k, arr, arg, name, val, out={ _:[] }; + var i=0, j=0, idx=0, len=args.length; + + const alibi = opts.alias !== void 0; + const strict = opts.unknown !== void 0; + const defaults = opts.default !== void 0; + + opts.alias = opts.alias || {}; + opts.string = toArr(opts.string); + opts.boolean = toArr(opts.boolean); + + if (alibi) { + for (k in opts.alias) { + arr = opts.alias[k] = toArr(opts.alias[k]); + for (i=0; i < arr.length; i++) { + (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); + } + } + } + + for (i=opts.boolean.length; i-- > 0;) { + arr = opts.alias[opts.boolean[i]] || []; + for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); + } + + for (i=opts.string.length; i-- > 0;) { + arr = opts.alias[opts.string[i]] || []; + for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); + } + + if (defaults) { + for (k in opts.default) { + name = typeof opts.default[k]; + arr = opts.alias[k] = opts.alias[k] || []; + if (opts[name] !== void 0) { + opts[name].push(k); + for (i=0; i < arr.length; i++) { + opts[name].push(arr[i]); + } + } + } + } + + const keys = strict ? Object.keys(opts.alias) : []; + + for (i=0; i < len; i++) { + arg = args[i]; + + if (arg === '--') { + out._ = out._.concat(args.slice(++i)); + break; + } + + for (j=0; j < arg.length; j++) { + if (arg.charCodeAt(j) !== 45) break; // "-" + } + + if (j === 0) { + out._.push(arg); + } else if (arg.substring(j, j + 3) === 'no-') { + name = arg.substring(j + 3); + if (strict && !~keys.indexOf(name)) { + return opts.unknown(arg); + } + out[name] = false; + } else { + for (idx=j+1; idx < arg.length; idx++) { + if (arg.charCodeAt(idx) === 61) break; // "=" + } + + name = arg.substring(j, idx); + val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); + arr = (j === 2 ? [name] : name); + + for (idx=0; idx < arr.length; idx++) { + name = arr[idx]; + if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); + toVal(out, name, (idx + 1 < arr.length) || val, opts); + } + } + } + + if (defaults) { + for (k in opts.default) { + if (out[k] === void 0) { + out[k] = opts.default[k]; + } + } + } + + if (alibi) { + for (k in out) { + arr = opts.alias[k] || []; + while (arr.length > 0) { + out[arr.shift()] = out[k]; + } + } + } + + return out; +} + +const removeBrackets = (v) => v.replace(/[<[].+/, "").trim(); +const findAllBrackets = (v) => { + const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g; + const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g; + const res = []; + const parse = (match) => { + let variadic = false; + let value = match[1]; + if (value.startsWith("...")) { + value = value.slice(3); + variadic = true; + } + return { + required: match[0].startsWith("<"), + value, + variadic + }; + }; + let angledMatch; + while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(angledMatch)); + } + let squareMatch; + while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(squareMatch)); + } + return res; +}; +const getMriOptions = (options) => { + const result = {alias: {}, boolean: []}; + for (const [index, option] of options.entries()) { + if (option.names.length > 1) { + result.alias[option.names[0]] = option.names.slice(1); + } + if (option.isBoolean) { + if (option.negated) { + const hasStringTypeOption = options.some((o, i) => { + return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean"; + }); + if (!hasStringTypeOption) { + result.boolean.push(option.names[0]); + } + } else { + result.boolean.push(option.names[0]); + } + } + } + return result; +}; +const findLongest = (arr) => { + return arr.sort((a, b) => { + return a.length > b.length ? -1 : 1; + })[0]; +}; +const padRight = (str, length) => { + return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`; +}; +const camelcase = (input) => { + return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => { + return p1 + p2.toUpperCase(); + }); +}; +const setDotProp = (obj, keys, val) => { + let i = 0; + let length = keys.length; + let t = obj; + let x; + for (; i < length; ++i) { + x = t[keys[i]]; + t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : []; + } +}; +const setByType = (obj, transforms) => { + for (const key of Object.keys(transforms)) { + const transform = transforms[key]; + if (transform.shouldTransform) { + obj[key] = Array.prototype.concat.call([], obj[key]); + if (typeof transform.transformFunction === "function") { + obj[key] = obj[key].map(transform.transformFunction); + } + } + } +}; +const getFileName = (input) => { + const m = /([^\\\/]+)$/.exec(input); + return m ? m[1] : ""; +}; +const camelcaseOptionName = (name) => { + return name.split(".").map((v, i) => { + return i === 0 ? camelcase(v) : v; + }).join("."); +}; +class CACError extends Error { + constructor(message) { + super(message); + this.name = this.constructor.name; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } + } +} + +class Option { + constructor(rawName, description, config) { + this.rawName = rawName; + this.description = description; + this.config = Object.assign({}, config); + rawName = rawName.replace(/\.\*/g, ""); + this.negated = false; + this.names = removeBrackets(rawName).split(",").map((v) => { + let name = v.trim().replace(/^-{1,2}/, ""); + if (name.startsWith("no-")) { + this.negated = true; + name = name.replace(/^no-/, ""); + } + return camelcaseOptionName(name); + }).sort((a, b) => a.length > b.length ? 1 : -1); + this.name = this.names[this.names.length - 1]; + if (this.negated && this.config.default == null) { + this.config.default = true; + } + if (rawName.includes("<")) { + this.required = true; + } else if (rawName.includes("[")) { + this.required = false; + } else { + this.isBoolean = true; + } + } +} + +const processArgs = process.argv; +const platformInfo = `${process.platform}-${process.arch} node-${process.version}`; + +class Command { + constructor(rawName, description, config = {}, cli) { + this.rawName = rawName; + this.description = description; + this.config = config; + this.cli = cli; + this.options = []; + this.aliasNames = []; + this.name = removeBrackets(rawName); + this.args = findAllBrackets(rawName); + this.examples = []; + } + usage(text) { + this.usageText = text; + return this; + } + allowUnknownOptions() { + this.config.allowUnknownOptions = true; + return this; + } + ignoreOptionDefaultValue() { + this.config.ignoreOptionDefaultValue = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.versionNumber = version; + this.option(customFlags, "Display version number"); + return this; + } + example(example) { + this.examples.push(example); + return this; + } + option(rawName, description, config) { + const option = new Option(rawName, description, config); + this.options.push(option); + return this; + } + alias(name) { + this.aliasNames.push(name); + return this; + } + action(callback) { + this.commandAction = callback; + return this; + } + isMatched(name) { + return this.name === name || this.aliasNames.includes(name); + } + get isDefaultCommand() { + return this.name === "" || this.aliasNames.includes("!"); + } + get isGlobalCommand() { + return this instanceof GlobalCommand; + } + hasOption(name) { + name = name.split(".")[0]; + return this.options.find((option) => { + return option.names.includes(name); + }); + } + outputHelp() { + const {name, commands} = this.cli; + const { + versionNumber, + options: globalOptions, + helpCallback + } = this.cli.globalCommand; + let sections = [ + { + body: `${name}${versionNumber ? `/${versionNumber}` : ""}` + } + ]; + sections.push({ + title: "Usage", + body: ` $ ${name} ${this.usageText || this.rawName}` + }); + const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0; + if (showCommands) { + const longestCommandName = findLongest(commands.map((command) => command.rawName)); + sections.push({ + title: "Commands", + body: commands.map((command) => { + return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`; + }).join("\n") + }); + sections.push({ + title: `For more info, run any command with the \`--help\` flag`, + body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n") + }); + } + let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []]; + if (!this.isGlobalCommand && !this.isDefaultCommand) { + options = options.filter((option) => option.name !== "version"); + } + if (options.length > 0) { + const longestOptionName = findLongest(options.map((option) => option.rawName)); + sections.push({ + title: "Options", + body: options.map((option) => { + return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`; + }).join("\n") + }); + } + if (this.examples.length > 0) { + sections.push({ + title: "Examples", + body: this.examples.map((example) => { + if (typeof example === "function") { + return example(name); + } + return example; + }).join("\n") + }); + } + if (helpCallback) { + sections = helpCallback(sections) || sections; + } + console.log(sections.map((section) => { + return section.title ? `${section.title}: +${section.body}` : section.body; + }).join("\n\n")); + } + outputVersion() { + const {name} = this.cli; + const {versionNumber} = this.cli.globalCommand; + if (versionNumber) { + console.log(`${name}/${versionNumber} ${platformInfo}`); + } + } + checkRequiredArgs() { + const minimalArgsCount = this.args.filter((arg) => arg.required).length; + if (this.cli.args.length < minimalArgsCount) { + throw new CACError(`missing required args for command \`${this.rawName}\``); + } + } + checkUnknownOptions() { + const {options, globalCommand} = this.cli; + if (!this.config.allowUnknownOptions) { + for (const name of Object.keys(options)) { + if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) { + throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``); + } + } + } + } + checkOptionValue() { + const {options: parsedOptions, globalCommand} = this.cli; + const options = [...globalCommand.options, ...this.options]; + for (const option of options) { + const value = parsedOptions[option.name.split(".")[0]]; + if (option.required) { + const hasNegated = options.some((o) => o.negated && o.names.includes(option.name)); + if (value === true || value === false && !hasNegated) { + throw new CACError(`option \`${option.rawName}\` value is missing`); + } + } + } + } +} +class GlobalCommand extends Command { + constructor(cli) { + super("@@global@@", "", {}, cli); + } +} + +var __assign = Object.assign; +class CAC extends events.EventEmitter { + constructor(name = "") { + super(); + this.name = name; + this.commands = []; + this.rawArgs = []; + this.args = []; + this.options = {}; + this.globalCommand = new GlobalCommand(this); + this.globalCommand.usage(" [options]"); + } + usage(text) { + this.globalCommand.usage(text); + return this; + } + command(rawName, description, config) { + const command = new Command(rawName, description || "", config, this); + command.globalCommand = this.globalCommand; + this.commands.push(command); + return command; + } + option(rawName, description, config) { + this.globalCommand.option(rawName, description, config); + return this; + } + help(callback) { + this.globalCommand.option("-h, --help", "Display this message"); + this.globalCommand.helpCallback = callback; + this.showHelpOnExit = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.globalCommand.version(version, customFlags); + this.showVersionOnExit = true; + return this; + } + example(example) { + this.globalCommand.example(example); + return this; + } + outputHelp() { + if (this.matchedCommand) { + this.matchedCommand.outputHelp(); + } else { + this.globalCommand.outputHelp(); + } + } + outputVersion() { + this.globalCommand.outputVersion(); + } + setParsedInfo({args, options}, matchedCommand, matchedCommandName) { + this.args = args; + this.options = options; + if (matchedCommand) { + this.matchedCommand = matchedCommand; + } + if (matchedCommandName) { + this.matchedCommandName = matchedCommandName; + } + return this; + } + unsetMatchedCommand() { + this.matchedCommand = void 0; + this.matchedCommandName = void 0; + } + parse(argv = processArgs, { + run = true + } = {}) { + this.rawArgs = argv; + if (!this.name) { + this.name = argv[1] ? getFileName(argv[1]) : "cli"; + } + let shouldParse = true; + for (const command of this.commands) { + const parsed = this.mri(argv.slice(2), command); + const commandName = parsed.args[0]; + if (command.isMatched(commandName)) { + shouldParse = false; + const parsedInfo = __assign(__assign({}, parsed), { + args: parsed.args.slice(1) + }); + this.setParsedInfo(parsedInfo, command, commandName); + this.emit(`command:${commandName}`, command); + } + } + if (shouldParse) { + for (const command of this.commands) { + if (command.name === "") { + shouldParse = false; + const parsed = this.mri(argv.slice(2), command); + this.setParsedInfo(parsed, command); + this.emit(`command:!`, command); + } + } + } + if (shouldParse) { + const parsed = this.mri(argv.slice(2)); + this.setParsedInfo(parsed); + } + if (this.options.help && this.showHelpOnExit) { + this.outputHelp(); + run = false; + this.unsetMatchedCommand(); + } + if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) { + this.outputVersion(); + run = false; + this.unsetMatchedCommand(); + } + const parsedArgv = {args: this.args, options: this.options}; + if (run) { + this.runMatchedCommand(); + } + if (!this.matchedCommand && this.args[0]) { + this.emit("command:*"); + } + return parsedArgv; + } + mri(argv, command) { + const cliOptions = [ + ...this.globalCommand.options, + ...command ? command.options : [] + ]; + const mriOptions = getMriOptions(cliOptions); + let argsAfterDoubleDashes = []; + const doubleDashesIndex = argv.indexOf("--"); + if (doubleDashesIndex > -1) { + argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1); + argv = argv.slice(0, doubleDashesIndex); + } + let parsed = mri2(argv, mriOptions); + parsed = Object.keys(parsed).reduce((res, name) => { + return __assign(__assign({}, res), { + [camelcaseOptionName(name)]: parsed[name] + }); + }, {_: []}); + const args = parsed._; + const options = { + "--": argsAfterDoubleDashes + }; + const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue; + let transforms = Object.create(null); + for (const cliOption of cliOptions) { + if (!ignoreDefault && cliOption.config.default !== void 0) { + for (const name of cliOption.names) { + options[name] = cliOption.config.default; + } + } + if (Array.isArray(cliOption.config.type)) { + if (transforms[cliOption.name] === void 0) { + transforms[cliOption.name] = Object.create(null); + transforms[cliOption.name]["shouldTransform"] = true; + transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0]; + } + } + } + for (const key of Object.keys(parsed)) { + if (key !== "_") { + const keys = key.split("."); + setDotProp(options, keys, parsed[key]); + setByType(options, transforms); + } + } + return { + args, + options + }; + } + runMatchedCommand() { + const {args, options, matchedCommand: command} = this; + if (!command || !command.commandAction) + return; + command.checkUnknownOptions(); + command.checkOptionValue(); + command.checkRequiredArgs(); + const actionArgs = []; + command.args.forEach((arg, index) => { + if (arg.variadic) { + actionArgs.push(args.slice(index)); + } else { + actionArgs.push(args[index]); + } + }); + actionArgs.push(options); + return command.commandAction.apply(this, actionArgs); + } +} + +const cac = (name = "") => new CAC(name); + +exports.CAC = CAC; +exports.Command = Command; +exports.cac = cac; +exports.default = cac; diff --git a/node_modules/cac/dist/index.mjs b/node_modules/cac/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7c1c4440c6ed22a3829f828364b06669c56b31c9 --- /dev/null +++ b/node_modules/cac/dist/index.mjs @@ -0,0 +1,617 @@ +import { EventEmitter } from 'events'; + +function toArr(any) { + return any == null ? [] : Array.isArray(any) ? any : [any]; +} + +function toVal(out, key, val, opts) { + var x, old=out[key], nxt=( + !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) + : typeof val === 'boolean' ? val + : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) + : (x = +val,x * 0 === 0) ? x : val + ); + out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); +} + +function mri2 (args, opts) { + args = args || []; + opts = opts || {}; + + var k, arr, arg, name, val, out={ _:[] }; + var i=0, j=0, idx=0, len=args.length; + + const alibi = opts.alias !== void 0; + const strict = opts.unknown !== void 0; + const defaults = opts.default !== void 0; + + opts.alias = opts.alias || {}; + opts.string = toArr(opts.string); + opts.boolean = toArr(opts.boolean); + + if (alibi) { + for (k in opts.alias) { + arr = opts.alias[k] = toArr(opts.alias[k]); + for (i=0; i < arr.length; i++) { + (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); + } + } + } + + for (i=opts.boolean.length; i-- > 0;) { + arr = opts.alias[opts.boolean[i]] || []; + for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); + } + + for (i=opts.string.length; i-- > 0;) { + arr = opts.alias[opts.string[i]] || []; + for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); + } + + if (defaults) { + for (k in opts.default) { + name = typeof opts.default[k]; + arr = opts.alias[k] = opts.alias[k] || []; + if (opts[name] !== void 0) { + opts[name].push(k); + for (i=0; i < arr.length; i++) { + opts[name].push(arr[i]); + } + } + } + } + + const keys = strict ? Object.keys(opts.alias) : []; + + for (i=0; i < len; i++) { + arg = args[i]; + + if (arg === '--') { + out._ = out._.concat(args.slice(++i)); + break; + } + + for (j=0; j < arg.length; j++) { + if (arg.charCodeAt(j) !== 45) break; // "-" + } + + if (j === 0) { + out._.push(arg); + } else if (arg.substring(j, j + 3) === 'no-') { + name = arg.substring(j + 3); + if (strict && !~keys.indexOf(name)) { + return opts.unknown(arg); + } + out[name] = false; + } else { + for (idx=j+1; idx < arg.length; idx++) { + if (arg.charCodeAt(idx) === 61) break; // "=" + } + + name = arg.substring(j, idx); + val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); + arr = (j === 2 ? [name] : name); + + for (idx=0; idx < arr.length; idx++) { + name = arr[idx]; + if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); + toVal(out, name, (idx + 1 < arr.length) || val, opts); + } + } + } + + if (defaults) { + for (k in opts.default) { + if (out[k] === void 0) { + out[k] = opts.default[k]; + } + } + } + + if (alibi) { + for (k in out) { + arr = opts.alias[k] || []; + while (arr.length > 0) { + out[arr.shift()] = out[k]; + } + } + } + + return out; +} + +const removeBrackets = (v) => v.replace(/[<[].+/, "").trim(); +const findAllBrackets = (v) => { + const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g; + const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g; + const res = []; + const parse = (match) => { + let variadic = false; + let value = match[1]; + if (value.startsWith("...")) { + value = value.slice(3); + variadic = true; + } + return { + required: match[0].startsWith("<"), + value, + variadic + }; + }; + let angledMatch; + while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(angledMatch)); + } + let squareMatch; + while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(squareMatch)); + } + return res; +}; +const getMriOptions = (options) => { + const result = {alias: {}, boolean: []}; + for (const [index, option] of options.entries()) { + if (option.names.length > 1) { + result.alias[option.names[0]] = option.names.slice(1); + } + if (option.isBoolean) { + if (option.negated) { + const hasStringTypeOption = options.some((o, i) => { + return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean"; + }); + if (!hasStringTypeOption) { + result.boolean.push(option.names[0]); + } + } else { + result.boolean.push(option.names[0]); + } + } + } + return result; +}; +const findLongest = (arr) => { + return arr.sort((a, b) => { + return a.length > b.length ? -1 : 1; + })[0]; +}; +const padRight = (str, length) => { + return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`; +}; +const camelcase = (input) => { + return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => { + return p1 + p2.toUpperCase(); + }); +}; +const setDotProp = (obj, keys, val) => { + let i = 0; + let length = keys.length; + let t = obj; + let x; + for (; i < length; ++i) { + x = t[keys[i]]; + t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : []; + } +}; +const setByType = (obj, transforms) => { + for (const key of Object.keys(transforms)) { + const transform = transforms[key]; + if (transform.shouldTransform) { + obj[key] = Array.prototype.concat.call([], obj[key]); + if (typeof transform.transformFunction === "function") { + obj[key] = obj[key].map(transform.transformFunction); + } + } + } +}; +const getFileName = (input) => { + const m = /([^\\\/]+)$/.exec(input); + return m ? m[1] : ""; +}; +const camelcaseOptionName = (name) => { + return name.split(".").map((v, i) => { + return i === 0 ? camelcase(v) : v; + }).join("."); +}; +class CACError extends Error { + constructor(message) { + super(message); + this.name = this.constructor.name; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } + } +} + +class Option { + constructor(rawName, description, config) { + this.rawName = rawName; + this.description = description; + this.config = Object.assign({}, config); + rawName = rawName.replace(/\.\*/g, ""); + this.negated = false; + this.names = removeBrackets(rawName).split(",").map((v) => { + let name = v.trim().replace(/^-{1,2}/, ""); + if (name.startsWith("no-")) { + this.negated = true; + name = name.replace(/^no-/, ""); + } + return camelcaseOptionName(name); + }).sort((a, b) => a.length > b.length ? 1 : -1); + this.name = this.names[this.names.length - 1]; + if (this.negated && this.config.default == null) { + this.config.default = true; + } + if (rawName.includes("<")) { + this.required = true; + } else if (rawName.includes("[")) { + this.required = false; + } else { + this.isBoolean = true; + } + } +} + +const processArgs = process.argv; +const platformInfo = `${process.platform}-${process.arch} node-${process.version}`; + +class Command { + constructor(rawName, description, config = {}, cli) { + this.rawName = rawName; + this.description = description; + this.config = config; + this.cli = cli; + this.options = []; + this.aliasNames = []; + this.name = removeBrackets(rawName); + this.args = findAllBrackets(rawName); + this.examples = []; + } + usage(text) { + this.usageText = text; + return this; + } + allowUnknownOptions() { + this.config.allowUnknownOptions = true; + return this; + } + ignoreOptionDefaultValue() { + this.config.ignoreOptionDefaultValue = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.versionNumber = version; + this.option(customFlags, "Display version number"); + return this; + } + example(example) { + this.examples.push(example); + return this; + } + option(rawName, description, config) { + const option = new Option(rawName, description, config); + this.options.push(option); + return this; + } + alias(name) { + this.aliasNames.push(name); + return this; + } + action(callback) { + this.commandAction = callback; + return this; + } + isMatched(name) { + return this.name === name || this.aliasNames.includes(name); + } + get isDefaultCommand() { + return this.name === "" || this.aliasNames.includes("!"); + } + get isGlobalCommand() { + return this instanceof GlobalCommand; + } + hasOption(name) { + name = name.split(".")[0]; + return this.options.find((option) => { + return option.names.includes(name); + }); + } + outputHelp() { + const {name, commands} = this.cli; + const { + versionNumber, + options: globalOptions, + helpCallback + } = this.cli.globalCommand; + let sections = [ + { + body: `${name}${versionNumber ? `/${versionNumber}` : ""}` + } + ]; + sections.push({ + title: "Usage", + body: ` $ ${name} ${this.usageText || this.rawName}` + }); + const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0; + if (showCommands) { + const longestCommandName = findLongest(commands.map((command) => command.rawName)); + sections.push({ + title: "Commands", + body: commands.map((command) => { + return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`; + }).join("\n") + }); + sections.push({ + title: `For more info, run any command with the \`--help\` flag`, + body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n") + }); + } + let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []]; + if (!this.isGlobalCommand && !this.isDefaultCommand) { + options = options.filter((option) => option.name !== "version"); + } + if (options.length > 0) { + const longestOptionName = findLongest(options.map((option) => option.rawName)); + sections.push({ + title: "Options", + body: options.map((option) => { + return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`; + }).join("\n") + }); + } + if (this.examples.length > 0) { + sections.push({ + title: "Examples", + body: this.examples.map((example) => { + if (typeof example === "function") { + return example(name); + } + return example; + }).join("\n") + }); + } + if (helpCallback) { + sections = helpCallback(sections) || sections; + } + console.log(sections.map((section) => { + return section.title ? `${section.title}: +${section.body}` : section.body; + }).join("\n\n")); + } + outputVersion() { + const {name} = this.cli; + const {versionNumber} = this.cli.globalCommand; + if (versionNumber) { + console.log(`${name}/${versionNumber} ${platformInfo}`); + } + } + checkRequiredArgs() { + const minimalArgsCount = this.args.filter((arg) => arg.required).length; + if (this.cli.args.length < minimalArgsCount) { + throw new CACError(`missing required args for command \`${this.rawName}\``); + } + } + checkUnknownOptions() { + const {options, globalCommand} = this.cli; + if (!this.config.allowUnknownOptions) { + for (const name of Object.keys(options)) { + if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) { + throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``); + } + } + } + } + checkOptionValue() { + const {options: parsedOptions, globalCommand} = this.cli; + const options = [...globalCommand.options, ...this.options]; + for (const option of options) { + const value = parsedOptions[option.name.split(".")[0]]; + if (option.required) { + const hasNegated = options.some((o) => o.negated && o.names.includes(option.name)); + if (value === true || value === false && !hasNegated) { + throw new CACError(`option \`${option.rawName}\` value is missing`); + } + } + } + } +} +class GlobalCommand extends Command { + constructor(cli) { + super("@@global@@", "", {}, cli); + } +} + +var __assign = Object.assign; +class CAC extends EventEmitter { + constructor(name = "") { + super(); + this.name = name; + this.commands = []; + this.rawArgs = []; + this.args = []; + this.options = {}; + this.globalCommand = new GlobalCommand(this); + this.globalCommand.usage(" [options]"); + } + usage(text) { + this.globalCommand.usage(text); + return this; + } + command(rawName, description, config) { + const command = new Command(rawName, description || "", config, this); + command.globalCommand = this.globalCommand; + this.commands.push(command); + return command; + } + option(rawName, description, config) { + this.globalCommand.option(rawName, description, config); + return this; + } + help(callback) { + this.globalCommand.option("-h, --help", "Display this message"); + this.globalCommand.helpCallback = callback; + this.showHelpOnExit = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.globalCommand.version(version, customFlags); + this.showVersionOnExit = true; + return this; + } + example(example) { + this.globalCommand.example(example); + return this; + } + outputHelp() { + if (this.matchedCommand) { + this.matchedCommand.outputHelp(); + } else { + this.globalCommand.outputHelp(); + } + } + outputVersion() { + this.globalCommand.outputVersion(); + } + setParsedInfo({args, options}, matchedCommand, matchedCommandName) { + this.args = args; + this.options = options; + if (matchedCommand) { + this.matchedCommand = matchedCommand; + } + if (matchedCommandName) { + this.matchedCommandName = matchedCommandName; + } + return this; + } + unsetMatchedCommand() { + this.matchedCommand = void 0; + this.matchedCommandName = void 0; + } + parse(argv = processArgs, { + run = true + } = {}) { + this.rawArgs = argv; + if (!this.name) { + this.name = argv[1] ? getFileName(argv[1]) : "cli"; + } + let shouldParse = true; + for (const command of this.commands) { + const parsed = this.mri(argv.slice(2), command); + const commandName = parsed.args[0]; + if (command.isMatched(commandName)) { + shouldParse = false; + const parsedInfo = __assign(__assign({}, parsed), { + args: parsed.args.slice(1) + }); + this.setParsedInfo(parsedInfo, command, commandName); + this.emit(`command:${commandName}`, command); + } + } + if (shouldParse) { + for (const command of this.commands) { + if (command.name === "") { + shouldParse = false; + const parsed = this.mri(argv.slice(2), command); + this.setParsedInfo(parsed, command); + this.emit(`command:!`, command); + } + } + } + if (shouldParse) { + const parsed = this.mri(argv.slice(2)); + this.setParsedInfo(parsed); + } + if (this.options.help && this.showHelpOnExit) { + this.outputHelp(); + run = false; + this.unsetMatchedCommand(); + } + if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) { + this.outputVersion(); + run = false; + this.unsetMatchedCommand(); + } + const parsedArgv = {args: this.args, options: this.options}; + if (run) { + this.runMatchedCommand(); + } + if (!this.matchedCommand && this.args[0]) { + this.emit("command:*"); + } + return parsedArgv; + } + mri(argv, command) { + const cliOptions = [ + ...this.globalCommand.options, + ...command ? command.options : [] + ]; + const mriOptions = getMriOptions(cliOptions); + let argsAfterDoubleDashes = []; + const doubleDashesIndex = argv.indexOf("--"); + if (doubleDashesIndex > -1) { + argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1); + argv = argv.slice(0, doubleDashesIndex); + } + let parsed = mri2(argv, mriOptions); + parsed = Object.keys(parsed).reduce((res, name) => { + return __assign(__assign({}, res), { + [camelcaseOptionName(name)]: parsed[name] + }); + }, {_: []}); + const args = parsed._; + const options = { + "--": argsAfterDoubleDashes + }; + const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue; + let transforms = Object.create(null); + for (const cliOption of cliOptions) { + if (!ignoreDefault && cliOption.config.default !== void 0) { + for (const name of cliOption.names) { + options[name] = cliOption.config.default; + } + } + if (Array.isArray(cliOption.config.type)) { + if (transforms[cliOption.name] === void 0) { + transforms[cliOption.name] = Object.create(null); + transforms[cliOption.name]["shouldTransform"] = true; + transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0]; + } + } + } + for (const key of Object.keys(parsed)) { + if (key !== "_") { + const keys = key.split("."); + setDotProp(options, keys, parsed[key]); + setByType(options, transforms); + } + } + return { + args, + options + }; + } + runMatchedCommand() { + const {args, options, matchedCommand: command} = this; + if (!command || !command.commandAction) + return; + command.checkUnknownOptions(); + command.checkOptionValue(); + command.checkRequiredArgs(); + const actionArgs = []; + command.args.forEach((arg, index) => { + if (arg.variadic) { + actionArgs.push(args.slice(index)); + } else { + actionArgs.push(args[index]); + } + }); + actionArgs.push(options); + return command.commandAction.apply(this, actionArgs); + } +} + +const cac = (name = "") => new CAC(name); + +export default cac; +export { CAC, Command, cac }; diff --git a/node_modules/cac/index-compat.js b/node_modules/cac/index-compat.js new file mode 100644 index 0000000000000000000000000000000000000000..6b8a78d3a5764e06c4082842ce0aa65f5b290d1d --- /dev/null +++ b/node_modules/cac/index-compat.js @@ -0,0 +1,11 @@ +const { cac, CAC, Command } = require('./dist/index') + +// For backwards compatibility +module.exports = cac + +Object.assign(module.exports, { + default: cac, + cac, + CAC, + Command, +}) diff --git a/node_modules/cac/mod.js b/node_modules/cac/mod.js new file mode 100644 index 0000000000000000000000000000000000000000..9d0e8943d5a3ec8d475469be5718e7567703ffff --- /dev/null +++ b/node_modules/cac/mod.js @@ -0,0 +1,2 @@ +// Deno users should use mod.ts instead +export * from './deno/index.ts' \ No newline at end of file diff --git a/node_modules/cac/mod.ts b/node_modules/cac/mod.ts new file mode 100644 index 0000000000000000000000000000000000000000..8fac7d9f0539fa8fa85be89f4f673834bb0a38af --- /dev/null +++ b/node_modules/cac/mod.ts @@ -0,0 +1,2 @@ +// For Deno +export * from './deno/index.ts' diff --git a/node_modules/cac/package.json b/node_modules/cac/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2306bf35bbe5d451bf03d48ad77af475a5d9f747 --- /dev/null +++ b/node_modules/cac/package.json @@ -0,0 +1,104 @@ +{ + "name": "cac", + "version": "6.7.14", + "description": "Simple yet powerful framework for building command-line apps.", + "repository": { + "url": "egoist/cac", + "type": "git" + }, + "main": "index-compat.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./index-compat.js" + }, + "./package.json": "./package.json", + "./*": "./*" + }, + "files": [ + "dist", + "!**/__test__/**", + "/mod.js", + "/mod.ts", + "/deno", + "/index-compat.js" + ], + "scripts": { + "test": "jest", + "test:cov": "jest --coverage", + "build:deno": "node -r sucrase/register scripts/build-deno.ts", + "build:node": "rollup -c", + "build": "yarn build:deno && yarn build:node", + "toc": "markdown-toc -i README.md", + "prepublishOnly": "npm run build && cp mod.js mod.mjs", + "docs:api": "typedoc --out api-doc --readme none --exclude \"**/__test__/**\" --theme minimal" + }, + "author": "egoist <0x142857@gmail.com>", + "license": "MIT", + "devDependencies": { + "@babel/core": "^7.12.10", + "@babel/plugin-syntax-typescript": "^7.12.1", + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "@types/fs-extra": "^9.0.5", + "@types/jest": "^26.0.19", + "@types/mri": "^1.1.0", + "cz-conventional-changelog": "^2.1.0", + "esbuild": "^0.8.21", + "eslint-config-rem": "^3.0.0", + "execa": "^5.0.0", + "fs-extra": "^9.0.1", + "globby": "^11.0.1", + "husky": "^1.2.0", + "jest": "^24.9.0", + "lint-staged": "^8.1.0", + "markdown-toc": "^1.2.0", + "mri": "^1.1.6", + "prettier": "^2.2.1", + "rollup": "^2.34.2", + "rollup-plugin-dts": "^2.0.1", + "rollup-plugin-esbuild": "^2.6.1", + "semantic-release": "^17.3.0", + "sucrase": "^3.16.0", + "ts-jest": "^26.4.4", + "ts-node": "^9.1.1", + "typedoc": "^0.19.2", + "typescript": "^4.1.2" + }, + "engines": { + "node": ">=8" + }, + "release": { + "branch": "master" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, + "lint-staged": { + "linters": { + "*.{js,json,ts}": [ + "prettier --write", + "git add" + ], + "*.md": [ + "markdown-toc -i", + "prettier --write", + "git add" + ] + }, + "ignore": [ + "dist/**", + "mod.js" + ] + }, + "husky": { + "hooks": { + "pre-commit": "npm t && lint-staged" + } + } +} diff --git a/node_modules/call-bind-apply-helpers/.eslintrc b/node_modules/call-bind-apply-helpers/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..201e859be230a5390ae41935c6f8d5f2ab1dbb5f --- /dev/null +++ b/node_modules/call-bind-apply-helpers/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-extra-parens": 0, + "no-magic-numbers": 0, + }, +} diff --git a/node_modules/call-bind-apply-helpers/.github/FUNDING.yml b/node_modules/call-bind-apply-helpers/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..0011e9d65fcaefeaccd7c79a0357e8f2214695ed --- /dev/null +++ b/node_modules/call-bind-apply-helpers/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind-apply-helpers +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind-apply-helpers/.nycrc b/node_modules/call-bind-apply-helpers/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/call-bind-apply-helpers/CHANGELOG.md b/node_modules/call-bind-apply-helpers/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..24849428bae69540a59077dd4d6b3d15ab7b097b --- /dev/null +++ b/node_modules/call-bind-apply-helpers/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12 + +### Commits + +- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1) + +## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08 + +### Commits + +- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8) +- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75) +- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940) + +## v1.0.0 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04) +- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f) +- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603) +- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930) diff --git a/node_modules/call-bind-apply-helpers/LICENSE b/node_modules/call-bind-apply-helpers/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f82f38963b0d282b529f64def2bcd40be3a9a947 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/call-bind-apply-helpers/README.md b/node_modules/call-bind-apply-helpers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8fc0dae1b3f6b0a22322a21b40b0f51665eadfb0 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/README.md @@ -0,0 +1,62 @@ +# call-bind-apply-helpers [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Helper functions around Function call/apply/bind, for use in `call-bind`. + +The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`. +Please use `call-bind` unless you have a very good reason not to. + +## Getting started + +```sh +npm install --save call-bind-apply-helpers +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBindBasic = require('call-bind-apply-helpers'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBindBasic([f, 1]); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(2, 3); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind-apply-helpers +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg +[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers +[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers +[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions diff --git a/node_modules/call-bind-apply-helpers/actualApply.d.ts b/node_modules/call-bind-apply-helpers/actualApply.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b87286a21e3eda5e94932818c21e2bd20b30e905 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/actualApply.d.ts @@ -0,0 +1 @@ +export = Reflect.apply; \ No newline at end of file diff --git a/node_modules/call-bind-apply-helpers/actualApply.js b/node_modules/call-bind-apply-helpers/actualApply.js new file mode 100644 index 0000000000000000000000000000000000000000..ffa51355dc7e5d3eb24f602f85f6ae57d087d310 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/actualApply.js @@ -0,0 +1,10 @@ +'use strict'; + +var bind = require('function-bind'); + +var $apply = require('./functionApply'); +var $call = require('./functionCall'); +var $reflectApply = require('./reflectApply'); + +/** @type {import('./actualApply')} */ +module.exports = $reflectApply || bind.call($call, $apply); diff --git a/node_modules/call-bind-apply-helpers/applyBind.d.ts b/node_modules/call-bind-apply-helpers/applyBind.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d176c1ab30e5193071f5f6a6b6e8aaa4402476c6 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/applyBind.d.ts @@ -0,0 +1,19 @@ +import actualApply from './actualApply'; + +type TupleSplitHead = T['length'] extends N + ? T + : T extends [...infer R, any] + ? TupleSplitHead + : never + +type TupleSplitTail = O['length'] extends N + ? T + : T extends [infer F, ...infer R] + ? TupleSplitTail<[...R], N, [...O, F]> + : never + +type TupleSplit = [TupleSplitHead, TupleSplitTail] + +declare function applyBind(...args: TupleSplit, 2>[1]): ReturnType; + +export = applyBind; \ No newline at end of file diff --git a/node_modules/call-bind-apply-helpers/applyBind.js b/node_modules/call-bind-apply-helpers/applyBind.js new file mode 100644 index 0000000000000000000000000000000000000000..d2b7723147450c8094f98d20d88a5170a4173bbb --- /dev/null +++ b/node_modules/call-bind-apply-helpers/applyBind.js @@ -0,0 +1,10 @@ +'use strict'; + +var bind = require('function-bind'); +var $apply = require('./functionApply'); +var actualApply = require('./actualApply'); + +/** @type {import('./applyBind')} */ +module.exports = function applyBind() { + return actualApply(bind, $apply, arguments); +}; diff --git a/node_modules/call-bind-apply-helpers/functionApply.d.ts b/node_modules/call-bind-apply-helpers/functionApply.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f6e11b3d0e95337b67b81b962b4c6abe69ed7ae --- /dev/null +++ b/node_modules/call-bind-apply-helpers/functionApply.d.ts @@ -0,0 +1 @@ +export = Function.prototype.apply; \ No newline at end of file diff --git a/node_modules/call-bind-apply-helpers/functionApply.js b/node_modules/call-bind-apply-helpers/functionApply.js new file mode 100644 index 0000000000000000000000000000000000000000..c71df9c2bcf07ca4340530058d0662661f29ec95 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/functionApply.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./functionApply')} */ +module.exports = Function.prototype.apply; diff --git a/node_modules/call-bind-apply-helpers/functionCall.d.ts b/node_modules/call-bind-apply-helpers/functionCall.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15e93df350fb6b8552c6ba89289966a8b998064e --- /dev/null +++ b/node_modules/call-bind-apply-helpers/functionCall.d.ts @@ -0,0 +1 @@ +export = Function.prototype.call; \ No newline at end of file diff --git a/node_modules/call-bind-apply-helpers/functionCall.js b/node_modules/call-bind-apply-helpers/functionCall.js new file mode 100644 index 0000000000000000000000000000000000000000..7a8d8735752ef518698f1fe62b4edd16725898a8 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/functionCall.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./functionCall')} */ +module.exports = Function.prototype.call; diff --git a/node_modules/call-bind-apply-helpers/index.d.ts b/node_modules/call-bind-apply-helpers/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..541516bd0f23194a87482e272f48439100b70c73 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/index.d.ts @@ -0,0 +1,64 @@ +type RemoveFromTuple< + Tuple extends readonly unknown[], + RemoveCount extends number, + Index extends 1[] = [] +> = Index["length"] extends RemoveCount + ? Tuple + : Tuple extends [infer First, ...infer Rest] + ? RemoveFromTuple + : Tuple; + +type ConcatTuples< + Prefix extends readonly unknown[], + Suffix extends readonly unknown[] +> = [...Prefix, ...Suffix]; + +type ExtractFunctionParams = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R + ? { thisArg: TThis; params: P; returnType: R } + : never; + +type BindFunction< + T extends (this: any, ...args: any[]) => any, + TThis, + TBoundArgs extends readonly unknown[], + ReceiverBound extends boolean +> = ExtractFunctionParams extends { + thisArg: infer OrigThis; + params: infer P extends readonly unknown[]; + returnType: infer R; +} + ? ReceiverBound extends true + ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest] + ? [TThis, ...Rest] // Replace `this` with `thisArg` + : R + : >>( + thisArg: U, + ...args: RemainingArgs + ) => R extends [OrigThis, ...infer Rest] + ? [U, ...ConcatTuples] // Preserve bound args in return type + : R + : never; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[], + const TThis extends Extracted["thisArg"] +>( + args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[] +>( + args: [fn: T, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind( + args: [fn: Exclude, ...rest: TArgs] +): never; + +// export as namespace callBind; +export = callBind; diff --git a/node_modules/call-bind-apply-helpers/index.js b/node_modules/call-bind-apply-helpers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2f6dab4c10431239352ab4626e326bf4e97cad5c --- /dev/null +++ b/node_modules/call-bind-apply-helpers/index.js @@ -0,0 +1,15 @@ +'use strict'; + +var bind = require('function-bind'); +var $TypeError = require('es-errors/type'); + +var $call = require('./functionCall'); +var $actualApply = require('./actualApply'); + +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +module.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== 'function') { + throw new $TypeError('a function is required'); + } + return $actualApply(bind, $call, args); +}; diff --git a/node_modules/call-bind-apply-helpers/package.json b/node_modules/call-bind-apply-helpers/package.json new file mode 100644 index 0000000000000000000000000000000000000000..923b8be2f14c65e78fd75a4fd34aba94fb733274 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/package.json @@ -0,0 +1,85 @@ +{ + "name": "call-bind-apply-helpers", + "version": "1.0.2", + "description": "Helper functions around Function call/apply/bind, for use in `call-bind`", + "main": "index.js", + "exports": { + ".": "./index.js", + "./actualApply": "./actualApply.js", + "./applyBind": "./applyBind.js", + "./functionApply": "./functionApply.js", + "./functionCall": "./functionCall.js", + "./reflectApply": "./reflectApply.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind-apply-helpers.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind-apply-helpers/issues" + }, + "homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/for-each": "^0.3.3", + "@types/function-bind": "^1.1.10", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/call-bind-apply-helpers/reflectApply.d.ts b/node_modules/call-bind-apply-helpers/reflectApply.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b2ae764c54541ae224d93bb49e8f176260601b6 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/reflectApply.d.ts @@ -0,0 +1,3 @@ +declare const reflectApply: false | typeof Reflect.apply; + +export = reflectApply; diff --git a/node_modules/call-bind-apply-helpers/reflectApply.js b/node_modules/call-bind-apply-helpers/reflectApply.js new file mode 100644 index 0000000000000000000000000000000000000000..3d03caa695a5dd65a5aebbd2819621e757bda420 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/reflectApply.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; diff --git a/node_modules/call-bind-apply-helpers/test/index.js b/node_modules/call-bind-apply-helpers/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1cdc89ed4925c800751b44108a2e78305224d07c --- /dev/null +++ b/node_modules/call-bind-apply-helpers/test/index.js @@ -0,0 +1,63 @@ +'use strict'; + +var callBind = require('../'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +test('callBindBasic', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + // @ts-expect-error + function () { callBind([nonFunction]); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + /** @type {(this: T, a: A, b: B) => [T | undefined, A, B]} */ + var func = function (a, b) { + // eslint-disable-next-line no-invalid-this + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + + /** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */ + var bound = callBind([func]); + /** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */ + var boundR = callBind([func, sentinel]); + /** type {((b: number) => [typeof sentinel, number, typeof b])} */ + var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]); + + // @ts-expect-error + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args'); + + // @ts-expect-error + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + // @ts-expect-error + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args'); + // @ts-expect-error + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + // @ts-expect-error + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + + // @ts-expect-error + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + // @ts-expect-error + t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + // @ts-expect-error + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + // @ts-expect-error + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.end(); +}); diff --git a/node_modules/call-bind-apply-helpers/tsconfig.json b/node_modules/call-bind-apply-helpers/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..aef9993084c3643257b6d6aea21f76017caf92a7 --- /dev/null +++ b/node_modules/call-bind-apply-helpers/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} \ No newline at end of file diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..404abb22121cdcbb710c56f4ba2684789cb2868c --- /dev/null +++ b/node_modules/call-bind/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..dfa9a6cdcf03e3f611cb91a59c68327d040a5d58 --- /dev/null +++ b/node_modules/call-bind/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-magic-numbers": 0, + }, +} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..c70c2ecdb216df098ffbaba7773e6d8cf52e9bf3 --- /dev/null +++ b/node_modules/call-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind/.nycrc b/node_modules/call-bind/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/call-bind/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..4eeae09ec590e2c22059b2af9a680fd2cf3c27b4 --- /dev/null +++ b/node_modules/call-bind/CHANGELOG.md @@ -0,0 +1,115 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.9](https://github.com/ljharb/call-bind/compare/v1.0.8...v1.0.9) - 2026-04-09 + +### Commits + +- [Fix] correct `.length` computation when partial args exceed function arity [`95c406d`](https://github.com/ljharb/call-bind/commit/95c406dff9e763ff840585dc6c375b0129adb248) +- [Dev Deps] update `@ljharb/eslint-config`, `es-value-fixtures`, `eslint`, `for-each`, `has-strict-mode`, `npmignore`, `object-inspect` [`06a4e21`](https://github.com/ljharb/call-bind/commit/06a4e2107ebe5411c781c8a4aab7ef34f83bc8f5) +- [Deps] update `call-bind-apply-helpers`, `es-define-property`, `get-intrinsic` [`3fea81e`](https://github.com/ljharb/call-bind/commit/3fea81e9a57a2a4bc283c20883ae72fb310a3e0e) +- [readme] replace runkit CI badge with shields.io check-runs badge [`23437d4`](https://github.com/ljharb/call-bind/commit/23437d42c9ca880feba441a23a141313d558fc30) + +## [v1.0.8](https://github.com/ljharb/call-bind/compare/v1.0.7...v1.0.8) - 2024-12-05 + +### Commits + +- [Refactor] extract out some helpers and avoid get-intrinsic usage [`407fd5e`](https://github.com/ljharb/call-bind/commit/407fd5eec34ec58394522a6ce3badfa4788fd5ae) +- [Refactor] replace code with extracted `call-bind-apply-helpers` [`81018fb`](https://github.com/ljharb/call-bind/commit/81018fb78902ff5acbc6c09300780e97f0db6a34) +- [Tests] use `set-function-length/env` [`0fc311d`](https://github.com/ljharb/call-bind/commit/0fc311de0e115cfa6b02969b23a42ad45aadf224) +- [actions] split out node 10-20, and 20+ [`77a0cad`](https://github.com/ljharb/call-bind/commit/77a0cad75f83f5b8050dc13baef4fa2cff537fa3) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `gopd`, `object-inspect`, `tape` [`a145d10`](https://github.com/ljharb/call-bind/commit/a145d10fe847f350e11094f8541848b028ee8c91) +- [Tests] replace `aud` with `npm audit` [`30ca3dd`](https://github.com/ljharb/call-bind/commit/30ca3dd7234648eb029947477d06b17879e10727) +- [Deps] update `set-function-length` [`57c79a3`](https://github.com/ljharb/call-bind/commit/57c79a3666022ea797cc2a4a3b43fe089bc97d1b) +- [Dev Deps] add missing peer dep [`601cfa5`](https://github.com/ljharb/call-bind/commit/601cfa5540066b6206039ceb9496cecbd134ff7b) + +## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12 + +### Commits + +- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03) +- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590) + +## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05 + +### Commits + +- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa) +- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5) +- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582) + +## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19 + +### Commits + +- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d) +- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871) + +## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19 + +## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19 + +### Commits + +- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453) +- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5) +- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90) +- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4) +- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11) +- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223) +- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5) +- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05) +- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329) +- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958) +- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5) +- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3) +- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91) +- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60) + +## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 + +### Commits + +- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) + +## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 + +### Commits + +- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) +- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) +- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) +- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) +- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) +- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) +- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) +- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) + +## v1.0.0 - 2020-10-30 + +### Commits + +- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) +- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) +- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) +- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) +- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) +- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) +- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) +- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) +- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..48f05d01d0acae75acada5bd42a3442d0699d067 --- /dev/null +++ b/node_modules/call-bind/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/call-bind/README.md b/node_modules/call-bind/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2d04aef611179de65e3c191c8a242286c339cea6 --- /dev/null +++ b/node_modules/call-bind/README.md @@ -0,0 +1,64 @@ +# call-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robustly `.call.bind()` a function. + +## Getting started + +```sh +npm install --save call-bind +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBind = require('call-bind'); +const callBound = require('call-bind/callBound'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBind(f); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(1, 2, 3); + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind.svg +[deps-url]: https://david-dm.org/ljharb/call-bind +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind +[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/ +[actions-image]: https://img.shields.io/github/check-runs/ljharb/call-bind/main +[actions-url]: https://github.com/ljharb/call-bind/actions diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js new file mode 100644 index 0000000000000000000000000000000000000000..8374adfd0549fef7cc678ab66089596afb7f8172 --- /dev/null +++ b/node_modules/call-bind/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c111fc0154d429df3d6ce4d623f6b2b0abd8cbba --- /dev/null +++ b/node_modules/call-bind/index.js @@ -0,0 +1,24 @@ +'use strict'; + +var setFunctionLength = require('set-function-length'); + +var $defineProperty = require('es-define-property'); + +var callBindBasic = require('call-bind-apply-helpers'); +var applyBind = require('call-bind-apply-helpers/applyBind'); + +module.exports = function callBind(originalFunction) { + var func = callBindBasic(arguments); + var adjustedLength = 1 + originalFunction.length - (arguments.length - 1); + return setFunctionLength( + func, + adjustedLength > 0 ? adjustedLength : 0, + true + ); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json new file mode 100644 index 0000000000000000000000000000000000000000..85f9d8e51655a28fcfbb487e8b1cf80ee20e5bf4 --- /dev/null +++ b/node_modules/call-bind/package.json @@ -0,0 +1,93 @@ +{ + "name": "call-bind", + "version": "1.0.9", + "description": "Robustly `.call.bind()` a function", + "main": "index.js", + "exports": { + ".": "./index.js", + "./callBound": "./callBound.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind/issues" + }, + "homepage": "https://github.com/ljharb/call-bind#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "devDependencies": { + "@ljharb/eslint-config": "^22.2.2", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "^8.57.1", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js new file mode 100644 index 0000000000000000000000000000000000000000..c32319d70d3e3f75b6c9b046666af68ed52e8ce6 --- /dev/null +++ b/node_modules/call-bind/test/callBound.js @@ -0,0 +1,54 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../callBound'); + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + // prototype function + t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8e817439ca77a8ac6ebd0b9bbcac6f8a8a5f18b2 --- /dev/null +++ b/node_modules/call-bind/test/index.js @@ -0,0 +1,82 @@ +'use strict'; + +var callBind = require('../'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +/* + * older engines have length nonconfigurable + * in io.js v3, it is configurable except on bound functions, hence the .bind() + */ +var boundFnsHaveConfigurableLengths = require('set-function-length/env').boundFnsHaveConfigurableLengths; + +test('callBind', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { callBind(nonFunction); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + var func = function (a, b) { + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + + var bound = callBind(func); + t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + + var boundR = callBind(func, sentinel); + t.equal(boundR.length, func.length, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + + var zeroLen = function () { + return [!hasStrictMode && this === global ? undefined : this]; + }; + t.equal(zeroLen.length, 0, 'zero-length function has length 0'); + + var boundZero = callBind(zeroLen, sentinel); + t.equal(boundZero.length, 0, 'zero-length function with receiver has length 0', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundZero(), [sentinel], 'zero-length bound func with receiver works'); + + var boundArg = callBind(func, sentinel, 1); + t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.test('callBind.apply', function (st) { + var aBound = callBind.apply(func); + st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); + st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + + var aBoundArg = callBind.apply(func); + st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); + st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + + var aBoundR = callBind.apply(func, sentinel); + st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); + st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); + st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/call-bound/.eslintrc b/node_modules/call-bound/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..2612ed8fefad45d3a68ae842a28e0353ebcb5cf1 --- /dev/null +++ b/node_modules/call-bound/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/node_modules/call-bound/.github/FUNDING.yml b/node_modules/call-bound/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..2a2a13571375d28b56577ad1f91bddabde753f33 --- /dev/null +++ b/node_modules/call-bound/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bound +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bound/.nycrc b/node_modules/call-bound/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/node_modules/call-bound/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/call-bound/CHANGELOG.md b/node_modules/call-bound/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..8bde4e9a56313204c5cc43fceb634a5d0c69d6ca --- /dev/null +++ b/node_modules/call-bound/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03 + +### Commits + +- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719) +- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8) + +## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15 + +### Commits + +- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be) +- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e) +- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49) +- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7) + +## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5) +- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14) +- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871) + +## v1.0.1 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d) +- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9) +- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275) +- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb) +- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8) +- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97) diff --git a/node_modules/call-bound/LICENSE b/node_modules/call-bound/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f82f38963b0d282b529f64def2bcd40be3a9a947 --- /dev/null +++ b/node_modules/call-bound/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/call-bound/README.md b/node_modules/call-bound/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a44e43e56e07b9dce55d14eba09dcbbaf2024303 --- /dev/null +++ b/node_modules/call-bound/README.md @@ -0,0 +1,53 @@ +# call-bound [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`. + +## Getting started + +```sh +npm install --save call-bound +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBound = require('call-bound'); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; +delete Array.prototype.slice; + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bound +[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg +[deps-svg]: https://david-dm.org/ljharb/call-bound.svg +[deps-url]: https://david-dm.org/ljharb/call-bound +[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bound.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bound +[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound +[actions-url]: https://github.com/ljharb/call-bound/actions diff --git a/node_modules/call-bound/index.d.ts b/node_modules/call-bound/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5562f00ed88c9b9c1ba622ef9c06a95b34d972c1 --- /dev/null +++ b/node_modules/call-bound/index.d.ts @@ -0,0 +1,94 @@ +type Intrinsic = typeof globalThis; + +type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`; + +type IntrinsicPath = IntrinsicName | `${StripPercents}.${string}` | `%${StripPercents}.${string}%`; + +type AllowMissing = boolean; + +type StripPercents = T extends `%${infer U}%` ? U : T; + +type BindMethodPrecise = + F extends (this: infer This, ...args: infer Args) => infer R + ? (obj: This, ...args: Args) => R + : F extends { + (this: infer This1, ...args: infer Args1): infer R1; + (this: infer This2, ...args: infer Args2): infer R2 + } + ? { + (obj: This1, ...args: Args1): R1; + (obj: This2, ...args: Args2): R2 + } + : never + +// Extract method type from a prototype +type GetPrototypeMethod = + (typeof globalThis)[T] extends { prototype: any } + ? M extends keyof (typeof globalThis)[T]['prototype'] + ? (typeof globalThis)[T]['prototype'][M] + : never + : never + +// Get static property/method +type GetStaticMember = + P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never + +// Type that maps string path to actual bound function or value with better precision +type BoundIntrinsic = + S extends `${infer Obj}.prototype.${infer Method}` + ? Obj extends keyof typeof globalThis + ? BindMethodPrecise> + : unknown + : S extends `${infer Obj}.${infer Prop}` + ? Obj extends keyof typeof globalThis + ? GetStaticMember + : unknown + : unknown + +declare function arraySlice(array: readonly T[], start?: number, end?: number): T[]; +declare function arraySlice(array: ArrayLike, start?: number, end?: number): T[]; +declare function arraySlice(array: IArguments, start?: number, end?: number): T[]; + +// Special cases for methods that need explicit typing +interface SpecialCases { + '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean; + '%String.prototype.replace%': { + (str: string, searchValue: string | RegExp, replaceValue: string): string; + (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string + }; + '%Object.prototype.toString%': (obj: {}) => string; + '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean; + '%Array.prototype.slice%': typeof arraySlice; + '%Array.prototype.map%': (array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[]; + '%Array.prototype.filter%': (array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[]; + '%Array.prototype.indexOf%': (array: readonly T[], searchElement: T, fromIndex?: number) => number; + '%Function.prototype.apply%': (fn: (...args: A) => R, thisArg: any, args: A) => R; + '%Function.prototype.call%': (fn: (...args: A) => R, thisArg: any, ...args: A) => R; + '%Function.prototype.bind%': (fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R; + '%Promise.prototype.then%': { + (promise: Promise, onfulfilled: (value: T) => R | PromiseLike): Promise; + (promise: Promise, onfulfilled: ((value: T) => R | PromiseLike) | undefined | null, onrejected: (reason: any) => R | PromiseLike): Promise; + }; + '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean; + '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null; + '%Error.prototype.toString%': (error: Error) => string; + '%TypeError.prototype.toString%': (error: TypeError) => string; + '%String.prototype.split%': ( + obj: unknown, + splitter: string | RegExp | { + [Symbol.split](string: string, limit?: number): string[]; + }, + limit?: number | undefined + ) => string[]; +} + +/** + * Returns a bound function for a prototype method, or a value for a static property. + * + * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice') + * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false) + */ +declare function callBound, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents}%`]; +declare function callBound, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic; + +export = callBound; diff --git a/node_modules/call-bound/index.js b/node_modules/call-bound/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e9ade749d90b7eb0eebdb0626c0f22355c833389 --- /dev/null +++ b/node_modules/call-bound/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBindBasic = require('call-bind-apply-helpers'); + +/** @type {(thisArg: string, searchString: string, position?: number) => number} */ +var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); + +/** @type {import('.')} */ +module.exports = function callBoundIntrinsic(name, allowMissing) { + /* eslint no-extra-parens: 0 */ + + var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBindBasic(/** @type {const} */ ([intrinsic])); + } + return intrinsic; +}; diff --git a/node_modules/call-bound/package.json b/node_modules/call-bound/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d542db430ed3b58551bbfa688d47c591e9150cb7 --- /dev/null +++ b/node_modules/call-bound/package.json @@ -0,0 +1,99 @@ +{ + "name": "call-bound", + "version": "1.0.4", + "description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bound.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bound/issues" + }, + "homepage": "https://github.com/ljharb/call-bound#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.3.0", + "@types/call-bind": "^1.0.5", + "@types/get-intrinsic": "^1.2.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "gopd": "^1.2.0", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/call-bound/test/index.js b/node_modules/call-bound/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a2fc9f0f2286539446cb61339c6c8d837275b1c2 --- /dev/null +++ b/node_modules/call-bound/test/index.js @@ -0,0 +1,61 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../'); + +/** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */ + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + var x = callBound('Object.prototype.toString'); + var y = callBound('%Object.prototype.toString%'); + + // prototype function + t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + // @ts-expect-error + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + // @ts-expect-error + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/call-bound/tsconfig.json b/node_modules/call-bound/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..8976d98b8e07a7672dabcca3d68e6852d8462d5e --- /dev/null +++ b/node_modules/call-bound/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ESNext", + "lib": ["es2024"], + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/callsites/index.d.ts b/node_modules/callsites/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61f597cf5beeb066b6ee4d084f9097223e417460 --- /dev/null +++ b/node_modules/callsites/index.d.ts @@ -0,0 +1,96 @@ +declare namespace callsites { + interface CallSite { + /** + Returns the value of `this`. + */ + getThis(): unknown | undefined; + + /** + Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. + */ + getTypeName(): string | null; + + /** + Returns the current function. + */ + getFunction(): Function | undefined; + + /** + Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + Returns the name of the property of `this` or one of its prototypes that holds the current function. + */ + getMethodName(): string | undefined; + + /** + Returns the name of the script if this function was defined in a script. + */ + getFileName(): string | null; + + /** + Returns the current line number if this function was defined in a script. + */ + getLineNumber(): number | null; + + /** + Returns the current column number if this function was defined in a script. + */ + getColumnNumber(): number | null; + + /** + Returns a string representing the location where `eval` was called if this function was created using a call to `eval`. + */ + getEvalOrigin(): string | undefined; + + /** + Returns `true` if this is a top-level invocation, that is, if it's a global object. + */ + isToplevel(): boolean; + + /** + Returns `true` if this call takes place in code defined by a call to `eval`. + */ + isEval(): boolean; + + /** + Returns `true` if this call is in native V8 code. + */ + isNative(): boolean; + + /** + Returns `true` if this is a constructor call. + */ + isConstructor(): boolean; + } +} + +declare const callsites: { + /** + Get callsites from the V8 stack trace API. + + @returns An array of `CallSite` objects. + + @example + ``` + import callsites = require('callsites'); + + function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' + } + + unicorn(); + ``` + */ + (): callsites.CallSite[]; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function callsites(): callsites.CallSite[]; + // export = callsites; + default: typeof callsites; +}; + +export = callsites; diff --git a/node_modules/callsites/index.js b/node_modules/callsites/index.js new file mode 100644 index 0000000000000000000000000000000000000000..486c2410479cde342624eceaa1e0b1deca9317eb --- /dev/null +++ b/node_modules/callsites/index.js @@ -0,0 +1,13 @@ +'use strict'; + +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.default = callsites; diff --git a/node_modules/callsites/license b/node_modules/callsites/license new file mode 100644 index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89 --- /dev/null +++ b/node_modules/callsites/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/callsites/package.json b/node_modules/callsites/package.json new file mode 100644 index 0000000000000000000000000000000000000000..93463c34b25dab3a11fcb6522825789395fb624c --- /dev/null +++ b/node_modules/callsites/package.json @@ -0,0 +1,39 @@ +{ + "name": "callsites", + "version": "3.1.0", + "description": "Get callsites from the V8 stack trace API", + "license": "MIT", + "repository": "sindresorhus/callsites", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/callsites/readme.md b/node_modules/callsites/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..fc846138f4a80d237fbe14a49bd7beef6510a711 --- /dev/null +++ b/node_modules/callsites/readme.md @@ -0,0 +1,48 @@ +# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites) + +> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api) + + +## Install + +``` +$ npm install callsites +``` + + +## Usage + +```js +const callsites = require('callsites'); + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' +} + +unicorn(); +``` + + +## API + +Returns an array of callsite objects with the following methods: + +- `getThis`: returns the value of `this`. +- `getTypeName`: returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. +- `getFunction`: returns the current function. +- `getFunctionName`: returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. +- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function. +- `getFileName`: if this function was defined in a script returns the name of the script. +- `getLineNumber`: if this function was defined in a script returns the current line number. +- `getColumnNumber`: if this function was defined in a script returns the current column number +- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called. +- `isToplevel`: is this a top-level invocation, that is, is this the global object? +- `isEval`: does this call take place in code defined by a call to `eval`? +- `isNative`: is this call in native V8 code? +- `isConstructor`: is this a constructor call? + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/camelcase-css/README.md b/node_modules/camelcase-css/README.md new file mode 100644 index 0000000000000000000000000000000000000000..caaa817f918bcd0857c5f1b35af656e195cbe06b --- /dev/null +++ b/node_modules/camelcase-css/README.md @@ -0,0 +1,27 @@ +# camelcase-css [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] + +> Convert a kebab-cased CSS property into a camelCased DOM property. + + +## Installation +[Node.js](http://nodejs.org/) `>= 6` is required. Type this at the command line: +```shell +npm install camelcase-css +``` + + +## Usage +```js +const camelCaseCSS = require('camelcase-css'); + +camelCaseCSS('-webkit-border-radius'); //-> WebkitBorderRadius +camelCaseCSS('-moz-border-radius'); //-> MozBorderRadius +camelCaseCSS('-ms-border-radius'); //-> msBorderRadius +camelCaseCSS('border-radius'); //-> borderRadius +``` + + +[npm-image]: https://img.shields.io/npm/v/camelcase-css.svg +[npm-url]: https://npmjs.org/package/camelcase-css +[travis-image]: https://img.shields.io/travis/stevenvachon/camelcase-css.svg +[travis-url]: https://travis-ci.org/stevenvachon/camelcase-css diff --git a/node_modules/camelcase-css/index-es5.js b/node_modules/camelcase-css/index-es5.js new file mode 100644 index 0000000000000000000000000000000000000000..48ef078122a9123166e29e370634f7487803fb6b --- /dev/null +++ b/node_modules/camelcase-css/index-es5.js @@ -0,0 +1,24 @@ +"use strict"; + +var pattern = /-(\w|$)/g; + +var callback = function callback(dashChar, char) { + return char.toUpperCase(); +}; + +var camelCaseCSS = function camelCaseCSS(property) { + property = property.toLowerCase(); + + // NOTE :: IE8's "styleFloat" is intentionally not supported + if (property === "float") { + return "cssFloat"; + } + // Microsoft vendor-prefixes are uniquely cased + else if (property.charCodeAt(0) === 45&& property.charCodeAt(1) === 109&& property.charCodeAt(2) === 115&& property.charCodeAt(3) === 45) { + return property.substr(1).replace(pattern, callback); + } else { + return property.replace(pattern, callback); + } +}; + +module.exports = camelCaseCSS; diff --git a/node_modules/camelcase-css/index.js b/node_modules/camelcase-css/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c9d1f1b662dd35ede8e879b02d33c6da51a1022a --- /dev/null +++ b/node_modules/camelcase-css/index.js @@ -0,0 +1,30 @@ +"use strict"; +const pattern = /-(\w|$)/g; + +const callback = (dashChar, char) => char.toUpperCase(); + + + +const camelCaseCSS = property => +{ + property = property.toLowerCase(); + + // NOTE :: IE8's "styleFloat" is intentionally not supported + if (property === "float") + { + return "cssFloat"; + } + // Microsoft vendor-prefixes are uniquely cased + else if (property.startsWith("-ms-")) + { + return property.substr(1).replace(pattern, callback); + } + else + { + return property.replace(pattern, callback); + } +}; + + + +module.exports = camelCaseCSS; diff --git a/node_modules/camelcase-css/license b/node_modules/camelcase-css/license new file mode 100644 index 0000000000000000000000000000000000000000..b760007aedf42ef8a6ef5566dc373def2feb6504 --- /dev/null +++ b/node_modules/camelcase-css/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Steven Vachon (svachon.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/camelcase-css/package.json b/node_modules/camelcase-css/package.json new file mode 100644 index 0000000000000000000000000000000000000000..61dc51a8017e349403fd97011ac239ca98797270 --- /dev/null +++ b/node_modules/camelcase-css/package.json @@ -0,0 +1,34 @@ +{ + "name": "camelcase-css", + "description": "Convert a kebab-cased CSS property into a camelCased DOM property.", + "version": "2.0.1", + "license": "MIT", + "author": "Steven Vachon (https://www.svachon.com/)", + "repository": "stevenvachon/camelcase-css", + "browser": "index-es5.js", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-plugin-optimize-starts-with": "^1.0.1", + "babel-preset-env": "^1.7.0", + "chai": "^4.1.2", + "mocha": "^5.2.0" + }, + "engines": { + "node": ">= 6" + }, + "scripts": { + "pretest": "babel index.js --out-file=index-es5.js --presets=env --plugins=optimize-starts-with", + "test": "mocha test.js --check-leaks --bail" + }, + "files": [ + "index.js", + "index-es5.js" + ], + "keywords": [ + "camelcase", + "case", + "css", + "dom" + ] +} diff --git a/node_modules/camelcase/index.d.ts b/node_modules/camelcase/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58f2069adc52b8411087314385132d20a4d5d8c5 --- /dev/null +++ b/node_modules/camelcase/index.d.ts @@ -0,0 +1,63 @@ +declare namespace camelcase { + interface Options { + /** + Uppercase the first character: `foo-bar` → `FooBar`. + + @default false + */ + readonly pascalCase?: boolean; + } +} + +declare const camelcase: { + /** + Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. + + @param input - String to convert to camel case. + + @example + ``` + import camelCase = require('camelcase'); + + camelCase('foo-bar'); + //=> 'fooBar' + + camelCase('foo_bar'); + //=> 'fooBar' + + camelCase('Foo-Bar'); + //=> 'fooBar' + + camelCase('Foo-Bar', {pascalCase: true}); + //=> 'FooBar' + + camelCase('--foo.bar', {pascalCase: false}); + //=> 'fooBar' + + camelCase('foo bar'); + //=> 'fooBar' + + console.log(process.argv[3]); + //=> '--foo-bar' + camelCase(process.argv[3]); + //=> 'fooBar' + + camelCase(['foo', 'bar']); + //=> 'fooBar' + + camelCase(['__foo__', '--bar'], {pascalCase: true}); + //=> 'FooBar' + ``` + */ + (input: string | ReadonlyArray, options?: camelcase.Options): string; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function camelcase( + // input: string | ReadonlyArray, + // options?: camelcase.Options + // ): string; + // export = camelcase; + default: typeof camelcase; +}; + +export = camelcase; diff --git a/node_modules/camelcase/index.js b/node_modules/camelcase/index.js new file mode 100644 index 0000000000000000000000000000000000000000..579f99b47f772aa47b7e683069987b9299411f09 --- /dev/null +++ b/node_modules/camelcase/index.js @@ -0,0 +1,76 @@ +'use strict'; + +const preserveCamelCase = string => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + + if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) { + string = string.slice(0, i) + '-' + string.slice(i); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + i++; + } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) { + string = string.slice(0, i - 1) + '-' + string.slice(i - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character; + } + } + + return string; +}; + +const camelCase = (input, options) => { + if (!(typeof input === 'string' || Array.isArray(input))) { + throw new TypeError('Expected the input to be `string | string[]`'); + } + + options = Object.assign({ + pascalCase: false + }, options); + + const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x; + + if (Array.isArray(input)) { + input = input.map(x => x.trim()) + .filter(x => x.length) + .join('-'); + } else { + input = input.trim(); + } + + if (input.length === 0) { + return ''; + } + + if (input.length === 1) { + return options.pascalCase ? input.toUpperCase() : input.toLowerCase(); + } + + const hasUpperCase = input !== input.toLowerCase(); + + if (hasUpperCase) { + input = preserveCamelCase(input); + } + + input = input + .replace(/^[_.\- ]+/, '') + .toLowerCase() + .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()) + .replace(/\d+(\w|$)/g, m => m.toUpperCase()); + + return postProcess(input); +}; + +module.exports = camelCase; +// TODO: Remove this for the next major release +module.exports.default = camelCase; diff --git a/node_modules/camelcase/license b/node_modules/camelcase/license new file mode 100644 index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89 --- /dev/null +++ b/node_modules/camelcase/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/camelcase/package.json b/node_modules/camelcase/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fbdbaaa75651d6ca23908caa68a9c75e8a60952c --- /dev/null +++ b/node_modules/camelcase/package.json @@ -0,0 +1,43 @@ +{ + "name": "camelcase", + "version": "5.3.1", + "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", + "license": "MIT", + "repository": "sindresorhus/camelcase", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/camelcase/readme.md b/node_modules/camelcase/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..fde27261b2a823b6b6a4601025da513061eb217e --- /dev/null +++ b/node_modules/camelcase/readme.md @@ -0,0 +1,99 @@ +# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +--- + +
+ + Get professional support for 'camelcase' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install camelcase +``` + + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' +``` + + +## API + +### camelCase(input, [options]) + +#### input + +Type: `string` `string[]` + +String to convert to camel case. + +#### options + +Type: `Object` + +##### pascalCase + +Type: `boolean`
+Default: `false` + +Uppercase the first character: `foo-bar` → `FooBar` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase +- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string +- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/caniuse-lite/LICENSE b/node_modules/caniuse-lite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..06c608dcf4552094bc86dc48aaa90addb2886049 --- /dev/null +++ b/node_modules/caniuse-lite/LICENSE @@ -0,0 +1,395 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/node_modules/caniuse-lite/README.md b/node_modules/caniuse-lite/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7c3440f2cedd142e9b4d2548c2df0c5a696919b7 --- /dev/null +++ b/node_modules/caniuse-lite/README.md @@ -0,0 +1,3 @@ +# caniuse-lite + +A smaller version of caniuse-db, with only the essentials! diff --git a/node_modules/caniuse-lite/data/agents.js b/node_modules/caniuse-lite/data/agents.js new file mode 100644 index 0000000000000000000000000000000000000000..15b37a996701d93d8989c43a580b7aafd91888a2 --- /dev/null +++ b/node_modules/caniuse-lite/data/agents.js @@ -0,0 +1 @@ +module.exports={A:{A:{L:0,D:0,E:0,F:0,A:0,B:0.266336,AD:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AD","L","D","E","F","A","B","","",""],E:"IE",F:{AD:962323200,L:998870400,D:1161129600,E:1237420800,F:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0,"1":0,"2":0,"3":0.179088,"4":0.18368,"5":0,"6":0.009184,"7":0,"8":0,"9":0,C:0,M:0,N:0,G:0,O:0,P:0,Q:0,R:0,H:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0.009184,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0.027552,u:0,v:0,w:0,x:0,y:0.004592,z:0,AB:0,BB:0,NB:0,OB:0,PB:0,CB:0.013776,QB:0,RB:0.004592,SB:0.004592,TB:0.009184,UB:0.004592,VB:0.004592,WB:0.009184,XB:0.009184,YB:0.009184,ZB:0.009184,aB:0.009184,bB:0.013776,cB:0.013776,dB:0.013776,eB:0.018368,fB:0.059696,gB:0.055104,hB:0.821968,iB:3.58635,I:0.004592},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","M","N","G","O","P","Q","R","H","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","NB","OB","PB","CB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","I","","",""],E:"Edge",F:{"0":1692576000,"1":1694649600,"2":1697155200,"3":1698969600,"4":1701993600,"5":1706227200,"6":1708732800,"7":1711152000,"8":1713398400,"9":1715990400,C:1438128000,M:1447286400,N:1470096000,G:1491868800,O:1508198400,P:1525046400,Q:1542067200,R:1579046400,H:1581033600,S:1586736000,T:1590019200,U:1594857600,V:1598486400,W:1602201600,X:1605830400,Y:1611360000,Z:1614816000,a:1618358400,b:1622073600,c:1626912000,d:1630627200,e:1632441600,f:1634774400,g:1637539200,h:1641427200,i:1643932800,j:1646265600,k:1649635200,l:1651190400,m:1653955200,n:1655942400,o:1659657600,p:1661990400,q:1664755200,r:1666915200,s:1670198400,t:1673481600,u:1675900800,v:1678665600,w:1680825600,x:1683158400,y:1685664000,z:1689897600,AB:1718841600,BB:1721865600,NB:1724371200,OB:1726704000,PB:1729123200,CB:1731542400,QB:1737417600,RB:1740614400,SB:1741219200,TB:1743984000,UB:1746316800,VB:1748476800,WB:1750896000,XB:1754611200,YB:1756944000,ZB:1759363200,aB:1761868800,bB:1764806400,cB:1768780800,dB:1770854400,eB:1773446400,fB:1775692800,gB:1778112000,hB:1780531200,iB:1782950400,I:1785369600},D:{C:"ms",M:"ms",N:"ms",G:"ms",O:"ms",P:"ms",Q:"ms"}},C:{A:{"0":0,"1":0,"2":0,"3":0,"4":0.174496,"5":0.348992,"6":0,"7":0,"8":0,"9":0.059696,BD:0,cC:0,J:0,jB:0.009184,L:0,D:0,E:0,F:0,A:0,B:0,C:0,M:0,N:0,G:0,O:0,P:0,Q:0,kB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,K:0,KB:0,LB:0,MB:0,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0.004592,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,dC:0,DC:0,eC:0,EC:0,FC:0,GC:0,HC:0,IC:0,JC:0,KC:0,LC:0,MC:0,NC:0,OC:0,PC:0,QC:0,RC:0,SC:0,TC:0,UC:0.004592,R:0,H:0,S:0,fC:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:0,x:0.004592,y:0,z:0.119392,AB:0.059696,BB:0.064288,NB:0.050512,OB:0.036736,PB:0.059696,CB:0.064288,QB:0.059696,RB:0.06888,SB:0.041328,TB:0.13776,UB:0.078064,VB:0,WB:0,XB:0,YB:0.06888,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0.004592,fB:0.009184,gB:0.009184,hB:0.009184,iB:0.027552,I:0.036736,gC:0.982688,VC:0.29848,hC:0,CD:0,DD:0,ED:0,FD:0,GD:0},B:"moz",C:["BD","cC","FD","GD","J","jB","L","D","E","F","A","B","C","M","N","G","O","P","Q","kB","DB","EB","FB","GB","HB","IB","JB","K","KB","LB","MB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","dC","DC","eC","EC","FC","GC","HC","IC","JC","KC","LC","MC","NC","OC","PC","QC","RC","SC","TC","UC","R","H","S","fC","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","NB","OB","PB","CB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","I","gC","VC","hC","CD","DD","ED"],E:"Firefox",F:{"0":1690848000,"1":1693267200,"2":1695686400,"3":1698105600,"4":1700524800,"5":1702944000,"6":1705968000,"7":1708387200,"8":1710806400,"9":1713225600,BD:1161648000,cC:1213660800,FD:1246320000,GD:1264032000,J:1300752000,jB:1308614400,L:1313452800,D:1317081600,E:1317081600,F:1320710400,A:1324339200,B:1327968000,C:1331596800,M:1335225600,N:1338854400,G:1342483200,O:1346112000,P:1349740800,Q:1353628800,kB:1357603200,DB:1361232000,EB:1364860800,FB:1368489600,GB:1372118400,HB:1375747200,IB:1379376000,JB:1386633600,K:1391472000,KB:1395100800,LB:1398729600,MB:1402358400,lB:1405987200,mB:1409616000,nB:1413244800,oB:1417392000,pB:1421107200,qB:1424736000,rB:1428278400,sB:1431475200,tB:1435881600,uB:1439251200,vB:1442880000,wB:1446508800,xB:1450137600,yB:1453852800,zB:1457395200,"0B":1461628800,"1B":1465257600,"2B":1470096000,"3B":1474329600,"4B":1479168000,"5B":1485216000,"6B":1488844800,"7B":1492560000,"8B":1497312000,"9B":1502150400,AC:1506556800,BC:1510617600,CC:1516665600,dC:1520985600,DC:1525824000,eC:1529971200,EC:1536105600,FC:1540252800,GC:1544486400,HC:1548720000,IC:1552953600,JC:1558396800,KC:1562630400,LC:1567468800,MC:1571788800,NC:1575331200,OC:1578355200,PC:1581379200,QC:1583798400,RC:1586304000,SC:1588636800,TC:1591056000,UC:1593475200,R:1595894400,H:1598313600,S:1600732800,fC:1603152000,T:1605571200,U:1607990400,V:1611619200,W:1614038400,X:1616457600,Y:1618790400,Z:1622505600,a:1626134400,b:1628553600,c:1630972800,d:1633392000,e:1635811200,f:1638835200,g:1641859200,h:1644364800,i:1646697600,j:1649116800,k:1651536000,l:1653955200,m:1656374400,n:1658793600,o:1661212800,p:1663632000,q:1666051200,r:1668470400,s:1670889600,t:1673913600,u:1676332800,v:1678752000,w:1681171200,x:1683590400,y:1686009600,z:1688428800,AB:1715644800,BB:1718064000,NB:1720483200,OB:1722902400,PB:1725321600,CB:1727740800,QB:1730160000,RB:1732579200,SB:1736208000,TB:1738627200,UB:1741046400,VB:1743465600,WB:1745884800,XB:1748304000,YB:1750723200,ZB:1753142400,aB:1755561600,bB:1757980800,cB:1760400000,dB:1762819200,eB:1765238400,fB:1768262400,gB:1771891200,hB:1774310400,iB:1776729600,I:1779148800,gC:1781568000,VC:1784592000,hC:1787011200,CD:null,DD:null,ED:null}},D:{A:{"0":0.20664,"1":0.09184,"2":0.211232,"3":0.36736,"4":0.509712,"5":0.013776,"6":0.036736,"7":0.018368,"8":0.174496,"9":0.087248,J:0,jB:0,L:0,D:0,E:0,F:0,A:0,B:0,C:0,M:0,N:0,G:0,O:0,P:0,Q:0,kB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,K:0,KB:0,LB:0,MB:0,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0.02296,uB:0.02296,vB:0.02296,wB:0.02296,xB:0.02296,yB:0.02296,zB:0.02296,"0B":0.02296,"1B":0.02296,"2B":0.027552,"3B":0.027552,"4B":0.02296,"5B":0.02296,"6B":0.027552,"7B":0.02296,"8B":0.02296,"9B":0.02296,AC:0.02296,BC:0.02296,CC:0.02296,dC:0.02296,DC:0.02296,eC:0,EC:0,FC:0,GC:0,HC:0,IC:0,JC:0,KC:0,LC:0.009184,MC:0.06888,NC:0,OC:0,PC:0,QC:0,RC:0,SC:0,TC:0,UC:0,R:0.018368,H:0,S:0,T:0,U:0,V:0,W:0.004592,X:0.02296,Y:0,Z:0,a:0,b:0.009184,c:0,d:0.009184,e:0,f:0,g:0,h:0.004592,i:0.02296,j:0.004592,k:0,l:0.009184,m:0.009184,n:0.146944,o:0.087248,p:0.087248,q:0.09184,r:0.09184,s:0.096432,t:0.583184,u:0.09184,v:0.101024,w:0.09184,x:0,y:0.018368,z:0.009184,AB:0.036736,BB:0.013776,NB:0.064288,OB:0.013776,PB:0.027552,CB:0.270928,QB:0.073472,RB:0.211232,SB:0.04592,TB:0.036736,UB:0.247968,VB:0.073472,WB:0.123984,XB:0.188272,YB:0.036736,ZB:0.04592,aB:0.257152,bB:0.073472,cB:0.101024,dB:0.904624,eB:0.110208,fB:0.220416,gB:0.716352,hB:5.04202,iB:9.15645,I:0.142352,gC:0.009184,VC:0,hC:0},B:"webkit",C:["","","","","","","","","J","jB","L","D","E","F","A","B","C","M","N","G","O","P","Q","kB","DB","EB","FB","GB","HB","IB","JB","K","KB","LB","MB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","dC","DC","eC","EC","FC","GC","HC","IC","JC","KC","LC","MC","NC","OC","PC","QC","RC","SC","TC","UC","R","H","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","NB","OB","PB","CB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","I","gC","VC","hC"],E:"Chrome",F:{"0":1692057600,"1":1694476800,"2":1696896000,"3":1698710400,"4":1701993600,"5":1705968000,"6":1708387200,"7":1710806400,"8":1713225600,"9":1715644800,J:1264377600,jB:1274745600,L:1283385600,D:1287619200,E:1291248000,F:1296777600,A:1299542400,B:1303862400,C:1307404800,M:1312243200,N:1316131200,G:1316131200,O:1319500800,P:1323734400,Q:1328659200,kB:1332892800,DB:1337040000,EB:1340668800,FB:1343692800,GB:1348531200,HB:1352246400,IB:1357862400,JB:1361404800,K:1364428800,KB:1369094400,LB:1374105600,MB:1376956800,lB:1384214400,mB:1389657600,nB:1392940800,oB:1397001600,pB:1400544000,qB:1405468800,rB:1409011200,sB:1412640000,tB:1416268800,uB:1421798400,vB:1425513600,wB:1429401600,xB:1432080000,yB:1437523200,zB:1441152000,"0B":1444780800,"1B":1449014400,"2B":1453248000,"3B":1456963200,"4B":1460592000,"5B":1464134400,"6B":1469059200,"7B":1472601600,"8B":1476230400,"9B":1480550400,AC:1485302400,BC:1489017600,CC:1492560000,dC:1496707200,DC:1500940800,eC:1504569600,EC:1508198400,FC:1512518400,GC:1516752000,HC:1520294400,IC:1523923200,JC:1527552000,KC:1532390400,LC:1536019200,MC:1539648000,NC:1543968000,OC:1548720000,PC:1552348800,QC:1555977600,RC:1559606400,SC:1564444800,TC:1568073600,UC:1571702400,R:1575936000,H:1580860800,S:1586304000,T:1589846400,U:1594684800,V:1598313600,W:1601942400,X:1605571200,Y:1611014400,Z:1614556800,a:1618272000,b:1621987200,c:1626739200,d:1630368000,e:1632268800,f:1634601600,g:1637020800,h:1641340800,i:1643673600,j:1646092800,k:1648512000,l:1650931200,m:1653350400,n:1655769600,o:1659398400,p:1661817600,q:1664236800,r:1666656000,s:1669680000,t:1673308800,u:1675728000,v:1678147200,w:1680566400,x:1682985600,y:1685404800,z:1689724800,AB:1718064000,BB:1721174400,NB:1724112000,OB:1726531200,PB:1728950400,CB:1731369600,QB:1736812800,RB:1738627200,SB:1741046400,TB:1743465600,UB:1745884800,VB:1748304000,WB:1750723200,XB:1754352000,YB:1756771200,ZB:1759190400,aB:1761609600,bB:1764633600,cB:1768262400,dB:1770681600,eB:1773100800,fB:1775520000,gB:1777939200,hB:1780358400,iB:1782777600,I:1785196800,gC:null,VC:null,hC:null}},E:{A:{J:0,jB:0,L:0,D:0,E:0,F:0,A:0,B:0,C:0,M:0,N:0.004592,G:0,K:0.009184,HD:0,iC:0,ID:0,JD:0,KD:0,LD:0,jC:0,WC:0,XC:0,MD:0.013776,ND:0.018368,OD:0,kC:0,lC:0,YC:0,PD:0.064288,ZC:0,mC:0.004592,nC:0.004592,oC:0.009184,pC:0.004592,qC:0.009184,QD:0.105616,aC:0.009184,rC:0.087248,sC:0.009184,tC:0.009184,uC:0.018368,vC:0.036736,RD:0.133168,bC:0.004592,wC:0.013776,xC:0.009184,yC:0.027552,zC:0.009184,"0C":0.293888,"1C":0.013776,"2C":0.013776,"3C":0.055104,"4C":0.078064,"5C":0.050512,"6C":1.35005,"7C":0,SD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","HD","iC","J","jB","ID","L","JD","D","KD","E","F","LD","A","jC","B","WC","C","XC","M","MD","N","ND","G","OD","kC","lC","YC","PD","ZC","mC","nC","oC","pC","qC","QD","aC","rC","sC","tC","uC","vC","RD","bC","wC","xC","yC","zC","0C","1C","2C","3C","4C","5C","6C","7C","K","SD",""],E:"Safari",F:{HD:1205798400,iC:1226534400,J:1244419200,jB:1275868800,ID:1311120000,L:1343174400,JD:1382400000,D:1382400000,KD:1410998400,E:1413417600,F:1443657600,LD:1458518400,A:1474329600,jC:1490572800,B:1505779200,WC:1522281600,C:1537142400,XC:1553472000,M:1568851200,MD:1585008000,N:1600214400,ND:1619395200,G:1632096000,OD:1635292800,kC:1639353600,lC:1647216000,YC:1652745600,PD:1658275200,ZC:1662940800,mC:1666569600,nC:1670889600,oC:1674432000,pC:1679875200,qC:1684368000,QD:1690156800,aC:1695686400,rC:1698192000,sC:1702252800,tC:1705881600,uC:1709596800,vC:1715558400,RD:1722211200,bC:1726444800,wC:1730073600,xC:1733875200,yC:1737936000,zC:1743379200,"0C":1747008000,"1C":1757894400,"2C":1762128000,"3C":1762041600,"4C":1770854400,"5C":1774310400,"6C":1778457600,"7C":1785110400,K:null,SD:null}},F:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,F:0,B:0,C:0,G:0,O:0,P:0,Q:0,kB:0,DB:0,EB:0,FB:0,GB:0,HB:0,IB:0,JB:0,K:0,KB:0,LB:0,MB:0,lB:0,mB:0,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0.004592,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0,IC:0,JC:0,KC:0,LC:0,MC:0,NC:0,OC:0,PC:0,QC:0,RC:0,SC:0,TC:0,UC:0,R:0,H:0,S:0,fC:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0.027552,g:0,h:0,i:0.004592,j:0.02296,k:0.128576,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:0,x:0,y:0,z:0,AB:0,BB:0,CB:0.059696,TD:0,UD:0,VD:0,WD:0,WC:0,"8C":0,XD:0,XC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","F","TD","UD","VD","WD","B","WC","8C","XD","C","XC","G","O","P","Q","kB","DB","EB","FB","GB","HB","IB","JB","K","KB","LB","MB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","IC","JC","KC","LC","MC","NC","OC","PC","QC","RC","SC","TC","UC","R","H","S","fC","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","","",""],E:"Opera",F:{"0":1736294400,"1":1739404800,"2":1744675200,"3":1747094400,"4":1751414400,"5":1756339200,"6":1757548800,"7":1761609600,"8":1762992000,"9":1764806400,F:1150761600,TD:1223424000,UD:1251763200,VD:1267488000,WD:1277942400,B:1292457600,WC:1302566400,"8C":1309219200,XD:1323129600,C:1323129600,XC:1352073600,G:1372723200,O:1377561600,P:1381104000,Q:1386288000,kB:1390867200,DB:1393891200,EB:1399334400,FB:1401753600,GB:1405987200,HB:1409616000,IB:1413331200,JB:1417132800,K:1422316800,KB:1425945600,LB:1430179200,MB:1433808000,lB:1438646400,mB:1442448000,nB:1445904000,oB:1449100800,pB:1454371200,qB:1457308800,rB:1462320000,sB:1465344000,tB:1470096000,uB:1474329600,vB:1477267200,wB:1481587200,xB:1486425600,yB:1490054400,zB:1494374400,"0B":1498003200,"1B":1502236800,"2B":1506470400,"3B":1510099200,"4B":1515024000,"5B":1517961600,"6B":1521676800,"7B":1525910400,"8B":1530144000,"9B":1534982400,AC:1537833600,BC:1543363200,CC:1548201600,DC:1554768000,EC:1561593600,FC:1566259200,GC:1570406400,HC:1573689600,IC:1578441600,JC:1583971200,KC:1587513600,LC:1592956800,MC:1595894400,NC:1600128000,OC:1603238400,PC:1613520000,QC:1612224000,RC:1616544000,SC:1619568000,TC:1623715200,UC:1627948800,R:1631577600,H:1633392000,S:1635984000,fC:1638403200,T:1642550400,U:1644969600,V:1647993600,W:1650412800,X:1652745600,Y:1654646400,Z:1657152000,a:1660780800,b:1663113600,c:1668816000,d:1668643200,e:1671062400,f:1675209600,g:1677024000,h:1679529600,i:1681948800,j:1684195200,k:1687219200,l:1690329600,m:1692748800,n:1696204800,o:1699920000,p:1699920000,q:1702944000,r:1707264000,s:1710115200,t:1711497600,u:1716336000,v:1719273600,w:1721088000,x:1724284800,y:1727222400,z:1732665600,AB:1769990400,BB:1772064000,CB:1776124800},D:{F:"o",B:"o",C:"o",TD:"o",UD:"o",VD:"o",WD:"o",WC:"o","8C":"o",XD:"o",XC:"o"}},G:{A:{E:0,iC:0,YD:0,"9C":0.00137471,ZD:0,aD:0,bD:0.00274943,cD:0,dD:0.00137471,eD:0,fD:0,gD:0.0137471,hD:0.14572,iD:0.00274943,jD:0,kD:0.0426161,lD:0,mD:0.00137471,nD:0,oD:0.00274943,pD:0.00824828,qD:0.00962299,rD:0.0123724,kC:0.00687357,lC:0.00962299,YC:0.0109977,sD:0.230952,ZC:0.019246,mC:0.0329931,nC:0.0178713,oC:0.0371173,pC:0.00824828,qC:0.0137471,tD:0.306561,aC:0.0137471,rC:0.0178713,sC:0.0164966,tC:0.0233701,uC:0.0357426,vC:0.0728598,uD:0.178713,bC:0.0412414,wC:0.0783587,xC:0.0426161,yC:0.123724,zC:0.0563633,"0C":1.96309,"1C":0.118225,"2C":0.123724,"3C":0.343678,"4C":0.400042,"5C":0.339554,"6C":8.79954,"7C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","iC","YD","9C","ZD","aD","bD","E","cD","dD","eD","fD","gD","hD","iD","jD","kD","lD","mD","nD","oD","pD","qD","rD","kC","lC","YC","sD","ZC","mC","nC","oC","pC","qC","tD","aC","rC","sC","tC","uC","vC","uD","bC","wC","xC","yC","zC","0C","1C","2C","3C","4C","5C","6C","7C","","",""],E:"Safari on iOS",F:{iC:1270252800,YD:1283904000,"9C":1299628800,ZD:1331078400,aD:1359331200,bD:1394409600,E:1410912000,cD:1413763200,dD:1442361600,eD:1458518400,fD:1473724800,gD:1490572800,hD:1505779200,iD:1522281600,jD:1537142400,kD:1553472000,lD:1568851200,mD:1572220800,nD:1580169600,oD:1585008000,pD:1600214400,qD:1619395200,rD:1632096000,kC:1639353600,lC:1647216000,YC:1652659200,sD:1658275200,ZC:1662940800,mC:1666569600,nC:1670889600,oC:1674432000,pC:1679875200,qC:1684368000,tD:1690156800,aC:1694995200,rC:1698192000,sC:1702252800,tC:1705881600,uC:1709596800,vC:1715558400,uD:1722211200,bC:1726444800,wC:1730073600,xC:1733875200,yC:1737936000,zC:1743379200,"0C":1747008000,"1C":1757894400,"2C":1762128000,"3C":1765497600,"4C":1770854400,"5C":1774310400,"6C":1778457600,"7C":1785110400}},H:{A:{vD:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","vD","","",""],E:"Opera Mini",F:{vD:1426464000}},I:{A:{cC:0,J:0,I:0.0324156,wD:0,xD:0,yD:0,zD:0.0000032448,"9C":0,"0D":0,"1D":0.0000129792},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","wD","xD","yD","cC","J","zD","9C","0D","1D","I","","",""],E:"Android Browser",F:{wD:1256515200,xD:1274313600,yD:1291593600,cC:1298332800,J:1318896000,zD:1341792000,"9C":1374624000,"0D":1386547200,"1D":1401667200,I:1784073600}},J:{A:{D:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","A","","",""],E:"Blackberry Browser",F:{D:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,H:0.978848,WC:0,"8C":0,XC:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","WC","8C","C","XC","H","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,WC:1314835200,"8C":1318291200,C:1330300800,XC:1349740800,H:1709769600},D:{H:"webkit"}},L:{A:{I:46.3251},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","","",""],E:"Chrome for Android",F:{I:1784073600}},M:{A:{VC:0.362336},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","VC","","",""],E:"Firefox for Android",F:{VC:1784592000}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{YC:0.681408},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","YC","","",""],E:"UC Browser for Android",F:{YC:1710115200},D:{YC:"webkit"}},P:{A:{J:0,DB:0,EB:0.00684278,FB:0.00684278,GB:0.00684278,HB:0.00684278,IB:0.0136856,JB:0.0273711,K:0.0205283,KB:0.0547422,LB:0.102642,MB:1.088,"2D":0,"3D":0,"4D":0.00684278,"5D":0,"6D":0,jC:0,"7D":0,"8D":0,"9D":0,AE:0,BE:0,ZC:0,aC:0,bC:0,CE:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","J","2D","3D","4D","5D","6D","jC","7D","8D","9D","AE","BE","ZC","aC","bC","CE","DB","EB","FB","GB","HB","IB","JB","K","KB","LB","MB","","",""],E:"Samsung Internet",F:{J:1461024000,"2D":1481846400,"3D":1509408000,"4D":1528329600,"5D":1546128000,"6D":1554163200,jC:1567900800,"7D":1582588800,"8D":1593475200,"9D":1605657600,AE:1618531200,BE:1629072000,ZC:1640736000,aC:1651708800,bC:1659657600,CE:1667260800,DB:1677369600,EB:1684454400,FB:1689292800,GB:1697587200,HB:1711497600,IB:1715126400,JB:1717718400,K:1725667200,KB:1746057600,LB:1761264000,MB:1779235200}},Q:{A:{DE:0.097344},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DE","","",""],E:"QQ Browser",F:{DE:1710288000}},R:{A:{EE:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","EE","","",""],E:"Baidu Browser",F:{EE:1710201600}},S:{A:{FE:0.005408,GE:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","FE","GE","","",""],E:"KaiOS Browser",F:{FE:1527811200,GE:1631664000}}}; diff --git a/node_modules/caniuse-lite/data/browserVersions.js b/node_modules/caniuse-lite/data/browserVersions.js new file mode 100644 index 0000000000000000000000000000000000000000..c4c47d444672fcd3192bd87327bfcc867a78b031 --- /dev/null +++ b/node_modules/caniuse-lite/data/browserVersions.js @@ -0,0 +1 @@ +module.exports={"0":"116","1":"117","2":"118","3":"119","4":"120","5":"121","6":"122","7":"123","8":"124","9":"125",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"80",I:"151",J:"4",K:"27",L:"6",M:"13",N:"14",O:"16",P:"17",Q:"18",R:"79",S:"81",T:"83",U:"84",V:"85",W:"86",X:"87",Y:"88",Z:"89",a:"90",b:"91",c:"92",d:"93",e:"94",f:"95",g:"96",h:"97",i:"98",j:"99",k:"100",l:"101",m:"102",n:"103",o:"104",p:"105",q:"106",r:"107",s:"108",t:"109",u:"110",v:"111",w:"112",x:"113",y:"114",z:"115",AB:"126",BB:"127",CB:"131",DB:"20",EB:"21",FB:"22",GB:"23",HB:"24",IB:"25",JB:"26",KB:"28",LB:"29",MB:"30",NB:"128",OB:"129",PB:"130",QB:"132",RB:"133",SB:"134",TB:"135",UB:"136",VB:"137",WB:"138",XB:"139",YB:"140",ZB:"141",aB:"142",bB:"143",cB:"144",dB:"145",eB:"146",fB:"147",gB:"148",hB:"149",iB:"150",jB:"5",kB:"19",lB:"31",mB:"32",nB:"33",oB:"34",pB:"35",qB:"36",rB:"37",sB:"38",tB:"39",uB:"40",vB:"41",wB:"42",xB:"43",yB:"44",zB:"45","0B":"46","1B":"47","2B":"48","3B":"49","4B":"50","5B":"51","6B":"52","7B":"53","8B":"54","9B":"55",AC:"56",BC:"57",CC:"58",DC:"60",EC:"62",FC:"63",GC:"64",HC:"65",IC:"66",JC:"67",KC:"68",LC:"69",MC:"70",NC:"71",OC:"72",PC:"73",QC:"74",RC:"75",SC:"76",TC:"77",UC:"78",VC:"153",WC:"11.1",XC:"12.1",YC:"15.5",ZC:"16.0",aC:"17.0",bC:"18.0",cC:"3",dC:"59",eC:"61",fC:"82",gC:"152",hC:"154",iC:"3.2",jC:"10.1",kC:"15.2-15.3",lC:"15.4",mC:"16.1",nC:"16.2",oC:"16.3",pC:"16.4",qC:"16.5",rC:"17.1",sC:"17.2",tC:"17.3",uC:"17.4",vC:"17.5",wC:"18.1",xC:"18.2",yC:"18.3",zC:"18.4","0C":"18.5-18.7","1C":"26.0","2C":"26.1","3C":"26.2","4C":"26.3","5C":"26.4","6C":"26.5","7C":"26.6","8C":"11.5","9C":"4.2-4.3",AD:"5.5",BD:"2",CD:"155",DD:"156",ED:"157",FD:"3.5",GD:"3.6",HD:"3.1",ID:"5.1",JD:"6.1",KD:"7.1",LD:"9.1",MD:"13.1",ND:"14.1",OD:"15.1",PD:"15.6",QD:"16.6",RD:"17.6",SD:"TP",TD:"9.5-9.6",UD:"10.0-10.1",VD:"10.5",WD:"10.6",XD:"11.6",YD:"4.0-4.1",ZD:"5.0-5.1",aD:"6.0-6.1",bD:"7.0-7.1",cD:"8.1-8.4",dD:"9.0-9.2",eD:"9.3",fD:"10.0-10.2",gD:"10.3",hD:"11.0-11.2",iD:"11.3-11.4",jD:"12.0-12.1",kD:"12.2-12.5",lD:"13.0-13.1",mD:"13.2",nD:"13.3",oD:"13.4-13.7",pD:"14.0-14.4",qD:"14.5-14.8",rD:"15.0-15.1",sD:"15.6-15.8",tD:"16.6-16.7",uD:"17.6-17.7",vD:"all",wD:"2.1",xD:"2.2",yD:"2.3",zD:"4.1","0D":"4.4","1D":"4.4.3-4.4.4","2D":"5.0-5.4","3D":"6.2-6.4","4D":"7.2-7.4","5D":"8.2","6D":"9.2","7D":"11.1-11.2","8D":"12.0","9D":"13.0",AE:"14.0",BE:"15.0",CE:"19.0",DE:"14.9",EE:"13.52",FE:"2.5",GE:"3.0-3.1"}; diff --git a/node_modules/caniuse-lite/data/browsers.js b/node_modules/caniuse-lite/data/browsers.js new file mode 100644 index 0000000000000000000000000000000000000000..04fbb50f7fe992b33ff8cb5e472356d0085387fd --- /dev/null +++ b/node_modules/caniuse-lite/data/browsers.js @@ -0,0 +1 @@ +module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}; diff --git a/node_modules/caniuse-lite/data/features/aac.js b/node_modules/caniuse-lite/data/features/aac.js new file mode 100644 index 0000000000000000000000000000000000000000..baa4edd0f00dfe73757f0c353c0ba85045976af8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/aac.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"2":"_CF","132":"_RI"},D:{"1":"_YQ _FC","2":"_RC","16":"_A"},E:{"1":"_CB","2":"_e"},F:{"1":"_a","2":"_T"},G:{"1":"_dB","16":"iC"},H:{"2":"vD"},I:{"1":"_6B","2":"_l"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"132":"VC"},N:{"1":"A","2":"B"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"132":"_C"}},B:6,C:"AAC audio file format",D:true}; diff --git a/node_modules/caniuse-lite/data/features/abortcontroller.js b/node_modules/caniuse-lite/data/features/abortcontroller.js new file mode 100644 index 0000000000000000000000000000000000000000..07de3bfa2a2620a247670fc79dc5821c8ee468fa --- /dev/null +++ b/node_modules/caniuse-lite/data/features/abortcontroller.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_aE","2":"_3B"},C:{"1":"_H _QR","2":"_yC _3E _L"},D:{"1":"_kO","2":"_1Q"},E:{"1":"_FF","2":"_2C","130":"C WC"},F:{"1":"_TO","2":"_TR"},G:{"1":"_KC","2":"_zC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_sF","2":"_4F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:1,C:"AbortController & AbortSignal",D:true}; diff --git a/node_modules/caniuse-lite/data/features/ac3-ec3.js b/node_modules/caniuse-lite/data/features/ac3-ec3.js new file mode 100644 index 0000000000000000000000000000000000000000..1c0722b49bcc5ca3151ae6ccb4cf2b5105f0f70d --- /dev/null +++ b/node_modules/caniuse-lite/data/features/ac3-ec3.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_I","2":"_K"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_b"},G:{"2":"_2","132":"_p"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"D","132":"A"},K:{"2":"_DE H _sB","132":"XC"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:6,C:"AC-3 (Dolby Digital) and EC-3 (Dolby Digital Plus) codecs",D:false}; diff --git a/node_modules/caniuse-lite/data/features/accelerometer.js b/node_modules/caniuse-lite/data/features/accelerometer.js new file mode 100644 index 0000000000000000000000000000000000000000..27156f578eaf56c3bbb6620ee149711142a59357 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/accelerometer.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_HK","2":"_NI","194":"_FJ _mC"},E:{"2":"_R"},F:{"1":"_DM","2":"_XK"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"2":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:4,C:"Accelerometer",D:true}; diff --git a/node_modules/caniuse-lite/data/features/addeventlistener.js b/node_modules/caniuse-lite/data/features/addeventlistener.js new file mode 100644 index 0000000000000000000000000000000000000000..00d24f3d52c49b9980af09227241b447c6456bfc --- /dev/null +++ b/node_modules/caniuse-lite/data/features/addeventlistener.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","130":"_c"},B:{"1":"_J"},C:{"1":"_XL _IC","257":"_g _vB _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"EventTarget.addEventListener()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/alternate-stylesheet.js b/node_modules/caniuse-lite/data/features/alternate-stylesheet.js new file mode 100644 index 0000000000000000000000000000000000000000..844ba195c47c0afaf50b35695dc1bba901f63706 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/alternate-stylesheet.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_JC","2":"_GB"},B:{"2":"_J"},C:{"1":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"1":"_T","16":"_a"},G:{"2":"_M"},H:{"16":"vD"},I:{"2":"_O"},J:{"16":"_B"},K:{"2":"H","16":"_D"},L:{"16":"I"},M:{"16":"VC"},N:{"16":"_A"},O:{"16":"YC"},P:{"16":"_F"},Q:{"2":"DE"},R:{"16":"EE"},S:{"1":"_C"}},B:1,C:"Alternate stylesheet",D:false}; diff --git a/node_modules/caniuse-lite/data/features/ambient-light.js b/node_modules/caniuse-lite/data/features/ambient-light.js new file mode 100644 index 0000000000000000000000000000000000000000..2b01eb37e3b5470ef984d1538d9e67aff1b6d83e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/ambient-light.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_JB","132":"_ZN","322":"_K"},C:{"2":"_CF","132":"_zB _OJ dC","194":"_DS"},D:{"2":"_NI","322":"_QM"},E:{"2":"_R"},F:{"2":"_PS","322":"_bJ"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"322":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"132":"_C"}},B:4,C:"Ambient Light Sensor",D:true}; diff --git a/node_modules/caniuse-lite/data/features/apng.js b/node_modules/caniuse-lite/data/features/apng.js new file mode 100644 index 0000000000000000000000000000000000000000..d263a10d8a1d3cded5f34686d510645598035ddb --- /dev/null +++ b/node_modules/caniuse-lite/data/features/apng.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_cD","2":"BD"},D:{"1":"_BS","2":"_HJ"},E:{"1":"_bL","2":"_rH"},F:{"1":"_tM _pH _PD _P","2":"F _8D _uD"},G:{"1":"_7B","2":"_DB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_wB","2":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Animated PNG (APNG)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/array-find-index.js b/node_modules/caniuse-lite/data/features/array-find-index.js new file mode 100644 index 0000000000000000000000000000000000000000..405a1a66166488bd2753e77ecdde99848190393b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/array-find-index.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_HO","2":"_VK"},D:{"1":"_GK","2":"_6J"},E:{"1":"_VI","2":"_4C"},F:{"1":"_BK","2":"_TM"},G:{"1":"_7B","2":"_DB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"D","16":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"Array.prototype.findIndex",D:true}; diff --git a/node_modules/caniuse-lite/data/features/array-find.js b/node_modules/caniuse-lite/data/features/array-find.js new file mode 100644 index 0000000000000000000000000000000000000000..37c66d482f86314b1f656af56d4f78a575834049 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/array-find.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_SE","16":"_v"},C:{"1":"_HO","2":"_VK"},D:{"1":"_GK","2":"_6J"},E:{"1":"_VI","2":"_4C"},F:{"1":"_BK","2":"_TM"},G:{"1":"_7B","2":"_DB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"D","16":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"Array.prototype.find",D:true}; diff --git a/node_modules/caniuse-lite/data/features/array-flat.js b/node_modules/caniuse-lite/data/features/array-flat.js new file mode 100644 index 0000000000000000000000000000000000000000..a8a9c6d8cc8ef19b647056c9f9b953ec77e9383a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/array-flat.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_TL","2":"_m _L"},D:{"1":"_sO","2":"_2Q"},E:{"1":"_BI","2":"_ER"},F:{"1":"_uP _sN","2":"_aF _TE _P"},G:{"1":"_VJ","2":"_JI"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_9E","2":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:6,C:"flat & flatMap array methods",D:true}; diff --git a/node_modules/caniuse-lite/data/features/array-includes.js b/node_modules/caniuse-lite/data/features/array-includes.js new file mode 100644 index 0000000000000000000000000000000000000000..fca594b3c0d005117129b472fe40d53cda3705de --- /dev/null +++ b/node_modules/caniuse-lite/data/features/array-includes.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_zD","2":"_JB"},C:{"1":"_aQ","2":"_YO"},D:{"1":"_eO","2":"_xN"},E:{"1":"_PB","2":"_TB"},F:{"1":"_SO","2":"_8O"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"Array.prototype.includes",D:true}; diff --git a/node_modules/caniuse-lite/data/features/arrow-functions.js b/node_modules/caniuse-lite/data/features/arrow-functions.js new file mode 100644 index 0000000000000000000000000000000000000000..ca9064ca0b28a198cb9e476b445277e7100b6077 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/arrow-functions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_RI","2":"_CF"},D:{"1":"_GK","2":"_6J"},E:{"1":"_LB","2":"_SB"},F:{"1":"_BK","2":"_TM"},G:{"1":"_8","2":"_OB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"Arrow functions",D:true}; diff --git a/node_modules/caniuse-lite/data/features/asmjs.js b/node_modules/caniuse-lite/data/features/asmjs.js new file mode 100644 index 0000000000000000000000000000000000000000..5684132887d3456c76dc5957c6dcb18254e1d931 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/asmjs.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_hQ","132":"_K","322":"C"},C:{"1":"_RI","2":"_CF"},D:{"2":"_lJ","132":"_gO"},E:{"2":"_R"},F:{"2":"_T","132":"_a"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_G","132":"I"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"132":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"132":"YC"},P:{"2":"J","132":"_U"},Q:{"132":"DE"},R:{"132":"EE"},S:{"1":"_C"}},B:6,C:"asm.js",D:true}; diff --git a/node_modules/caniuse-lite/data/features/async-clipboard.js b/node_modules/caniuse-lite/data/features/async-clipboard.js new file mode 100644 index 0000000000000000000000000000000000000000..7c416637ecceae80ee96a34df10ae35ce6d88d4e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/async-clipboard.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"9 _uH","2":"_wL","132":"_lG _bI _MU _JD _UC"},D:{"1":"_kO","2":"_1Q"},E:{"1":"_cE","2":"_KI"},F:{"1":"_TO","2":"_TR"},G:{"1":"_tH","2":"_7N"},H:{"2":"vD"},I:{"2":"_G","260":"I"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_NB","2":"_4F","260":"_HH _QU"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"FE","132":"GE"}},B:5,C:"Asynchronous Clipboard API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/async-functions.js b/node_modules/caniuse-lite/data/features/async-functions.js new file mode 100644 index 0000000000000000000000000000000000000000..a6c38d932396b063b0e0ad036d01af97af5d5a4c --- /dev/null +++ b/node_modules/caniuse-lite/data/features/async-functions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_SE","2":"_JB","194":"N"},C:{"1":"_CM","2":"_2J"},D:{"1":"_WL","2":"_BO"},E:{"1":"_oB","2":"_QB","258":"jC"},F:{"1":"_TI","2":"_MM"},G:{"1":"_AB","2":"_hB","258":"gD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_gB","2":"_qC"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:6,C:"Async functions",D:true}; diff --git a/node_modules/caniuse-lite/data/features/atob-btoa.js b/node_modules/caniuse-lite/data/features/atob-btoa.js new file mode 100644 index 0000000000000000000000000000000000000000..16473a3a59b9ff426b7dca1d101cc5bbd801d1ea --- /dev/null +++ b/node_modules/caniuse-lite/data/features/atob-btoa.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_zF","2":"_eB","16":"VD"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_BB","16":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Base64 encoding and decoding",D:true}; diff --git a/node_modules/caniuse-lite/data/features/audio-api.js b/node_modules/caniuse-lite/data/features/audio-api.js new file mode 100644 index 0000000000000000000000000000000000000000..96ab47a181d216d5c951707054e7103aefcf8025 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/audio-api.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_HO","2":"_VK"},D:{"1":"_CN _TG","2":"_4E","33":"N _uK"},E:{"1":"_vF","2":"_s","33":"_dC _yB _OE"},F:{"1":"_aG _uB","2":"_T","33":"_dH"},G:{"1":"_IE","2":"_1","33":"_QD _YR"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"Web Audio API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/audio.js b/node_modules/caniuse-lite/data/features/audio.js new file mode 100644 index 0000000000000000000000000000000000000000..01a46f8bf73f678df94b6e5b5e2b5213b4989b99 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/audio.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_cO","2":"_g","132":"_qG _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_aD","2":"F","4":"_jK"},G:{"260":"_M"},H:{"2":"vD"},I:{"1":"_RB","2":"_k"},J:{"1":"_B"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Audio element",D:true}; diff --git a/node_modules/caniuse-lite/data/features/audiotracks.js b/node_modules/caniuse-lite/data/features/audiotracks.js new file mode 100644 index 0000000000000000000000000000000000000000..31efe41c010c3ef85709310a82f8ef0ff920f2b3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/audiotracks.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_I","322":"_K"},C:{"2":"_ZI","194":"_mO"},D:{"2":"_6J","322":"_GK"},E:{"1":"_iB","2":"_3C"},F:{"2":"_TM","322":"_BK"},G:{"1":"_z","2":"_o"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_D","322":"H"},L:{"322":"I"},M:{"2":"VC"},N:{"1":"_A"},O:{"322":"YC"},P:{"2":"_F"},Q:{"322":"DE"},R:{"322":"EE"},S:{"194":"_C"}},B:1,C:"Audio Tracks",D:true}; diff --git a/node_modules/caniuse-lite/data/features/autofocus.js b/node_modules/caniuse-lite/data/features/autofocus.js new file mode 100644 index 0000000000000000000000000000000000000000..6d0c26a01d8b122bb4710e60825be832114acd2c --- /dev/null +++ b/node_modules/caniuse-lite/data/features/autofocus.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_x","2":"_f"},D:{"1":"_0D","2":"J"},E:{"1":"_mB","2":"_i"},F:{"1":"_nB","2":"F"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"_6B","2":"_l"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:1,C:"Autofocus attribute",D:true}; diff --git a/node_modules/caniuse-lite/data/features/auxclick.js b/node_modules/caniuse-lite/data/features/auxclick.js new file mode 100644 index 0000000000000000000000000000000000000000..9f8eec44341d7f20492d0e3c2208ea071919ea6c --- /dev/null +++ b/node_modules/caniuse-lite/data/features/auxclick.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_1J","129":"_FM"},D:{"1":"_WL","2":"_BO"},E:{"1":"_NQ","2":"_fG _oE"},F:{"1":"_TI","2":"_MM"},G:{"1":"_lL","2":"_nF _oE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:5,C:"Auxclick",D:true}; diff --git a/node_modules/caniuse-lite/data/features/av1.js b/node_modules/caniuse-lite/data/features/av1.js new file mode 100644 index 0000000000000000000000000000000000000000..2a0cc613f414d28e25e1308b5489bcdfa1b51724 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/av1.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_qH _j","2":"_sD _1F","194":"Q _wH"},C:{"1":"_uR","2":"_yC _fD _L","66":"_kD _qD","260":"HC","516":"IC"},D:{"1":"_ES","2":"_3Q","66":"_ZS LC"},E:{"2":"_zG","1028":"_2D"},F:{"1":"_H _sN","2":"_aF _3E _P"},G:{"2":"_TN","1028":"_VE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_cJ","2":"_jO"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:6,C:"AV1 video format",D:true}; diff --git a/node_modules/caniuse-lite/data/features/avif.js b/node_modules/caniuse-lite/data/features/avif.js new file mode 100644 index 0000000000000000000000000000000000000000..c198af0a783d5059a4b12157e04a6a927aadc897 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/avif.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_qH _j","2":"_CH 4 _DO","4162":"_KF _aI"},C:{"1":"_wO","2":"_m _5J _L","194":"_yP _2E _fF","257":"_kR","2049":"_AG"},D:{"1":"_LI","2":"_uJ"},E:{"1":"_RE","2":"_HR","1796":"_lI"},F:{"1":"_LK","2":"_FP"},G:{"1":"_9C","2":"_xC","1281":"_qE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:6,C:"AVIF image format",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-attachment.js b/node_modules/caniuse-lite/data/features/background-attachment.js new file mode 100644 index 0000000000000000000000000000000000000000..fa7c48f4fc419abd5d6df71506dc5f833721877f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-attachment.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","132":"_c"},B:{"1":"_J"},C:{"1":"_HO","132":"_VK"},D:{"1":"_Q"},E:{"1":"jB _rN K _SD _pL _nP _uE","132":"J M _e MD","2050":"_sH _0K"},F:{"1":"_aD","132":"_eB"},G:{"2":"_d","4100":"_5B","4868":"_rD _DJ kD","6148":"_hS _mI _YG"},H:{"2":"vD"},I:{"2":"_KG _l _w","132":"_QH"},J:{"260":"_B"},K:{"1":"_BB","132":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"2":"J","1028":"_U"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS background-attachment",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-clip-text.js b/node_modules/caniuse-lite/data/features/background-clip-text.js new file mode 100644 index 0000000000000000000000000000000000000000..0f9930fd9b09e17ce6621b8bb52fb80ea421769b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-clip-text.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_UB","33":"_v","129":"_GI","161":"_NC _wH"},C:{"1":"_wD","2":"_VM"},D:{"129":"_3G","161":"_NC _yG"},E:{"2":"HD","129":"K YC PD _uE","388":"_9I G _SD _XN lC","420":"_IQ"},F:{"2":"_T","129":"_QK","161":"_sC _BL"},G:{"129":"YC _CU","388":"_YE lC"},H:{"2":"vD"},I:{"16":"_KB","129":"I","161":"_NL"},J:{"161":"_B"},K:{"16":"_D","129":"H"},L:{"129":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"161":"YC"},P:{"1":"_NB","161":"_OM"},Q:{"161":"DE"},R:{"161":"EE"},S:{"1":"_C"}},B:7,C:"Background-clip: text",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-img-opts.js b/node_modules/caniuse-lite/data/features/background-img-opts.js new file mode 100644 index 0000000000000000000000000000000000000000..fd28d9507df9439669a79b53427815004d55d670 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-img-opts.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_x","2":"_LC","36":"GD"},D:{"1":"_WD","516":"_Y"},E:{"1":"_6C","772":"_XC"},F:{"1":"_aD","2":"_lB","36":"UD"},G:{"1":"_z","4":"_d aD","516":"ZD"},H:{"132":"vD"},I:{"1":"_X","36":"wD","516":"_BF","548":"_UQ"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS3 Background-image options",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-position-x-y.js b/node_modules/caniuse-lite/data/features/background-position-x-y.js new file mode 100644 index 0000000000000000000000000000000000000000..9a28a7617139caa25d1dfac329bd219092b6f1a9 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-position-x-y.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_E"},B:{"1":"_J"},C:{"1":"_wD","2":"_VM"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_a","2":"_T"},G:{"1":"_M"},H:{"2":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:7,C:"background-position-x & background-position-y",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-repeat-round-space.js b/node_modules/caniuse-lite/data/features/background-repeat-round-space.js new file mode 100644 index 0000000000000000000000000000000000000000..990d0aa16e87a0510f19deb30464411029c442dc --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-repeat-round-space.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_c","132":"F"},B:{"1":"_J"},C:{"1":"_wD","2":"_VM"},D:{"1":"_PO","2":"_hL"},E:{"1":"_6C","2":"_XC"},F:{"1":"_tM _cF _xK","2":"F _UB _jK"},G:{"1":"_z","2":"_o"},H:{"1":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"CSS background-repeat round and space",D:true}; diff --git a/node_modules/caniuse-lite/data/features/background-sync.js b/node_modules/caniuse-lite/data/features/background-sync.js new file mode 100644 index 0000000000000000000000000000000000000000..aa7be61b5b69df657754d533891f1f1cf9c8352f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/background-sync.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_oC _rE _L","16":"_SF"},D:{"1":"_bE","2":"_sG"},E:{"2":"_R"},F:{"1":"_TI","2":"_MM"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:7,C:"Background Sync API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/battery-status.js b/node_modules/caniuse-lite/data/features/battery-status.js new file mode 100644 index 0000000000000000000000000000000000000000..02b0b7c46117b3cd7557fe11eccad88d07f1b746 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/battery-status.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_fJ","2":"_H _VU _lC _kD _xE","132":"_1L _7D","164":"_FO"},D:{"1":"_7J","2":"_CK","66":"rB"},E:{"2":"_R"},F:{"1":"_3F","2":"_YI"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"FE","2":"GE"}},B:4,C:"Battery Status API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/beacon.js b/node_modules/caniuse-lite/data/features/beacon.js new file mode 100644 index 0000000000000000000000000000000000000000..603281ac10bb889852fd59d65d7bbafef71e00a7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/beacon.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_zD","2":"_JB"},C:{"1":"_H _kB","2":"_vL"},D:{"1":"_CS","2":"_qR"},E:{"1":"_MC","2":"_2C"},F:{"1":"_5M _uB","2":"_h _UF _P"},G:{"1":"_KC","2":"_zC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Beacon API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/beforeafterprint.js b/node_modules/caniuse-lite/data/features/beforeafterprint.js new file mode 100644 index 0000000000000000000000000000000000000000..f10896c08e1c66f81f79114612e6b01c00ae5677 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/beforeafterprint.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_PC","16":"AD"},B:{"1":"_J"},C:{"1":"_IM","2":"_1C"},D:{"1":"_wR","2":"_2N"},E:{"1":"_ZE","2":"_AK"},F:{"1":"_UR","2":"_9O"},G:{"1":"_UE","2":"_DF"},H:{"2":"vD"},I:{"2":"_O"},J:{"16":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"16":"_A"},O:{"1":"YC"},P:{"2":"_U","16":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Printing Events",D:true}; diff --git a/node_modules/caniuse-lite/data/features/bigint.js b/node_modules/caniuse-lite/data/features/bigint.js new file mode 100644 index 0000000000000000000000000000000000000000..4b085b25c7511b5d7f22fd1fb8aa998d5641981a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/bigint.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_7R","2":"_m _qD _L","194":"HC IC JC"},D:{"1":"_HK","2":"_3Q"},E:{"1":"_7L","2":"_VR"},F:{"1":"_DM","2":"_XK"},G:{"1":"_tH","2":"_7N"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_sF","2":"_4F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:6,C:"BigInt",D:true}; diff --git a/node_modules/caniuse-lite/data/features/blobbuilder.js b/node_modules/caniuse-lite/data/features/blobbuilder.js new file mode 100644 index 0000000000000000000000000000000000000000..4fa1dca618137231cdc24e270600c64fcbef38e9 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/blobbuilder.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_lP _IC","2":"_1C","36":"_rN"},D:{"1":"_dO","2":"_HC","36":"_kH _aC"},E:{"1":"_cB","2":"_s"},F:{"1":"_xF","2":"_WE"},G:{"1":"_7C","2":"_1"},H:{"2":"vD"},I:{"1":"I","2":"_l","36":"_pJ"},J:{"1":"A","2":"D"},K:{"1":"_YB","2":"_bB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"Blob constructing",D:true}; diff --git a/node_modules/caniuse-lite/data/features/bloburls.js b/node_modules/caniuse-lite/data/features/bloburls.js new file mode 100644 index 0000000000000000000000000000000000000000..eb1590de6eec2f3d9a55e2da14f823217840d5b2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/bloburls.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","129":"_A"},B:{"1":"_SE","129":"_v"},C:{"1":"_x","2":"_f"},D:{"1":"_UO","2":"_HC","33":"_kH _0B"},E:{"1":"_iB","2":"_s","33":"L"},F:{"1":"_a","2":"_T"},G:{"1":"_z","2":"_1","33":"aD"},H:{"2":"vD"},I:{"1":"_X","2":"_KB","33":"_oF"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"B","2":"A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"Blob URLs",D:true}; diff --git a/node_modules/caniuse-lite/data/features/border-image.js b/node_modules/caniuse-lite/data/features/border-image.js new file mode 100644 index 0000000000000000000000000000000000000000..55fd9068b036e83c1966da3606c770f3ca8156a8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/border-image.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"B","2":"_y"},B:{"1":"_zD","129":"_JB"},C:{"1":"_GF","2":"_g","260":"_ZG","804":"_Y _L"},D:{"1":"_MK","260":"_TE","388":"MB _NE","1412":"_8I","1956":"_Y"},E:{"1":"_uC","129":"_FO LD _XN","1412":"_OC _sE","1956":"_s"},F:{"1":"_VL","2":"_eB","260":"_QF","388":"_KD","1796":"_nI","1828":"_5 _tE"},G:{"1":"_5B","129":"eD _BE _nL _YG","1412":"_QD dD","1956":"_1"},H:{"1828":"vD"},I:{"1":"I","388":"_w","1956":"_W"},J:{"1412":"A","1924":"D"},K:{"1":"H","2":"A","1828":"_YD"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"B","2":"A"},O:{"1":"YC"},P:{"1":"_wB","260":"_SH","388":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","260":"FE"}},B:4,C:"CSS3 Border images",D:true}; diff --git a/node_modules/caniuse-lite/data/features/border-radius.js b/node_modules/caniuse-lite/data/features/border-radius.js new file mode 100644 index 0000000000000000000000000000000000000000..8acb7d299968f10dd5e3690a9bedd8a51ff7b131 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/border-radius.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_GF","257":"_kL","289":"cC _L","292":"BD"},D:{"1":"_0D","33":"J"},E:{"1":"jB _6C","33":"_i","129":"_iG JD"},F:{"1":"_aD","2":"_eB"},G:{"1":"_dB","33":"iC"},H:{"2":"vD"},I:{"1":"_9Q","33":"wD"},J:{"1":"_B"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","257":"FE"}},B:4,C:"CSS3 Border-radius (rounded corners)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/broadcastchannel.js b/node_modules/caniuse-lite/data/features/broadcastchannel.js new file mode 100644 index 0000000000000000000000000000000000000000..dfa6add52c65737674ac1b38a8c27bc385c63cd5 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/broadcastchannel.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_8J","2":"_PM"},D:{"1":"_EM","2":"_vJ"},E:{"1":"_uC","2":"_BH"},F:{"1":"_JO","2":"_LM"},G:{"1":"_5B","2":"_YE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_wB","2":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"BroadcastChannel",D:true}; diff --git a/node_modules/caniuse-lite/data/features/brotli.js b/node_modules/caniuse-lite/data/features/brotli.js new file mode 100644 index 0000000000000000000000000000000000000000..a018719d04054e31b80e69038d2215fa5b53e13a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/brotli.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_SE","2":"_v"},C:{"1":"_9L","2":"_ZO"},D:{"1":"_zH","2":"_sG","194":"3B","257":"4B"},E:{"1":"_ZE","2":"_pB","513":"_yQ"},F:{"1":"_6L","2":"_9G","194":"_NF"},G:{"1":"_AB","2":"_WB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"Brotli Accept-Encoding/Content-Encoding",D:true}; diff --git a/node_modules/caniuse-lite/data/features/calc.js b/node_modules/caniuse-lite/data/features/calc.js new file mode 100644 index 0000000000000000000000000000000000000000..ab4daa3135a69cab093b598d0b18b102af1f8992 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/calc.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","260":"F","516":"_A"},B:{"1":"_J"},C:{"1":"_FI","2":"_f","33":"_DC"},D:{"1":"_IF","2":"_gL","33":"_RJ IB"},E:{"1":"_iB","2":"_s","33":"L"},F:{"1":"_a","2":"_T"},G:{"1":"_z","2":"_1","33":"aD"},H:{"2":"vD"},I:{"1":"I","2":"_W","132":"_w"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"calc() as CSS unit value",D:true}; diff --git a/node_modules/caniuse-lite/data/features/canvas-blending.js b/node_modules/caniuse-lite/data/features/canvas-blending.js new file mode 100644 index 0000000000000000000000000000000000000000..cc091c2f535a34c9a4a3b28b1958ccdbf80befd3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/canvas-blending.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_xD","2":"C"},C:{"1":"_cO","2":"_n _aC _L"},D:{"1":"_DK","2":"_kJ"},E:{"1":"_iB","2":"_3C"},F:{"1":"_3J","2":"_h _9B _P"},G:{"1":"_z","2":"_o"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Canvas blend modes",D:true}; diff --git a/node_modules/caniuse-lite/data/features/canvas-text.js b/node_modules/caniuse-lite/data/features/canvas-text.js new file mode 100644 index 0000000000000000000000000000000000000000..5b3b7e0710deb49cb19a540d60734a93746e1446 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/canvas-text.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"AD","8":"_FB"},B:{"1":"_J"},C:{"1":"_tC","8":"_g"},D:{"1":"_Q"},E:{"1":"_CB","8":"_e"},F:{"1":"_aD","8":"_eB"},G:{"1":"_M"},H:{"2":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_BB","8":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Text API for Canvas",D:true}; diff --git a/node_modules/caniuse-lite/data/features/canvas.js b/node_modules/caniuse-lite/data/features/canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..8fec5ad3d19f959343065ba7614083f0b7a1528f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/canvas.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"AD","8":"_FB"},B:{"1":"_J"},C:{"1":"_yF","132":"_LC"},D:{"1":"_Q"},E:{"1":"_CB","132":"_e"},F:{"1":"_b"},G:{"1":"_M"},H:{"260":"vD"},I:{"1":"_6B","132":"_l"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Canvas (basic support)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/ch-unit.js b/node_modules/caniuse-lite/data/features/ch-unit.js new file mode 100644 index 0000000000000000000000000000000000000000..7174840fa630daf16af2db5471f362d138cc047d --- /dev/null +++ b/node_modules/caniuse-lite/data/features/ch-unit.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","132":"_V"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_vP _EC","2":"_Y _JN"},E:{"1":"_6C","2":"_XC"},F:{"1":"_a","2":"_T"},G:{"1":"_z","2":"_o"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"ch (character) unit",D:true}; diff --git a/node_modules/caniuse-lite/data/features/chacha20-poly1305.js b/node_modules/caniuse-lite/data/features/chacha20-poly1305.js new file mode 100644 index 0000000000000000000000000000000000000000..76dd05c78f9cdf3a38ec7a6b06500897c845679a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/chacha20-poly1305.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_HM","2":"_tL"},D:{"1":"_bE","2":"_Y _cG","129":"_MO _bG"},E:{"1":"_MC","2":"_2C"},F:{"1":"_7E","2":"_9G"},G:{"1":"_AB","2":"_WB"},H:{"2":"vD"},I:{"1":"I","2":"_xG","16":"1D"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"ChaCha20-Poly1305 cipher suites for TLS",D:true}; diff --git a/node_modules/caniuse-lite/data/features/channel-messaging.js b/node_modules/caniuse-lite/data/features/channel-messaging.js new file mode 100644 index 0000000000000000000000000000000000000000..3cfe3b8347f6bc959b4305c69f28cf2e16566107 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/channel-messaging.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_8L","2":"_BP","194":"_zK _8G"},D:{"1":"_Q"},E:{"1":"_mB","2":"_i"},F:{"1":"_zF","2":"_eB","16":"VD"},G:{"1":"_r","2":"_d"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"_B"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Channel messaging",D:true}; diff --git a/node_modules/caniuse-lite/data/features/childnode-remove.js b/node_modules/caniuse-lite/data/features/childnode-remove.js new file mode 100644 index 0000000000000000000000000000000000000000..20a52d08e3d4af2425fbeabd7207ce749990238e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/childnode-remove.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_xD","16":"C"},C:{"1":"_gR","2":"_n _0B _L"},D:{"1":"_AM","2":"_tF"},E:{"1":"_iB","2":"_s","16":"L"},F:{"1":"_a","2":"_T"},G:{"1":"_z","2":"_o"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"ChildNode.remove()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/classlist.js b/node_modules/caniuse-lite/data/features/classlist.js new file mode 100644 index 0000000000000000000000000000000000000000..31373879fd6f5865d6db51450b72d30abb9bdd61 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/classlist.js @@ -0,0 +1 @@ +module.exports={A:{A:{"8":"_Z","1924":"_A"},B:{"1":"_J"},C:{"1":"_cR","8":"_LC","516":"HB IB","772":"_tF GD"},D:{"1":"_gO","8":"_HC","516":"HB _LQ","772":"GB","900":"_kH _0B"},E:{"1":"_6C","8":"_3","900":"_iG JD"},F:{"1":"_a","8":"_JR","900":"C _PL"},G:{"1":"_z","8":"_d","900":"_wC"},H:{"900":"vD"},I:{"1":"_X","8":"_l","900":"_BF"},J:{"1":"A","900":"D"},K:{"1":"H","8":"_A","900":"_KL"},L:{"1":"I"},M:{"1":"VC"},N:{"900":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"classList (DOMTokenList)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js b/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js new file mode 100644 index 0000000000000000000000000000000000000000..59aef672c1f8c0cae246bde302f705f2c65987f2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_ZJ _jD","2":"_LE _uD"},E:{"2":"_R"},F:{"1":"_IN _PG","2":"_h _cG _P"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:6,C:"Client Hints: DPR, Width, Viewport-Width",D:true}; diff --git a/node_modules/caniuse-lite/data/features/clipboard.js b/node_modules/caniuse-lite/data/features/clipboard.js new file mode 100644 index 0000000000000000000000000000000000000000..5ce36d00192760b0e840d509a919eafb66d3230e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/clipboard.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2436":"_E"},B:{"260":"_8B","2436":"_ZB","8196":"_K"},C:{"2":"_CF","772":"_zB _8G","4100":"_8L"},D:{"2":"_TF","2564":"_AC _8D","8196":"_QM","10244":"_6D _EI"},E:{"1":"_BI","16":"_e","2308":"_A _GD","2820":"_RC _SD"},F:{"2":"_vD","16":"C","516":"XC","2564":"_8I","8196":"_oR","10244":"MB _7D _ZC"},G:{"1":"_VJ","2":"_d","2820":"_rD _3O"},H:{"2":"vD"},I:{"2":"_W","260":"I","2308":"_w"},J:{"2":"D","2308":"A"},K:{"2":"_bB","16":"XC","8196":"H"},L:{"8196":"I"},M:{"1028":"VC"},N:{"2":"_A"},O:{"8196":"YC"},P:{"2052":"_SH","2308":"J","8196":"_wB"},Q:{"8196":"DE"},R:{"8196":"EE"},S:{"4100":"_C"}},B:5,C:"Synchronous Clipboard API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/colr-v1.js b/node_modules/caniuse-lite/data/features/colr-v1.js new file mode 100644 index 0000000000000000000000000000000000000000..98f435a5a8d08616047baa37c5b3fcd7542bad20 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/colr-v1.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_H _xJ","2":"_0 _zE"},C:{"1":"_aL _t","2":"_aB _zE _L","258":"_BG","578":"p q"},D:{"1":"_H _0L","2":"_u _GO","194":"a _ZK"},E:{"2":"_R"},F:{"1":"_oG _IR","2":"_7 _oD _P"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"16":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"16":"_A"},O:{"1":"YC"},P:{"1":"_jQ","2":"_0O"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:6,C:"COLR/CPAL(v1) Font Formats",D:true}; diff --git a/node_modules/caniuse-lite/data/features/colr.js b/node_modules/caniuse-lite/data/features/colr.js new file mode 100644 index 0000000000000000000000000000000000000000..439c92a0e778e6fe31ec4090d0cace086499b23b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/colr.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","257":"_V"},B:{"1":"_YH _nH _j","513":"_IB _6F"},C:{"1":"_OO","2":"_DP"},D:{"1":"_5H _q","2":"_6 _nD","513":"_iI _PF _6F"},E:{"1":"_oP _CE _gF _hM _vQ","2":"_pB","129":"_5 M WC _AE","1026":"_gM"},F:{"1":"_dQ _ME","2":"_aF _EI _P","513":"CC _qI _4J"},G:{"1":"_qK _mH _hM _2O","2":"_WB","1026":"_gM"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"16":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"16":"_A"},O:{"1":"YC"},P:{"1":"_9E","2":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"COLR/CPAL(v0) Font Formats",D:true}; diff --git a/node_modules/caniuse-lite/data/features/comparedocumentposition.js b/node_modules/caniuse-lite/data/features/comparedocumentposition.js new file mode 100644 index 0000000000000000000000000000000000000000..c2521d627d36944604ec662bf407df7714e20c91 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/comparedocumentposition.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_x","16":"_f"},D:{"1":"_DK","16":"_Y","132":"_8I"},E:{"1":"_LB","16":"_vB _e","132":"_gC _yB","260":"ID"},F:{"1":"_yM _8B _cF _3I","16":"_5C","132":"_9B"},G:{"1":"_8","16":"iC","132":"_PR _eC"},H:{"1":"vD"},I:{"1":"_X","16":"_k","132":"_mL"},J:{"132":"_B"},K:{"1":"_UD","16":"_fB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Node.compareDocumentPosition()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/console-basic.js b/node_modules/caniuse-lite/data/features/console-basic.js new file mode 100644 index 0000000000000000000000000000000000000000..1392e071a1a68712c23b2cad47fd35dd25fa6f79 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/console-basic.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_GB","132":"_vC"},B:{"1":"_J"},C:{"1":"_x","2":"_f"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_zJ","2":"_pC"},G:{"1":"_1","513":"_7C"},H:{"4097":"vD"},I:{"1025":"_O"},J:{"258":"_B"},K:{"2":"A","258":"_YD","1025":"H"},L:{"1025":"I"},M:{"2049":"VC"},N:{"258":"_A"},O:{"258":"YC"},P:{"1025":"_F"},Q:{"1":"DE"},R:{"1025":"EE"},S:{"1":"_C"}},B:1,C:"Basic console logging functions",D:true}; diff --git a/node_modules/caniuse-lite/data/features/console-time.js b/node_modules/caniuse-lite/data/features/console-time.js new file mode 100644 index 0000000000000000000000000000000000000000..ee6331fccbe99000df09c5f6928dc0d523d37300 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/console-time.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"B","2":"_y"},B:{"1":"_J"},C:{"1":"_bU _IC","2":"_RK"},D:{"1":"_Q"},E:{"1":"_CB","2":"_e"},F:{"1":"_RR","2":"_pC","16":"B"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"H","16":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"B","2":"A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"console.time and console.timeEnd",D:true}; diff --git a/node_modules/caniuse-lite/data/features/const.js b/node_modules/caniuse-lite/data/features/const.js new file mode 100644 index 0000000000000000000000000000000000000000..626fac5c220ff289295381e03bee59e00eee0930 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/const.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_y","2052":"B"},B:{"1":"_J"},C:{"1":"_8E","132":"_g _TF _L","260":"_AC _LG"},D:{"1":"_bE","260":"_uF","772":"_4B _8G","1028":"_YC _bG"},E:{"1":"_oB","260":"_4 A _e jC","772":"_OC _SD"},F:{"1":"_7E","2":"_lB","132":"B UD _nI _sB","644":"_LL","772":"_9M","1028":"_OG _5D"},G:{"1":"_AB","260":"_d _BE","772":"_rD _eC"},H:{"644":"vD"},I:{"1":"I","16":"_k","260":"yD","772":"_pJ"},J:{"772":"_B"},K:{"1":"H","132":"_fB","644":"_JL"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"B","2":"A"},O:{"1":"YC"},P:{"1":"_U","1028":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:6,C:"const",D:true}; diff --git a/node_modules/caniuse-lite/data/features/constraint-validation.js b/node_modules/caniuse-lite/data/features/constraint-validation.js new file mode 100644 index 0000000000000000000000000000000000000000..eaab8d4e3b4a3ff708655939a03548ee9318f6cd --- /dev/null +++ b/node_modules/caniuse-lite/data/features/constraint-validation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","900":"_A"},B:{"1":"_8C","388":"N _9B","900":"_JB"},C:{"1":"_pF","2":"_f","260":"_jI","388":"_qB _3P","900":"_iJ"},D:{"1":"_NJ _JE","16":"_Y","388":"_NB _lH _eD","900":"_yE"},E:{"1":"_LB","16":"_3","388":"_iQ","900":"_dD ID JD"},F:{"1":"_0R","16":"_5C","388":"_JN","900":"_LL"},G:{"1":"_8","16":"_d","388":"_TC _eC","900":"_wC"},H:{"2":"vD"},I:{"1":"I","16":"_KB","388":"_w","900":"_oF"},J:{"16":"D","388":"A"},K:{"1":"H","16":"_fB","900":"_JL"},L:{"1":"I"},M:{"1":"VC"},N:{"900":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","388":"FE"}},B:1,C:"Constraint Validation API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/contenteditable.js b/node_modules/caniuse-lite/data/features/contenteditable.js new file mode 100644 index 0000000000000000000000000000000000000000..8178908e4b031f5ba415c933b7851b2584ea99a0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/contenteditable.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_E"},B:{"1":"_J"},C:{"1":"_tC","2":"BD","4":"cC"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_r","2":"_d"},H:{"2":"vD"},I:{"1":"_6B","2":"_l"},J:{"1":"_B"},K:{"1":"_YB","2":"_bB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"contenteditable attribute (basic support)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js b/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js new file mode 100644 index 0000000000000000000000000000000000000000..245bc8cad7cc23f93cc60acc2f4ca1e1a3b99498 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","132":"_A"},B:{"1":"_J"},C:{"1":"_gR","2":"_f","129":"_hJ"},D:{"1":"_4G","2":"_4E","257":"N _yE"},E:{"1":"_6C","2":"_3","257":"L JD","260":"ID"},F:{"1":"_a","2":"_T"},G:{"1":"_z","2":"_d","257":"aD","260":"ZD"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"2":"D","257":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"132":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Content Security Policy 1.0",D:true}; diff --git a/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js b/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js new file mode 100644 index 0000000000000000000000000000000000000000..f727290a7d449660631c693d42ca1e6a0c6ae8ae --- /dev/null +++ b/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_v","4100":"_UB"},C:{"1":"_GN _0E","2":"_vL","132":"_7H","260":"pB","516":"_bC _ZC"},D:{"1":"_NJ _JE","2":"_5E","1028":"_oQ","2052":"tB"},E:{"1":"_LB","2":"_SB"},F:{"1":"_0R","2":"_7O","1028":"_GH IB","2052":"JB"},G:{"1":"_8","2":"_OB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"Content Security Policy Level 2",D:true}; diff --git a/node_modules/caniuse-lite/data/features/cookie-store-api.js b/node_modules/caniuse-lite/data/features/cookie-store-api.js new file mode 100644 index 0000000000000000000000000000000000000000..3b940a01f029ea8128a770bca125efa97341795a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/cookie-store-api.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_pN _iH","2":"_I","194":"_mG W"},C:{"1":"_lQ","2":"_oC _dL PB CB _L","322":"QB _bM _XS"},D:{"1":"_pN _hH","2":"_6 _rB","194":"_zM _fL W"},E:{"1":"_FS","2":"_fG _tG"},F:{"1":"_H _mD","2":"_aF _P","194":"_pG _lE"},G:{"1":"_zN","2":"_nF _tG"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:7,C:"Cookie Store API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/cors.js b/node_modules/caniuse-lite/data/features/cors.js new file mode 100644 index 0000000000000000000000000000000000000000..dda86e23f3ff585f7b1f3b0ca9f7c3de5ae2ead2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/cors.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"B","2":"_GB","132":"A","260":"_vC"},B:{"1":"_J"},C:{"1":"_H _WO _iI _VC _L","2":"_g","1025":"eC _nD"},D:{"1":"_5L","132":"_TF"},E:{"2":"_e","513":"_cB","644":"_rQ"},F:{"1":"_2L","2":"_vD"},G:{"513":"_7C","644":"_1"},H:{"2":"vD"},I:{"1":"_X","132":"_W"},J:{"1":"A","132":"D"},K:{"1":"_UD","2":"_fB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"B","132":"A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:1,C:"Cross-Origin Resource Sharing",D:true}; diff --git a/node_modules/caniuse-lite/data/features/createimagebitmap.js b/node_modules/caniuse-lite/data/features/createimagebitmap.js new file mode 100644 index 0000000000000000000000000000000000000000..a6f948ab7b064a4a85a64d3361c5d93016d9cda4 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/createimagebitmap.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_n _bH vB _L","1028":"_JJ","3076":"wB _fC _VB _fF","8193":"_H _dG"},D:{"1":"_BS","2":"_kL","132":"4B 5B","260":"_RQ","516":"8B _OF"},E:{"1":"_2D","2":"_MI","4100":"G _6M _gF"},F:{"1":"_ZJ _PD","2":"_iO","132":"rB sB","260":"tB uB","516":"_YC _uD"},G:{"1":"_VE","2":"_2F","4100":"_IT _mH"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"8193":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_gB","16":"_qC"},Q:{"1":"DE"},R:{"1":"EE"},S:{"3076":"_C"}},B:1,C:"createImageBitmap",D:true}; diff --git a/node_modules/caniuse-lite/data/features/credential-management.js b/node_modules/caniuse-lite/data/features/credential-management.js new file mode 100644 index 0000000000000000000000000000000000000000..ee3c653ab6a0d754c70307e78717b5381034a14f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/credential-management.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_qF","2":"_8H","66":"_0M","129":"_3E"},E:{"2":"_R"},F:{"1":"_oR","2":"_gH _ZC _P"},G:{"1":"_tH","2":"_7N"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_wB","2":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:5,C:"Credential Management API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js b/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js new file mode 100644 index 0000000000000000000000000000000000000000..7c7b3d43d9f888e1c7ca8cbd2e877b1b85183c2a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_fE _j","2":"_YH _wH"},C:{"2":"_oC _KK _OP aB _L","194":"bB","260":"_gG"},D:{"1":"_fE _q","2":"_wF _UC"},E:{"1":"_NQ","2":"_fG _oE"},F:{"1":"_fQ CB","2":"_7 _6N _P"},G:{"1":"_lL","2":"_nF _oE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"260":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"View Transitions (cross-document)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/cryptography.js b/node_modules/caniuse-lite/data/features/cryptography.js new file mode 100644 index 0000000000000000000000000000000000000000..66bdb208adb2f5eb878d3c25c4473ef62c71a6ae --- /dev/null +++ b/node_modules/caniuse-lite/data/features/cryptography.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"AD","8":"_1E","164":"B"},B:{"1":"_K","513":"_I"},C:{"1":"_QI","8":"_DP","66":"_bS"},D:{"1":"_UI","8":"_CK"},E:{"1":"_oB","8":"_4C","289":"_6H _dR"},F:{"1":"_6G","8":"_SK"},G:{"1":"_AB","8":"_DB","289":"_jC _HD"},H:{"2":"vD"},I:{"1":"I","8":"_G"},J:{"8":"_B"},K:{"1":"H","8":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"8":"A","164":"B"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"Web Cryptography",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-all.js b/node_modules/caniuse-lite/data/features/css-all.js new file mode 100644 index 0000000000000000000000000000000000000000..b3b9547a1e1cb5f4c96c0db30ea9e439ffcac205 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-all.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_1R","2":"_OS"},D:{"1":"_UI","2":"_CK"},E:{"1":"_ND","2":"_CI"},F:{"1":"_6G","2":"_SK"},G:{"1":"_kG","2":"_AI"},H:{"2":"vD"},I:{"1":"_VD","2":"_xG"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS all property",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-anchor-positioning.js b/node_modules/caniuse-lite/data/features/css-anchor-positioning.js new file mode 100644 index 0000000000000000000000000000000000000000..a04714d4eecf37da4486abce2718ae461166c1b6 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-anchor-positioning.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_DQ _j","2":"0 _CO","194":"_jG _DH _bI"},C:{"1":"fB _hI _mJ","2":"_oC _iR _L","322":"dB eB"},D:{"1":"_DQ _q","2":"0 _yG","194":"_jG _DH _bI"},E:{"1":"_SJ","2":"_vR"},F:{"1":"_DT CB","2":"_7 _xP _P","194":"_cI _XM"},G:{"1":"_9D","2":"_tR"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_jH","2":"_NN _cN _vE"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Anchor Positioning",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-animation.js b/node_modules/caniuse-lite/data/features/css-animation.js new file mode 100644 index 0000000000000000000000000000000000000000..e6310e3b55e109f6a5ae410263c012da3fb86cb8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-animation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_FI","2":"_g J _L","33":"_9I G"},D:{"1":"_ZQ","33":"_LE"},E:{"1":"_PB","2":"_e","33":"_FB _UJ","292":"_4"},F:{"1":"_QO XC","2":"_vD","33":"C _8I"},G:{"1":"_p","33":"_QD","164":"_1"},H:{"2":"vD"},I:{"1":"I","33":"_NL","164":"_KB"},J:{"33":"_B"},K:{"1":"_YB","2":"_bB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"CSS Animation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-any-link.js b/node_modules/caniuse-lite/data/features/css-any-link.js new file mode 100644 index 0000000000000000000000000000000000000000..f2887921864025dae3a48fbcc9acc7829127cd08 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-any-link.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_GF","16":"BD","33":"cC _kL _L"},D:{"1":"_RM","16":"_Y","33":"_RF _qD"},E:{"1":"_PB","16":"_3C","33":"_QJ _sE"},F:{"1":"_SI","2":"_T","33":"_BR"},G:{"1":"_p","16":"_1","33":"_QD"},H:{"2":"vD"},I:{"1":"I","16":"_W","33":"_w"},J:{"16":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_sF","16":"J","33":"_oJ 5D"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","33":"FE"}},B:5,C:"CSS :any-link selector",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-appearance.js b/node_modules/caniuse-lite/data/features/css-appearance.js new file mode 100644 index 0000000000000000000000000000000000000000..21ac450a17b294afefcaccc647afed6eeac6ccea --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-appearance.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_2R","33":"T","164":"_IB","388":"_I"},C:{"1":"_WJ _SQ","164":"_QQ _yD","676":"_MS"},D:{"1":"_3R","33":"T","164":"_u"},E:{"1":"_uC","164":"_BH"},F:{"1":"_bJ","2":"_T","33":"MC _QP","164":"_PJ _yL"},G:{"1":"_5B","164":"_YE"},H:{"2":"vD"},I:{"1":"I","164":"_G"},J:{"164":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"A","388":"B"},O:{"1":"YC"},P:{"1":"_tD","164":"_XE"},Q:{"164":"DE"},R:{"1":"EE"},S:{"1":"GE","164":"FE"}},B:5,C:"CSS Appearance",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-at-counter-style.js b/node_modules/caniuse-lite/data/features/css-at-counter-style.js new file mode 100644 index 0000000000000000000000000000000000000000..c8717e9e415d77280f2989932f27ca05ad8c6a28 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-at-counter-style.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_0 _MB","132":"_lR"},C:{"2":"_ZI","132":"_mO"},D:{"2":"_8N","132":"_mR"},E:{"2":"_zG","4":"_2D"},F:{"2":"_2B _5J _P","132":"_YL _4K"},G:{"2":"_TN","4":"_VE"},H:{"2":"vD"},I:{"2":"_G","132":"I"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"132":"I"},M:{"132":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"2":"_kF BE","132":"_EB ZC _kM"},Q:{"2":"DE"},R:{"132":"EE"},S:{"132":"_C"}},B:4,C:"CSS Counter Styles",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-autofill.js b/node_modules/caniuse-lite/data/features/css-autofill.js new file mode 100644 index 0000000000000000000000000000000000000000..6d72bc1853fee5e8af6512c0c5d1e0bdac2b873a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-autofill.js @@ -0,0 +1 @@ +module.exports={A:{D:{"1":"_5H _q","33":"_u _6F"},L:{"1":"I"},B:{"1":"_5H _j","2":"_I","33":"_IB _6F"},C:{"2":"_S"},M:{"2":"VC"},A:{"2":"_E"},F:{"1":"_dQ _ME","2":"_T","33":"_sC _4J"},K:{"1":"H","2":"_D"},E:{"1":"_LU _PE","2":"SD","33":"_MI"},G:{"1":"_dE","33":"_2F"},P:{"1":"_4B","33":"_OL"},I:{"1":"I","2":"_W","33":"_w"}},B:6,C:":autofill CSS pseudo-class",D:undefined}; diff --git a/node_modules/caniuse-lite/data/features/css-backdrop-filter.js b/node_modules/caniuse-lite/data/features/css-backdrop-filter.js new file mode 100644 index 0000000000000000000000000000000000000000..31fbc02de02eaf29064dd997bee3c7e9067908aa --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-backdrop-filter.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_ZB","257":"_8B"},C:{"1":"_H _cI _cH _t","2":"_m _yL _L","578":"_fT _JD _xP"},D:{"1":"_H _eK _vH","2":"_xN","194":"_QC _ID _UG"},E:{"1":"_dN","2":"_TB","33":"_V _3B LD _qL"},F:{"1":"_8F","2":"_8O","194":"_jE _bC _vN _rB"},G:{"1":"_gD","2":"_2","33":"_IK"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_cJ","2":"J","194":"_rI jC 7D"},Q:{"2":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:7,C:"CSS Backdrop Filter",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-background-offsets.js b/node_modules/caniuse-lite/data/features/css-background-offsets.js new file mode 100644 index 0000000000000000000000000000000000000000..143c2c5acc97b51b746404927c7f028b0cbbe6f8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-background-offsets.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_lP _IC","2":"_g _TF _L"},D:{"1":"_4G","2":"_rG"},E:{"1":"_6C","2":"_XC"},F:{"1":"_aD","2":"_eB"},G:{"1":"_z","2":"_o"},H:{"1":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS background-position edge offsets",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js b/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js new file mode 100644 index 0000000000000000000000000000000000000000..739b97d712bac780a0e7635c3e22cf998a5550a3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_6K _kB","2":"_EP"},D:{"1":"_BN _bC _uD _QC _jD","2":"_uQ","260":"0B"},E:{"1":"_HB","2":"_4C","132":"_6H _lF"},F:{"1":"_aG _OQ _jE _PG","2":"_KS","260":"nB"},G:{"1":"_9","2":"_DB","132":"_jC _AF"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS background-blend-mode",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js b/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js new file mode 100644 index 0000000000000000000000000000000000000000..9c67ada8cb81899cfc8e9ae3c0c33c078ebc64e5 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_dJ _hE","2":"_I","164":"_kN _dL"},C:{"1":"_OO","2":"_DP"},D:{"1":"_dJ _KE","2":"_iL","164":"_aG _vG _dL"},E:{"2":"_3C","164":"_iB"},F:{"1":"_H _fE CB","2":"_pC","129":"_5 _tE","164":"_sC _UC"},G:{"2":"_o","164":"_z"},H:{"132":"vD"},I:{"1":"I","2":"_W","164":"_w"},J:{"2":"D","164":"A"},K:{"2":"A","129":"_YD","164":"H"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"164":"YC"},P:{"164":"_F"},Q:{"164":"DE"},R:{"164":"EE"},S:{"1":"_C"}},B:4,C:"CSS box-decoration-break",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-boxshadow.js b/node_modules/caniuse-lite/data/features/css-boxshadow.js new file mode 100644 index 0000000000000000000000000000000000000000..0b9990b17e95f6b987134d79f8317386fe0534f0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-boxshadow.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_x","2":"_g","33":"_L"},D:{"1":"_4O","33":"_RC"},E:{"1":"_XB","33":"jB","164":"_i"},F:{"1":"_aD","2":"_eB"},G:{"1":"_r","33":"_HG","164":"iC"},H:{"2":"vD"},I:{"1":"_QE","164":"_KB"},J:{"1":"A","33":"D"},K:{"1":"_BB","2":"A"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS3 Box-shadow",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-canvas.js b/node_modules/caniuse-lite/data/features/css-canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..a1af234abc9c4c79be30017998f31bd94d1c0ddb --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-canvas.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_5F","33":"_8H"},E:{"2":"_e","33":"_CB"},F:{"2":"_SC pB _PG _P","33":"_bF"},G:{"33":"_M"},H:{"2":"vD"},I:{"2":"I","33":"_G"},J:{"33":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_U","33":"J"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:7,C:"CSS Canvas Drawings",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-caret-color.js b/node_modules/caniuse-lite/data/features/css-caret-color.js new file mode 100644 index 0000000000000000000000000000000000000000..a530a7abb2aa5eb8b8f56cede79c2195cd42faa2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-caret-color.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_FM","2":"_1J"},D:{"1":"_qF","2":"_jF"},E:{"1":"_MC","2":"_2C"},F:{"1":"_HF","2":"_XI"},G:{"1":"_KC","2":"_zC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_wB","2":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:2,C:"CSS caret-color",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-cascade-layers.js b/node_modules/caniuse-lite/data/features/css-cascade-layers.js new file mode 100644 index 0000000000000000000000000000000000000000..c51224fcd1df58495e861016dba3cbb28661cf2c --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-cascade-layers.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_qN _j","2":"_0 _4J","322":"_6P i"},C:{"1":"_yH _dG","2":"_aB _7G _L","194":"e _HP"},D:{"1":"_qN _q","2":"_u _4J","322":"_6P i"},E:{"1":"_uC","2":"_BH"},F:{"1":"_oG _IR","2":"_7 _oD _P"},G:{"1":"_5B","2":"_YE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_jQ","2":"_0O"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:4,C:"CSS Cascade Layers",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-cascade-scope.js b/node_modules/caniuse-lite/data/features/css-cascade-scope.js new file mode 100644 index 0000000000000000000000000000000000000000..518071b80c2429eda515ca56faf6e22c4f58cc47 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-cascade-scope.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_CH _GI","2":"_0 _NK","194":"_KF o _jN"},C:{"1":"_JH _mJ","2":"_bR _L"},D:{"1":"_CH _3G","2":"_u _NK","194":"_KF o _jN"},E:{"1":"K _vQ","2":"_zG _GG"},F:{"1":"_QK","2":"_7 _GO _P","194":"a _xH p"},G:{"1":"_2O","2":"_xO"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_NB","2":"_OM"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"Scoped Styles: the @scope rule",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-case-insensitive.js b/node_modules/caniuse-lite/data/features/css-case-insensitive.js new file mode 100644 index 0000000000000000000000000000000000000000..024dedaeae96520b22e5d1894c5d6dd14c1db07f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-case-insensitive.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_HM","2":"_tL"},D:{"1":"_bE","2":"_sG"},E:{"1":"_PB","2":"_TB"},F:{"1":"_7E","2":"_9G"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"Case-insensitive CSS attribute selectors",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-clip-path.js b/node_modules/caniuse-lite/data/features/css-clip-path.js new file mode 100644 index 0000000000000000000000000000000000000000..06487cf532d6145f070e4fecc2a71626b81116c0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-clip-path.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_1F","260":"_K","3138":"Q"},C:{"1":"_DN _7I","2":"_g","132":"_Y _dT","644":"_QC _VG"},D:{"2":"_tF","260":"_WL","292":"_WF _LO"},E:{"2":"_XC","260":"_cE","292":"_gC _qJ _lF _pL"},F:{"2":"_T","260":"_TI","292":"_bH vB"},G:{"2":"_o","260":"_UE","292":"_TC _DJ kD"},H:{"2":"vD"},I:{"2":"_W","260":"I","292":"_w"},J:{"2":"_B"},K:{"2":"_D","260":"H"},L:{"260":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"260":"YC"},P:{"260":"_gB","292":"_qC"},Q:{"260":"DE"},R:{"260":"EE"},S:{"1":"GE","644":"FE"}},B:4,C:"CSS clip-path property (for HTML)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-color-adjust.js b/node_modules/caniuse-lite/data/features/css-color-adjust.js new file mode 100644 index 0000000000000000000000000000000000000000..9ee299d26549845258241d00d1e328d21188dd31 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-color-adjust.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_I","33":"_K"},C:{"1":"_3L","2":"_WK"},D:{"16":"_gL","33":"_H _xL"},E:{"1":"_uC","2":"_s","33":"_gJ _7Q"},F:{"2":"_T","33":"_a"},G:{"1":"_5B","16":"_YE"},H:{"2":"vD"},I:{"16":"_G","33":"I"},J:{"16":"_B"},K:{"2":"_D","33":"H"},L:{"16":"I"},M:{"1":"VC"},N:{"16":"_A"},O:{"16":"YC"},P:{"16":"_F"},Q:{"33":"DE"},R:{"16":"EE"},S:{"1":"_C"}},B:4,C:"CSS print-color-adjust",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-color-function.js b/node_modules/caniuse-lite/data/features/css-color-function.js new file mode 100644 index 0000000000000000000000000000000000000000..c4028a32881dd4d2f13738de18d2da6f40502fa5 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-color-function.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_EK","2":"_0 _WG","322":"_eI"},C:{"1":"_wO","2":"_aB _EE _L","578":"_AG"},D:{"1":"_FK","2":"_FR","322":"_eI"},E:{"1":"_eE","2":"_QB","132":"_GL _OE ND"},F:{"1":"_YJ","2":"_7 _YF _P","322":"_YK"},G:{"1":"_dE","2":"_hB","132":"gD _nL qD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_zB","2":"_6O"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:4,C:"CSS color() function",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-conic-gradients.js b/node_modules/caniuse-lite/data/features/css-conic-gradients.js new file mode 100644 index 0000000000000000000000000000000000000000..a567c7e1472a26c85786ae4fa876a9ef53b89652 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-conic-gradients.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_H _oM","2":"_m _eG _L","578":"_TJ _2E"},D:{"1":"_MN _iC","2":"_HJ","257":"_cM","450":"_ED _FE"},E:{"1":"_FF","2":"_TD"},F:{"1":"_H CC _vI","2":"_gH _uD _P","257":"AC BC","450":"_pH _TE"},G:{"1":"_kC","2":"_LD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_9E","2":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS Conical Gradients",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-container-queries-style.js b/node_modules/caniuse-lite/data/features/css-container-queries-style.js new file mode 100644 index 0000000000000000000000000000000000000000..713bc7b65823a4d9058542c91a10b0ce200184aa --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-container-queries-style.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_0 _JK","194":"r _eI","260":"_EK"},C:{"1":"I _mJ","2":"_bR _IH _MP _L"},D:{"2":"_u _JK","194":"r _eI","260":"_FK"},E:{"2":"_fG","260":"K wC _hU","772":"bC"},F:{"2":"_7 _fF _P","194":"_JJ","260":"_YJ"},G:{"2":"_nF","260":"wC _lL","772":"bC"},H:{"2":"vD"},I:{"2":"_G","260":"I"},J:{"2":"_B"},K:{"2":"_D","260":"H"},L:{"260":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_6O","260":"_zB"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Container Style Queries",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-container-queries.js b/node_modules/caniuse-lite/data/features/css-container-queries.js new file mode 100644 index 0000000000000000000000000000000000000000..45fead628e5f56b8dad398bd3a90f0bc913b967e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-container-queries.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_cT _j","2":"_zL","516":"p"},C:{"1":"_5H _t","2":"_aB _6F _L"},D:{"1":"_cT _q","2":"_8N b","194":"_JJ _BG","450":"c","516":"p"},E:{"1":"_0C","2":"_HE"},F:{"1":"_8R","2":"_2B _fH _P","194":"_2E _MB","516":"_GP d"},G:{"1":"_jB","2":"_xC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_EB","2":"_aN"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Container Queries (Size)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-container-query-units.js b/node_modules/caniuse-lite/data/features/css-container-query-units.js new file mode 100644 index 0000000000000000000000000000000000000000..edf1afa75e4adbe3485511d925e673b8724a23f3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-container-query-units.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_vO","2":"_zL"},C:{"1":"_5H _t","2":"_aB _6F _L"},D:{"1":"_EL _q","2":"_u _fF","194":"_QL","450":"_JJ _RS k"},E:{"1":"_0C","2":"_HE"},F:{"1":"_bO","2":"_2B _fH _P","194":"_2E _MB"},G:{"1":"_jB","2":"_xC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_EB","2":"_aN"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Container Query Units",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-containment.js b/node_modules/caniuse-lite/data/features/css-containment.js new file mode 100644 index 0000000000000000000000000000000000000000..e1d699b270a46432c82588f398d48d902eb9a0e8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-containment.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_tO","2":"_n _bH _L","194":"_YC _fC _FE"},D:{"1":"_rP _2K","2":"_GC","66":"5B"},E:{"1":"_uC","2":"_BH"},F:{"1":"_JM","2":"_jR","66":"_eD"},G:{"1":"_5B","2":"_YE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_gB","2":"_qC"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","194":"FE"}},B:2,C:"CSS Containment",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-content-visibility.js b/node_modules/caniuse-lite/data/features/css-content-visibility.js new file mode 100644 index 0000000000000000000000000000000000000000..2ced4f41221f37458aa774964a2af27ed954fee5 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-content-visibility.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_BM","2":"_wJ"},C:{"1":"9 _uH","2":"_aB _WG s _L","194":"_lG _bI t u _gE"},D:{"1":"_LI","2":"_uJ"},E:{"1":"_dN","2":"_fG"},F:{"1":"_LK","2":"_FP"},G:{"1":"_gD","2":"_nF"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:5,C:"CSS content-visibility",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-counters.js b/node_modules/caniuse-lite/data/features/css-counters.js new file mode 100644 index 0000000000000000000000000000000000000000..ed3c76119c5feaa3401d0c6ca118199791924c46 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-counters.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_JC","2":"_GB"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS Counters",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-crisp-edges.js b/node_modules/caniuse-lite/data/features/css-crisp-edges.js new file mode 100644 index 0000000000000000000000000000000000000000..424d9a2a9d6bdc1628158ff4c794793a78435779 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-crisp-edges.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_CQ","2340":"_sJ"},B:{"2":"_I","1025":"_K"},C:{"1":"_H _aO","2":"_LC","513":"_GJ _JD _fF","545":"_4Q GD"},D:{"1":"_hI _pE","2":"_XD","1025":"_2M _rL _IL _IH"},E:{"1":"_LB","2":"_s","164":"L","4644":"_gC _yB"},F:{"2":"_uM _9M _TH _sB","545":"_LL","1025":"_fO"},G:{"1":"_8","2":"_d","4260":"_wC","4644":"_TC _eC"},H:{"2":"vD"},I:{"2":"_G","1025":"I"},J:{"2":"D","4260":"A"},K:{"2":"_fB","545":"_JL","1025":"H"},L:{"1025":"I"},M:{"1":"VC"},N:{"2340":"_A"},O:{"1025":"YC"},P:{"1025":"_F"},Q:{"1025":"DE"},R:{"1025":"EE"},S:{"1":"GE","4097":"FE"}},B:4,C:"Crisp edges/pixelated images",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-cross-fade.js b/node_modules/caniuse-lite/data/features/css-cross-fade.js new file mode 100644 index 0000000000000000000000000000000000000000..ceb2b204c0e8aad08e7845d87e2769149651d73d --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-cross-fade.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_I","33":"_K"},C:{"2":"_S"},D:{"2":"_wN","33":"_jP _xL"},E:{"1":"_LB","2":"_3","33":"_OC _SD"},F:{"2":"_T","33":"_a"},G:{"1":"_8","2":"_d","33":"_rD _eC"},H:{"2":"vD"},I:{"2":"_W","33":"_X"},J:{"2":"_B"},K:{"2":"_D","33":"H"},L:{"33":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"33":"YC"},P:{"33":"_F"},Q:{"33":"DE"},R:{"33":"EE"},S:{"2":"_C"}},B:4,C:"CSS Cross-Fade Function",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-default-pseudo.js b/node_modules/caniuse-lite/data/features/css-default-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..24263e255276f9e789878516d4a01d1dd2c4aa3d --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-default-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_x","16":"_f"},D:{"1":"_zH","16":"_Y","132":"_iD"},E:{"1":"_HB","16":"_3","132":"_DI"},F:{"1":"_6L","16":"_5C","132":"_KD","260":"_LL"},G:{"1":"_9","16":"_o","132":"_TC _AF"},H:{"260":"vD"},I:{"1":"I","16":"_KB","132":"_NL"},J:{"16":"D","132":"A"},K:{"1":"H","16":"_bB","260":"XC"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","132":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:":default CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js b/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js new file mode 100644 index 0000000000000000000000000000000000000000..5aeb0113e91e6970930e61537989a9a3239c135e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_YH _3D _BD","16":"R"},C:{"2":"_S"},D:{"2":"_Q"},E:{"1":"B","2":"_0I _rK _XH _WH"},F:{"2":"_b"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:7,C:"Explicit descendant combinator >>",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-deviceadaptation.js b/node_modules/caniuse-lite/data/features/css-deviceadaptation.js new file mode 100644 index 0000000000000000000000000000000000000000..3c8e9a49bda6da8722acac6f03e7eb2561f4bcc4 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-deviceadaptation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","164":"_A"},B:{"66":"_K","164":"_I"},C:{"2":"_S"},D:{"2":"_iJ","66":"_WR"},E:{"2":"_R"},F:{"2":"_5O","66":"_JM"},G:{"2":"_M"},H:{"292":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"A H","292":"_YD"},L:{"2":"I"},M:{"2":"VC"},N:{"164":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"66":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Device Adaptation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-dir-pseudo.js b/node_modules/caniuse-lite/data/features/css-dir-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..f6952e8102ab3d6fd5ecf8a1def710fe9253c6e9 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-dir-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_GI","2":"_zL","194":"_NC _jN"},C:{"1":"_wD","2":"_3N","33":"_iN _3P"},D:{"1":"_3G","2":"_8N","194":"_NC _cK _gE"},E:{"1":"_RE","2":"_ZD"},F:{"1":"_QK","2":"_LR","194":"_xH p"},G:{"1":"_9C","2":"_WC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_NB","2":"_OM"},Q:{"2":"DE"},R:{"2":"EE"},S:{"1":"GE","33":"FE"}},B:5,C:":dir() CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-display-contents.js b/node_modules/caniuse-lite/data/features/css-display-contents.js new file mode 100644 index 0000000000000000000000000000000000000000..f37bcb710c67b1588b8bc1a8ae7495fe5d4dac3e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-display-contents.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_I","132":"_nG","260":"_4H"},C:{"2":"_SU qB _L","132":"_AJ _fC","260":"_TL"},D:{"2":"_NI","132":"_GJ _PF _pD","194":"_FJ _qD","260":"_3H"},E:{"2":"_2C","132":"_3B _UN","260":"_2D","772":"_gF"},F:{"2":"_SR","132":"_lC _eL _UG","260":"_aJ"},G:{"1":"_VE","2":"_zC","132":"_iK _RH","260":"_mI _lK","516":"_lI _OH tD","772":"ZC"},H:{"2":"vD"},I:{"2":"_G","260":"I"},J:{"2":"_B"},K:{"2":"_D","260":"H"},L:{"260":"I"},M:{"260":"VC"},N:{"2":"_A"},O:{"132":"YC"},P:{"2":"_4F","132":"6D _zQ","260":"_rF"},Q:{"132":"DE"},R:{"260":"EE"},S:{"132":"FE","260":"GE"}},B:4,C:"CSS display: contents",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-element-function.js b/node_modules/caniuse-lite/data/features/css-element-function.js new file mode 100644 index 0000000000000000000000000000000000000000..0137e0a651be4b0b44baa4cacd1de7a117568ac1 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-element-function.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"33":"_x","164":"_f"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_b"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"33":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"33":"_C"}},B:5,C:"CSS element() function",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-env-function.js b/node_modules/caniuse-lite/data/features/css-env-function.js new file mode 100644 index 0000000000000000000000000000000000000000..09d315c02935e942b865ea0d7f19907cd8e1c5f3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-env-function.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_0P _VC","2":"_m _qD _L"},D:{"1":"_sO","2":"_2Q"},E:{"1":"_MC","2":"_pB","132":"B"},F:{"1":"_uP _sN","2":"_aF _TE _P"},G:{"1":"_KC","2":"_WB","132":"hD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_9E","2":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:7,C:"CSS Environment Variables env()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-exclusions.js b/node_modules/caniuse-lite/data/features/css-exclusions.js new file mode 100644 index 0000000000000000000000000000000000000000..9068734f822de2e8b950ab5b62ba3b64582fbb74 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-exclusions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","33":"_A"},B:{"2":"_K","33":"_I"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_b"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"33":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Exclusions Level 1",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-featurequeries.js b/node_modules/caniuse-lite/data/features/css-featurequeries.js new file mode 100644 index 0000000000000000000000000000000000000000..b27319dc856921b1a478b9e09e7cedfe55495f4f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-featurequeries.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_RI","2":"_CF"},D:{"1":"_gO","2":"_lJ"},E:{"1":"_PB","2":"_TB"},F:{"1":"_xF","2":"_WE"},G:{"1":"_p","2":"_2"},H:{"1":"vD"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS Feature Queries",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-file-selector-button.js b/node_modules/caniuse-lite/data/features/css-file-selector-button.js new file mode 100644 index 0000000000000000000000000000000000000000..39c57afb395daff7eab8ac29348c7b73a24ec4ff --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-file-selector-button.js @@ -0,0 +1 @@ +module.exports={A:{D:{"1":"_3H","33":"_u _pD"},L:{"1":"I"},B:{"1":"_4H","33":"_0 _pD"},C:{"1":"_H _SQ","2":"_m _cC _L"},M:{"1":"VC"},A:{"2":"_Z","33":"_A"},F:{"1":"_gQ","2":"_T","33":"_PJ _eG"},K:{"1":"H","2":"_D"},E:{"1":"_UH _CE _PE","2":"SD","33":"_hF"},G:{"1":"_IE","33":"_VF"},P:{"1":"_rF","33":"_kF"},I:{"1":"I","2":"_W","33":"_w"}},B:6,C:"::file-selector-button CSS pseudo-element",D:undefined}; diff --git a/node_modules/caniuse-lite/data/features/css-filter-function.js b/node_modules/caniuse-lite/data/features/css-filter-function.js new file mode 100644 index 0000000000000000000000000000000000000000..30d872c16a88fbf8c3116d037dacc2bf847c6e82 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-filter-function.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_Q"},E:{"1":"_ND","2":"_TB","33":"F"},F:{"2":"_b"},G:{"1":"_8","2":"_2","33":"_eC"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS filter() function",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-filters.js b/node_modules/caniuse-lite/data/features/css-filters.js new file mode 100644 index 0000000000000000000000000000000000000000..22b21a8e0c3a376a20c6e4bfc37014443736f491 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-filters.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","1028":"_hQ","1346":"C"},C:{"1":"_RO","2":"_LC","196":"oB","516":"_yN GD"},D:{"1":"_fR","2":"_jL","33":"_ML _NE _kE"},E:{"1":"_ND","2":"_s","33":"_OC _sE"},F:{"1":"_JM","2":"_T","33":"_KD _eD"},G:{"1":"_kG","2":"_1","33":"_QD dD"},H:{"2":"vD"},I:{"1":"I","2":"_W","33":"_w"},J:{"2":"D","33":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_wB","33":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"CSS Filter Effects",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-first-letter.js b/node_modules/caniuse-lite/data/features/css-first-letter.js new file mode 100644 index 0000000000000000000000000000000000000000..02e9beee4f3faad649a2413599a1dc650af70564 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-first-letter.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","16":"AD","516":"E","1540":"_dD"},B:{"1":"_J"},C:{"1":"_tC","132":"cC","260":"BD"},D:{"1":"_oN _FC","16":"jB _FB","132":"J"},E:{"1":"_XB","16":"jB HD","132":"_IQ"},F:{"1":"_bD","16":"_lB","260":"B UD _nI _sB"},G:{"1":"_r","16":"_d"},H:{"1":"vD"},I:{"1":"_6B","16":"_k","132":"yD"},J:{"1":"_B"},K:{"1":"_UD","260":"_fB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"::first-letter CSS pseudo-element selector",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-first-line.js b/node_modules/caniuse-lite/data/features/css-first-line.js new file mode 100644 index 0000000000000000000000000000000000000000..8a73233f2cb7d5fcbad897c5d7fe7fc2876c9e77 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-first-line.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","132":"_c"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS first-line pseudo-element",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-fixed.js b/node_modules/caniuse-lite/data/features/css-fixed.js new file mode 100644 index 0000000000000000000000000000000000000000..a30884590ea219d71f22572cb03a89461ae8c7dd --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-fixed.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_sJ","2":"AD","8":"L"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_qM _vM _WH","1025":"LD"},F:{"1":"_b"},G:{"1":"_7B","2":"_d","132":"_oL"},H:{"2":"vD"},I:{"1":"cC _X","260":"_l","513":"_oF"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS position:fixed",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-focus-visible.js b/node_modules/caniuse-lite/data/features/css-focus-visible.js new file mode 100644 index 0000000000000000000000000000000000000000..2536a4853252c39b385a90e2feb7cdb19dce97d7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-focus-visible.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_oG _iH","2":"_I","328":"_mG"},C:{"1":"_8M _t","2":"_f","161":"_6 _VB _4D"},D:{"1":"_oG _hH","2":"_3Q","328":"_3M _fL"},E:{"1":"_uC","2":"_MI","578":"G OD kC"},F:{"1":"_H OC _LN","2":"_KR","328":"_TP _cM NC"},G:{"1":"_5B","2":"_2F","578":"rD kC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"161":"_C"}},B:5,C:":focus-visible CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-focus-within.js b/node_modules/caniuse-lite/data/features/css-focus-within.js new file mode 100644 index 0000000000000000000000000000000000000000..3a117439dc05a3d2a27d2951c9a82d50accb71e8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-focus-within.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_CM","2":"_2J"},D:{"1":"_BQ _BC","2":"_HJ","194":"dC"},E:{"1":"_HB","2":"_QB"},F:{"1":"_FN _PD","2":"_gH _uD _P","194":"0B"},G:{"1":"_9","2":"_hB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_xB","2":"_nC"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:7,C:":focus-within CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-font-palette.js b/node_modules/caniuse-lite/data/features/css-font-palette.js new file mode 100644 index 0000000000000000000000000000000000000000..46206f89bb4457c3e76a23aaa26bb219f93b2c42 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-font-palette.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_vO","2":"_zL"},C:{"1":"_aL _t","2":"_aB _JK _L"},D:{"1":"_H _QL _cH _q","2":"_u _II"},E:{"1":"_uC","2":"_BH"},F:{"1":"_pN _IR","2":"_7 _oD W _P"},G:{"1":"_5B","2":"_YE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_EB CE","2":"_0O bC"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS font-palette",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js b/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js new file mode 100644 index 0000000000000000000000000000000000000000..d8b20ebd1ed47ce20a4c52178298786feb69d8a1 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_zP _tB","2":"_IJ _uD _L","194":"_pH _EI"},D:{"1":"_BQ _BC","2":"_sG","66":"_jI _NH dC"},E:{"1":"_MC","2":"_2C"},F:{"1":"_FN _PD","2":"_9G","66":"_bC _MH"},G:{"1":"_KC","2":"_zC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_xB","2":"J","66":"_oJ"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","194":"FE"}},B:5,C:"CSS font-display",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-font-stretch.js b/node_modules/caniuse-lite/data/features/css-font-stretch.js new file mode 100644 index 0000000000000000000000000000000000000000..33b1400de4d811591aa86a49c70c96c7819d5b09 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-font-stretch.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_oN _IC","2":"_g _QG _L"},D:{"1":"_5F","2":"_8H"},E:{"1":"_oB","2":"_pB"},F:{"1":"_PI","2":"_TK"},G:{"1":"_9","2":"_hB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:"CSS font-stretch",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-gencontent.js b/node_modules/caniuse-lite/data/features/css-gencontent.js new file mode 100644 index 0000000000000000000000000000000000000000..d0b49a62bc5134e2f93fb03dce30f184c25689e2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-gencontent.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_GB","132":"E"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS Generated content for pseudo-elements",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-gradients.js b/node_modules/caniuse-lite/data/features/css-gradients.js new file mode 100644 index 0000000000000000000000000000000000000000..6b8a6053411d43141ed09f78de630fe40ad28af7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-gradients.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_8E","2":"_LC","260":"_1L _5D","292":"_DC GD"},D:{"1":"_IF","33":"_lD _UF","548":"_RC"},E:{"1":"_uC","2":"_e","260":"_xR _7Q","292":"_iG","804":"_4"},F:{"1":"_xF","2":"_OD","33":"C XD","164":"_sB"},G:{"1":"_5B","260":"_TC _YR _YG","292":"_wC","804":"_d"},H:{"2":"vD"},I:{"1":"_X","33":"_oF","548":"_KB"},J:{"1":"A","548":"D"},K:{"1":"_YB","2":"_A","33":"C","164":"_sB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS Gradients",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-grid-animation.js b/node_modules/caniuse-lite/data/features/css-grid-animation.js new file mode 100644 index 0000000000000000000000000000000000000000..d971b69e44b5379c8c7d23c1f2a1ccea901e9404 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-grid-animation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_aL _j","2":"_0 _JK"},C:{"1":"_lO","2":"_m _qQ"},D:{"1":"_aL _q","2":"_u _JK"},E:{"1":"_0C","2":"_HE"},F:{"1":"_H _JJ _ME","2":"_7 _fF _P"},G:{"1":"_jB","2":"_xC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_4B","2":"_OL"},Q:{"2":"DE"},R:{"2":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"CSS Grid animation",D:false}; diff --git a/node_modules/caniuse-lite/data/features/css-grid-lanes.js b/node_modules/caniuse-lite/data/features/css-grid-lanes.js new file mode 100644 index 0000000000000000000000000000000000000000..a22234ac5ac3eb3ea29e0a819079594a24a7b9d6 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-grid-lanes.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_rJ _KK","200":"_dK _hE"},C:{"2":"_m _5J _L","200":"_YL _KN"},D:{"2":"_wF _KK","200":"_dK _KE"},E:{"1":"_MQ","2":"_ZD","200":"_BJ _nJ"},F:{"2":"_lG 7 9 _h _uS","200":"8"},G:{"1":"_FG","2":"_WC","200":"_1K _nJ"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"200":"I"},M:{"200":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Grid Lanes",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-grid.js b/node_modules/caniuse-lite/data/features/css-grid.js new file mode 100644 index 0000000000000000000000000000000000000000..004d4ff499519cfe7e9d5b654c727bf02aeee259 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-grid.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","8":"F","292":"_A"},B:{"1":"_aE","292":"_3B"},C:{"1":"_DN _7I","2":"_uL","8":"_hC _lH _eD","584":"_2I _fJ","1025":"_RQ"},D:{"1":"_QM","2":"_rG","8":"_CG","200":"_qB _NE _3E","1025":"BC"},E:{"1":"_HB","2":"_s","8":"_1E _yB"},F:{"1":"_HF","2":"_UK","200":"_OG _sQ"},G:{"1":"_9","2":"_1","8":"_QD _AF"},H:{"2":"vD"},I:{"1":"I","2":"_0N zD","8":"_gN"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"292":"_A"},O:{"1":"YC"},P:{"1":"_gB","2":"2D","8":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS Grid Layout (level 1)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js b/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js new file mode 100644 index 0000000000000000000000000000000000000000..72c45aec237531454e46be6763a3dad4b26b8857 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_SB","132":"_LB"},F:{"2":"_b"},G:{"2":"_OB","132":"_8"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:4,C:"CSS hanging-punctuation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-has.js b/node_modules/caniuse-lite/data/features/css-has.js new file mode 100644 index 0000000000000000000000000000000000000000..f3ba08cd521ffca4830a0eda001ed850e389166b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-has.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_vO","2":"_zL"},C:{"1":"_oO","2":"_aB _xP _L","322":"_sD _cI _jN"},D:{"1":"_EL _q","2":"_u _II","194":"_QL"},E:{"1":"_uC","2":"_BH"},F:{"1":"_bO","2":"_LR"},G:{"1":"_5B","2":"_YE"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_EB","2":"_aN"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:":has() CSS relational pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-hyphens.js b/node_modules/caniuse-lite/data/features/css-hyphens.js new file mode 100644 index 0000000000000000000000000000000000000000..422b2f653ddd14ed1b5ff567357cbc86d4e6e8a0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-hyphens.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","33":"_A"},B:{"1":"_vO","33":"_I","132":"_mG _JF","260":"Y _dI _xH"},C:{"1":"_aQ","2":"_1C","33":"_dC _8D"},D:{"1":"_uO","2":"_BO","132":"_kD _cC _OR"},E:{"1":"_2D","2":"_3","33":"_gJ _SD _JG _gF"},F:{"1":"_bO","2":"_MM","132":"wB _mE _qI _MB"},G:{"1":"_VE","2":"_rC","33":"_qO _AL _mH"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_gB","2":"J","132":"2D"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS Hyphenation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-if.js b/node_modules/caniuse-lite/data/features/css-if.js new file mode 100644 index 0000000000000000000000000000000000000000..3563ac523eb9797b96ac07d75f4a168e366b5276 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-if.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_mQ","2":"_rJ _DL"},C:{"2":"_S"},D:{"1":"_nQ","2":"_wF _DL"},E:{"2":"_R"},F:{"1":"_qH CB","2":"_sD _7 _UC _P"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_N"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS if() function",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-image-orientation.js b/node_modules/caniuse-lite/data/features/css-image-orientation.js new file mode 100644 index 0000000000000000000000000000000000000000..de3ae29c517817d64e30805757cb6645d30e12f1 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-image-orientation.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_4H","2":"_I _GQ","257":"S _pD"},C:{"1":"_cR","2":"_BP"},D:{"1":"_3H","2":"_6 _yD H","257":"S _pD"},E:{"1":"_cE","2":"_KI"},F:{"1":"_YL _4K","2":"_2B _EF _P","257":"_8K _DG SC"},G:{"1":"_RD","132":"_tJ"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_rF","2":"_aH","257":"_YP"},Q:{"2":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS3 image-orientation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-image-set.js b/node_modules/caniuse-lite/data/features/css-image-set.js new file mode 100644 index 0000000000000000000000000000000000000000..45eb83951d359d230dad89875b33a04502807d55 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-image-set.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_rR","2":"_I","164":"_IB _DR","2049":"x"},C:{"1":"_wO","2":"_aB _oD _L","66":"_JF","2305":"_dI _cK _AG","2820":"Y"},D:{"1":"_sR","2":"_uF","164":"_4B _vG _DR","2049":"x"},E:{"1":"_2D","2":"_s","132":"_qJ _OE","164":"_OC _yB","1540":"_sH _CE _gF"},F:{"1":"_GS","2":"_T","164":"_sC _5N","2049":"j"},G:{"1":"_VE","2":"_1","132":"_BE _IG _9K","164":"_QD _eC","1540":"_hN _mH"},H:{"2":"vD"},I:{"1":"I","2":"_W","164":"_w"},J:{"2":"D","164":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"164":"YC"},P:{"1":"_CC","164":"_OK"},Q:{"164":"DE"},R:{"164":"EE"},S:{"2":"_C"}},B:5,C:"CSS image-set",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-in-out-of-range.js b/node_modules/caniuse-lite/data/features/css-in-out-of-range.js new file mode 100644 index 0000000000000000000000000000000000000000..c2a5dd5ca6fd5297d78383affdd5d3fcd52d5265 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-in-out-of-range.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"C","260":"_hQ"},C:{"1":"_GF","2":"_1D","516":"_qB _zO"},D:{"1":"_fR","2":"J","16":"_9I","260":"6B","772":"_BR"},E:{"1":"_HB","2":"_i","16":"jB","772":"_DI"},F:{"1":"_JM","16":"_lB","260":"_5 tB _AN","772":"_KD sB"},G:{"1":"_9","2":"_d","772":"_rD _AF"},H:{"132":"vD"},I:{"1":"I","2":"_KB","260":"_NL"},J:{"2":"D","260":"A"},K:{"1":"H","260":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","260":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","516":"FE"}},B:5,C:":in-range and :out-of-range CSS pseudo-classes",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js b/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..4a54788bfdf3a66d251e28c6e3ee81aaa477ece6 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","132":"_A","388":"F"},B:{"1":"_K","132":"_I"},C:{"1":"_pF","16":"_f","132":"_dC _iD","388":"_4"},D:{"1":"_CS","16":"_Y","132":"_KD sB"},E:{"1":"_HB","16":"_vB _e","132":"_gC A _yB","388":"ID"},F:{"1":"_5M _uB","16":"_5C","132":"_UF","516":"_LL"},G:{"1":"_9","16":"_o","132":"_TC _AF"},H:{"516":"vD"},I:{"1":"I","16":"_KB 1D","132":"0D","388":"_oF"},J:{"16":"D","132":"A"},K:{"1":"H","16":"_bB","516":"XC"},L:{"1":"I"},M:{"1":"VC"},N:{"132":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","132":"FE"}},B:5,C:":indeterminate CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-initial-letter.js b/node_modules/caniuse-lite/data/features/css-initial-letter.js new file mode 100644 index 0000000000000000000000000000000000000000..d6b03f3c7f9b63db80766e6aa25704da97a77b70 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-initial-letter.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_0 _6F","260":"_5H _j"},C:{"2":"_S"},D:{"2":"_u _6F","260":"_5H _q"},E:{"2":"_TB","260":"F","292":"_FS","420":"_FO LD _qL _tG"},F:{"2":"_MR","260":"_YJ"},G:{"2":"_2","292":"_zN","420":"_IK _tG"},H:{"2":"vD"},I:{"2":"_G","260":"I"},J:{"2":"_B"},K:{"2":"_D","260":"H"},L:{"260":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_OL","260":"_4B"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Initial Letter",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-initial-value.js b/node_modules/caniuse-lite/data/features/css-initial-value.js new file mode 100644 index 0000000000000000000000000000000000000000..1f336edd079bf10678084c65e6ff573a6b7efc72 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-initial-value.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_H _EN","33":"_Y _YU","164":"_g"},D:{"1":"_Q"},E:{"1":"_wG","16":"HD"},F:{"1":"_a","2":"_T"},G:{"1":"_dB","16":"iC"},H:{"2":"vD"},I:{"1":"_RB","16":"_k"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS initial value",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-lch-lab.js b/node_modules/caniuse-lite/data/features/css-lch-lab.js new file mode 100644 index 0000000000000000000000000000000000000000..4c011f040c2943169764d1d96be17a4c0472df04 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-lch-lab.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_EK","2":"_0 _6F","322":"u"},C:{"1":"_wO","2":"_aB _EE _L","194":"_AG"},D:{"1":"_FK","2":"_u _6F","322":"u"},E:{"1":"_eE","2":"_MI"},F:{"1":"_YJ","2":"_MR"},G:{"1":"_dE","2":"_2F"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_zB","2":"_6O"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:4,C:"LCH and Lab color values",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-letter-spacing.js b/node_modules/caniuse-lite/data/features/css-letter-spacing.js new file mode 100644 index 0000000000000000000000000000000000000000..f3fb1dc96ff0476bdfe852b7b192a4491bba52f6 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-letter-spacing.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","16":"AD","132":"_FB"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_DK","132":"_kJ"},E:{"1":"_iB","16":"HD","132":"_vB iC ID"},F:{"1":"_3J","16":"_lB","132":"_5 _9B _AN"},G:{"1":"_dB","16":"iC"},H:{"2":"vD"},I:{"1":"_X","16":"_k","132":"_mL"},J:{"132":"_B"},K:{"1":"H","132":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"letter-spacing CSS property",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-line-clamp.js b/node_modules/caniuse-lite/data/features/css-line-clamp.js new file mode 100644 index 0000000000000000000000000000000000000000..2452d728c7be3836c4febbce03acf43a1d9aa7d1 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-line-clamp.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_ZB","33":"_K","129":"_8B"},C:{"2":"_m _EF _L","33":"_7R"},D:{"16":"_4E","33":"_7M _FC"},E:{"2":"_i","33":"_mB"},F:{"2":"_T","33":"_a"},G:{"2":"_d","33":"_r"},H:{"2":"vD"},I:{"16":"_k","33":"_RB"},J:{"33":"_B"},K:{"2":"_D","33":"H"},L:{"33":"I"},M:{"33":"VC"},N:{"2":"_A"},O:{"33":"YC"},P:{"33":"_F"},Q:{"33":"DE"},R:{"33":"EE"},S:{"2":"FE","33":"GE"}},B:5,C:"CSS line-clamp",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-logical-props.js b/node_modules/caniuse-lite/data/features/css-logical-props.js new file mode 100644 index 0000000000000000000000000000000000000000..6f7d36d3e7a569c73e1a5db6a2fce7754aa446e4 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-logical-props.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_4H","2":"_I","1028":"_1P","1540":"_mG W"},C:{"1":"_lO","2":"BD","164":"cC _XD _L","1540":"_YC _fC _AD"},D:{"1":"_3H","292":"_2Q","1028":"_1P","1540":"_gK _fL W"},E:{"1":"_eE","292":"_TD","1540":"_AC _AE","3076":"ND"},F:{"1":"_aJ","2":"_T","292":"_iD _TE","1028":"_DG","1540":"AC _dM DC _lE"},G:{"1":"_dE","292":"_LD","1540":"_oI","3076":"qD"},H:{"2":"vD"},I:{"1":"I","292":"_G"},J:{"292":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_rF","292":"_MD","1540":"_zQ"},Q:{"1540":"DE"},R:{"1":"EE"},S:{"1":"GE","1540":"FE"}},B:5,C:"CSS Logical Properties",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-marker-pseudo.js b/node_modules/caniuse-lite/data/features/css-marker-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..36bdb0062c4b327c2a2de65f619038c196c2b55b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-marker-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_oG _iH","2":"_0 _oD"},C:{"1":"_7R","2":"_m _EF _L"},D:{"1":"_oG _hH","2":"_u _oD"},E:{"2":"_2C","132":"_MC"},F:{"1":"_H OC _LN","2":"_2B _0J _P"},G:{"2":"_zC","132":"_KC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS ::marker pseudo-element",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-masks.js b/node_modules/caniuse-lite/data/features/css-masks.js new file mode 100644 index 0000000000000000000000000000000000000000..a848826a2599328b51a421e8421af1a76ee7f04a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-masks.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_GI","2":"_ZB","164":"_NC _wH","3138":"P","12292":"Q"},C:{"1":"_FM","2":"_g","260":"_GC _UU"},D:{"1":"_3G","164":"_NC _yG"},E:{"1":"_uC","2":"_e","164":"_DC _SD _XN"},F:{"1":"_QK","2":"_T","164":"_sC _BL"},G:{"1":"_5B","164":"_YE"},H:{"2":"vD"},I:{"1":"I","164":"_w","676":"_W"},J:{"164":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"164":"YC"},P:{"1":"_NB","164":"_OM"},Q:{"164":"DE"},R:{"164":"EE"},S:{"1":"GE","260":"FE"}},B:4,C:"CSS Masks",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-matches-pseudo.js b/node_modules/caniuse-lite/data/features/css-matches-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..670a1c68cfb89decc8f0b4596232afd41f75f92e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-matches-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_zR","2":"_I","1220":"_mG _JF"},C:{"1":"_yO","2":"_f","548":"_6 _HL"},D:{"1":"_uO","16":"_Y","164":"_RF _qD","196":"HC IC JC","1220":"_8K _fL _JF"},E:{"1":"_7L","2":"_i","16":"jB","164":"_FB _UJ","260":"F _qJ LD _OE"},F:{"1":"_gQ","2":"_T","164":"_BR","196":"_lC","1220":"_eL _eG"},G:{"1":"_tH","16":"_o","164":"_TC","260":"_ZR"},H:{"2":"vD"},I:{"1":"I","16":"_KB","164":"_NL"},J:{"16":"D","164":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_rF","164":"_kF"},Q:{"1220":"DE"},R:{"1":"EE"},S:{"1":"GE","548":"FE"}},B:5,C:":is() CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-math-functions.js b/node_modules/caniuse-lite/data/features/css-math-functions.js new file mode 100644 index 0000000000000000000000000000000000000000..d0ccc7415c795194865a25657b2548e4f9fed712 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-math-functions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_H _TJ _KN","2":"_m _eG _L"},D:{"1":"_H _vH","2":"_6 _fH"},E:{"1":"_cE","2":"_2C","132":"_JB _8P"},F:{"1":"_HN _mD","2":"_KR"},G:{"1":"_RD","2":"_zC","132":"_iK _RH"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_cJ","2":"_jO"},Q:{"2":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS math functions min(), max() and clamp()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-media-interaction.js b/node_modules/caniuse-lite/data/features/css-media-interaction.js new file mode 100644 index 0000000000000000000000000000000000000000..88bfafd7ab2d420041b5b9a345f249043963a655 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-media-interaction.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_hR","2":"_m _rB _L"},D:{"1":"_9J","2":"_XD"},E:{"1":"_PB","2":"_TB"},F:{"1":"_fO","2":"_UK"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"Media Queries: interaction media features",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-media-range-syntax.js b/node_modules/caniuse-lite/data/features/css-media-range-syntax.js new file mode 100644 index 0000000000000000000000000000000000000000..e303bb0416db55ac9a7b860c1504faa093dc40a0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-media-range-syntax.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_eQ _j","2":"_0 _NK"},C:{"1":"_NM","2":"_wL"},D:{"1":"_eQ _q","2":"_u _NK"},E:{"1":"_RE","2":"_ZD"},F:{"1":"_bO","2":"_LR"},G:{"1":"_9C","2":"_WC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_EB","2":"_aN"},Q:{"2":"DE"},R:{"2":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"Media Queries: Range Syntax",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-media-resolution.js b/node_modules/caniuse-lite/data/features/css-media-resolution.js new file mode 100644 index 0000000000000000000000000000000000000000..a46f65ee0b20f320eca03647a2401dd671568fde --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-media-resolution.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_c","132":"_V"},B:{"1":"_K","1028":"_I"},C:{"1":"_TL","2":"_g","260":"_DC _L","1028":"_1L _wE"},D:{"1":"_VN _iC","548":"_iJ","1028":"_qB _wE _EF"},E:{"1":"_0C","2":"_e","548":"_DC _SD _JG"},F:{"1":"_H _6I XC","2":"F","548":"_5 _EJ","1028":"_iD _fD"},G:{"1":"_jB","16":"iC","548":"_PR _AL"},H:{"132":"vD"},I:{"1":"I","16":"_k","548":"_mL","1028":"_w"},J:{"548":"_B"},K:{"1":"_YB","548":"_bB"},L:{"1":"I"},M:{"1":"VC"},N:{"132":"_A"},O:{"1":"YC"},P:{"1":"_9E","1028":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Media Queries: resolution feature",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-media-scripting.js b/node_modules/caniuse-lite/data/features/css-media-scripting.js new file mode 100644 index 0000000000000000000000000000000000000000..0bca25f8937e2863d1eeb8984f26790262b03c58 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-media-scripting.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_b"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"Media Queries: scripting media feature",D:false}; diff --git a/node_modules/caniuse-lite/data/features/css-mediaqueries.js b/node_modules/caniuse-lite/data/features/css-mediaqueries.js new file mode 100644 index 0000000000000000000000000000000000000000..18c857b4073c27ce9d8b5d5f8457036ffbffe408 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-mediaqueries.js @@ -0,0 +1 @@ +module.exports={A:{A:{"8":"_c","129":"_V"},B:{"1":"_J"},C:{"1":"_tC","2":"_g"},D:{"1":"_IF","129":"_jJ"},E:{"1":"_iB","129":"_vB ID","388":"_e"},F:{"1":"_nB","2":"F"},G:{"1":"_z","129":"_o"},H:{"1":"vD"},I:{"1":"_X","129":"_W"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"129":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS3 Media Queries",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-mixblendmode.js b/node_modules/caniuse-lite/data/features/css-mixblendmode.js new file mode 100644 index 0000000000000000000000000000000000000000..5407318dd08178518bf3bb8c38ff9aa635f57eb7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-mixblendmode.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_OO","2":"_DP"},D:{"1":"_9J","2":"_iJ","194":"_qB _8G"},E:{"2":"_4C","260":"_VI"},F:{"1":"_NO","2":"_JS"},G:{"2":"_DB","260":"_7B"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Blending of HTML/SVG elements",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-module-scripts.js b/node_modules/caniuse-lite/data/features/css-module-scripts.js new file mode 100644 index 0000000000000000000000000000000000000000..e6796dff5630f764e19875f3cb724549c4086aa0 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-module-scripts.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_XG _j","2":"_0 _fF","132":"_lG _kR _gE"},C:{"2":"_S"},D:{"1":"_XG _q","2":"_u _fF","132":"_lG _kR _gE"},E:{"2":"_R"},F:{"16":"_b"},G:{"2":"_M"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"194":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:1,C:"CSS Module Scripts",D:false}; diff --git a/node_modules/caniuse-lite/data/features/css-motion-paths.js b/node_modules/caniuse-lite/data/features/css-motion-paths.js new file mode 100644 index 0000000000000000000000000000000000000000..07f78ad8174cf07e8a84580807aaa6e573ce7cb3 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-motion-paths.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_H _7P _VC","2":"_m _0J _L"},D:{"1":"_ZJ _jD","2":"_LE","194":"_uD"},E:{"1":"_0C","2":"_HE"},F:{"1":"_IN _PG","2":"_UM","194":"MB _OQ"},G:{"1":"_jB","2":"_xC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS Motion Path",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-namespaces.js b/node_modules/caniuse-lite/data/features/css-namespaces.js new file mode 100644 index 0000000000000000000000000000000000000000..24be2cc0ebe41caa32b2b90aebc44fb107ce2919 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-namespaces.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_CB","16":"_e"},F:{"1":"_b"},G:{"1":"_rO","16":"_rC"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS namespaces",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-nesting.js b/node_modules/caniuse-lite/data/features/css-nesting.js new file mode 100644 index 0000000000000000000000000000000000000000..72031a7259505606d91f256f757ac870d2cf25ef --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-nesting.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_GI","2":"_0 _WG s","194":"t u v","516":"_NC w x _aI"},C:{"1":"_jG _XF _t","2":"_aB _iF y _L","322":"0 z"},D:{"1":"_3G","2":"_FR s","194":"t u v","516":"_NC w x _aI"},E:{"1":"K _hM _vQ","2":"_ZD pC","516":"qC QD _gM"},F:{"1":"_QK","2":"_7 _YF _P","194":"_YK","516":"_BG p"},G:{"1":"_hM _2O","2":"_WC pC","516":"qC tD _gM"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_NB","2":"_OK","516":"_GH"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Nesting",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-not-sel-list.js b/node_modules/caniuse-lite/data/features/css-not-sel-list.js new file mode 100644 index 0000000000000000000000000000000000000000..eae0a0e95f534fae0c115b9328a7a2b252d9dcd7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-not-sel-list.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_zR","2":"_I _3D _OR","16":"R"},C:{"1":"_wP _t","2":"_aB T _L"},D:{"1":"_uO","2":"_u _OR"},E:{"1":"_PB","2":"_TB"},F:{"1":"_gQ","2":"_2B _eG _P"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_rF","2":"_kF"},Q:{"2":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"selector list argument of :not()",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-nth-child-of.js b/node_modules/caniuse-lite/data/features/css-nth-child-of.js new file mode 100644 index 0000000000000000000000000000000000000000..6942c2932ac30e8734253b11641b7b3d7c0787ec --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-nth-child-of.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_EK","2":"_0 _EE"},C:{"1":"_wO","2":"_aB _DR _L"},D:{"1":"_FK","2":"_u _EE"},E:{"1":"_PB","2":"_TB"},F:{"1":"_YJ","2":"_MR"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_zB","2":"_6O"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"selector list argument of :nth-child and :nth-last-child CSS pseudo-classes",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-opacity.js b/node_modules/caniuse-lite/data/features/css-opacity.js new file mode 100644 index 0000000000000000000000000000000000000000..246137c39363f8c0774e1e8f4958f8f9e75d1ca9 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-opacity.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","4":"_c"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS3 Opacity",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-optional-pseudo.js b/node_modules/caniuse-lite/data/features/css-optional-pseudo.js new file mode 100644 index 0000000000000000000000000000000000000000..4e7b7c5869fa83a1c37d40380ca2dea1c37e155e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-optional-pseudo.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_x","2":"_f"},D:{"1":"_WD","16":"_Y"},E:{"1":"_mB","2":"_i"},F:{"1":"_a","16":"_lB","132":"_xQ"},G:{"1":"_r","2":"_d"},H:{"132":"vD"},I:{"1":"_RB","16":"_k"},J:{"1":"_B"},K:{"1":"H","132":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:5,C:":optional CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-overflow-anchor.js b/node_modules/caniuse-lite/data/features/css-overflow-anchor.js new file mode 100644 index 0000000000000000000000000000000000000000..6f9023229c13b165ebf7ab16b05de5e7d60d3048 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-overflow-anchor.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_lO","2":"_m _qQ"},D:{"1":"_MK","2":"_GC _TE"},E:{"1":"SD","2":"_4N"},F:{"1":"_VL","2":"_aR"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS overflow-anchor (Scroll Anchoring)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-overflow-overlay.js b/node_modules/caniuse-lite/data/features/css-overflow-overlay.js new file mode 100644 index 0000000000000000000000000000000000000000..746750fa9b258a660c0b923e3f3051a46737e718 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-overflow-overlay.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_IB _iF","2":"_I","130":"_rR"},C:{"2":"_S"},D:{"1":"_RF _cC _iF","16":"_Y","130":"_sR"},E:{"1":"_MG _SD _GD","16":"_e","130":"_BI"},F:{"1":"_sC _eH","2":"_T","130":"_GS"},G:{"1":"_PR _3O","16":"iC","130":"_VJ"},H:{"2":"vD"},I:{"1":"_G","130":"I"},J:{"16":"_B"},K:{"1":"H","2":"_D"},L:{"130":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:7,C:"CSS overflow: overlay",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-overflow.js b/node_modules/caniuse-lite/data/features/css-overflow.js new file mode 100644 index 0000000000000000000000000000000000000000..9e082dcdae74ecec7013eb3783ff2140e3d14df7 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-overflow.js @@ -0,0 +1 @@ +module.exports={A:{A:{"388":"_E"},B:{"1":"_ZL _j","260":"_nG Z","388":"_I"},C:{"1":"_H S _SQ","260":"eC _yD H","388":"_sL _CD _L"},D:{"1":"_ZL _q","260":"_8K _PF _GO","388":"_6 _EF"},E:{"1":"_0C","260":"_sH MD _CE","388":"_KI"},F:{"1":"_aJ","260":"_eL _UG","388":"_aF _fD _P"},G:{"1":"_jB","260":"_mI _lK","388":"_tJ"},H:{"388":"vD"},I:{"1":"I","388":"_G"},J:{"388":"_B"},K:{"1":"H","388":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"388":"_A"},O:{"388":"YC"},P:{"1":"_rF","388":"_kF"},Q:{"388":"DE"},R:{"1":"EE"},S:{"1":"GE","388":"FE"}},B:5,C:"CSS overflow property",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js b/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js new file mode 100644 index 0000000000000000000000000000000000000000..72c3968bbb18491c027464faaa349249e9d7d546 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","132":"_A"},B:{"1":"_K","132":"_1F","516":"Q"},C:{"1":"_9P _tB","2":"_sL _L"},D:{"1":"_RM","2":"_2N","260":"FC GC"},E:{"1":"_0C","2":"_hF","1090":"G _CE"},F:{"1":"_SI","2":"_9O","260":"4B 5B"},G:{"1":"_jB","2":"_VF","1090":"_lK"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"132":"_A"},O:{"1":"YC"},P:{"1":"_xB","2":"_nC"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS overscroll-behavior",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-page-break.js b/node_modules/caniuse-lite/data/features/css-page-break.js new file mode 100644 index 0000000000000000000000000000000000000000..bc796369eeefc43ffabed16276245541d071c3b2 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-page-break.js @@ -0,0 +1 @@ +module.exports={A:{A:{"388":"_A","900":"_Z"},B:{"388":"_I","641":"_1H _j","900":"_IB _WG"},C:{"772":"_0P _VC","900":"_m _qD _L"},D:{"641":"_1H _q","900":"_FR"},E:{"772":"A","900":"_RC _zI _XH _WH"},F:{"16":"_lB","129":"_xQ","641":"_8R","900":"_sC _7G"},G:{"900":"_M"},H:{"129":"vD"},I:{"641":"I","900":"_G"},J:{"900":"_B"},K:{"129":"_D","641":"H"},L:{"900":"I"},M:{"772":"VC"},N:{"388":"_A"},O:{"900":"YC"},P:{"641":"_4B","900":"_OL"},Q:{"900":"DE"},R:{"900":"EE"},S:{"772":"GE","900":"FE"}},B:2,C:"CSS page-break properties",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-paged-media.js b/node_modules/caniuse-lite/data/features/css-paged-media.js new file mode 100644 index 0000000000000000000000000000000000000000..607822da1bf1fe60469b428aa11505fd8f834044 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-paged-media.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_GB","132":"_JC"},B:{"1":"_K","132":"_I"},C:{"1":"_SL _dG","2":"_uL","132":"_hC _AR _YF"},D:{"1":"_WD","16":"_Y"},E:{"1":"_NQ","2":"_fG _oE"},F:{"1":"_a","132":"_T"},G:{"1":"_lL","2":"_nF _oE"},H:{"16":"vD"},I:{"16":"_O"},J:{"16":"_B"},K:{"1":"H","16":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"258":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"132":"_C"}},B:5,C:"CSS Paged Media (@page)",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-paint-api.js b/node_modules/caniuse-lite/data/features/css-paint-api.js new file mode 100644 index 0000000000000000000000000000000000000000..3740a23894015a0d559b4bde0e4082600b1ad5aa --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-paint-api.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_RM","2":"_4Q"},E:{"2":"_TD","194":"_FF"},F:{"1":"_SI","2":"_SR"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_sF","2":"_4F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"2":"_C"}},B:4,C:"CSS Painting API",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-placeholder-shown.js b/node_modules/caniuse-lite/data/features/css-placeholder-shown.js new file mode 100644 index 0000000000000000000000000000000000000000..8de00bcce167a6e9a5f1bbf528893c7157a284cd --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-placeholder-shown.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","292":"_A"},B:{"1":"_K","2":"_I"},C:{"1":"_pF","2":"_f","164":"_GC"},D:{"1":"_eO","2":"_xN"},E:{"1":"_PB","2":"_TB"},F:{"1":"_SO","2":"_8O"},G:{"1":"_p","2":"_2"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","164":"FE"}},B:5,C:":placeholder-shown CSS pseudo-class",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-placeholder.js b/node_modules/caniuse-lite/data/features/css-placeholder.js new file mode 100644 index 0000000000000000000000000000000000000000..d3a66860a30adcd7eef4cbdfca358118ad1f90fc --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-placeholder.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","36":"_I"},C:{"1":"_pF","33":"_hC _NE","130":"_uL"},D:{"1":"_qF","36":"_jF"},E:{"1":"_HB","2":"_i","36":"jB _DI"},F:{"1":"_HF","2":"_T","36":"_8D xB"},G:{"1":"_9","2":"_rC","36":"_qO _AF"},H:{"2":"vD"},I:{"1":"I","36":"_G"},J:{"36":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"36":"_A"},O:{"1":"YC"},P:{"1":"_wB","36":"_1B"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","33":"FE"}},B:5,C:"::placeholder CSS pseudo-element",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-print-color-adjust.js b/node_modules/caniuse-lite/data/features/css-print-color-adjust.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e89fef76a19c07aba52599594c577cf5a4ba2a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-print-color-adjust.js @@ -0,0 +1 @@ +module.exports={A:{D:{"1":"UB _nQ","2":"_wN","33":"_jP _hC _vG _3K _fI TB"},L:{"1":"I"},B:{"1":"UB _mQ","2":"_I","33":"_kN _3K _fI TB"},C:{"1":"_yH _dG","2":"_WK","33":"_0M _ID _VB _5G"},M:{"1":"VC"},A:{"2":"_E"},F:{"1":"_qH CB","2":"_T","33":"_sD _sC _UC"},K:{"2":"_D","33":"H"},E:{"1":"_AT _PE","2":"_s SD","33":"_gJ _7Q"},G:{"1":"_5B","2":"_1","33":"_QD _YR _YG"},P:{"1":"_qB","33":"_NN _CG _vE"},I:{"1":"I","2":"_W","33":"_w"}},B:6,C:"print-color-adjust property",D:undefined}; diff --git a/node_modules/caniuse-lite/data/features/css-read-only-write.js b/node_modules/caniuse-lite/data/features/css-read-only-write.js new file mode 100644 index 0000000000000000000000000000000000000000..a1a0613c287c17dffda421176cc686c788992852 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-read-only-write.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_xD","2":"C"},C:{"1":"_yO","16":"BD","33":"_qP _6R"},D:{"1":"_2H","16":"_Y","132":"_LG"},E:{"1":"_PB","16":"_e","132":"_QG _UJ"},F:{"1":"_GM","16":"_JR","132":"C _0B _PL"},G:{"1":"_p","16":"_rC","132":"_qO"},H:{"2":"vD"},I:{"1":"I","16":"_k","132":"_1N"},J:{"1":"A","132":"D"},K:{"1":"H","2":"_A WC","132":"C _TQ"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","33":"FE"}},B:1,C:"CSS :read-only and :read-write selectors",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-rebeccapurple.js b/node_modules/caniuse-lite/data/features/css-rebeccapurple.js new file mode 100644 index 0000000000000000000000000000000000000000..46da8e87d9d7e80c5acf6f64d3ade99e0d08accf --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-rebeccapurple.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_y","132":"B"},B:{"1":"_J"},C:{"1":"_mO","2":"_ZI"},D:{"1":"_7J","2":"_6E"},E:{"1":"_6C","2":"_3C","16":"JD"},F:{"1":"_3F","2":"_YI"},G:{"1":"_7B","2":"_DB"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"Rebeccapurple color",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-reflections.js b/node_modules/caniuse-lite/data/features/css-reflections.js new file mode 100644 index 0000000000000000000000000000000000000000..1ce8a09daf8b5a99aad47b3d587f1c7674ba9c18 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-reflections.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_I","33":"_K"},C:{"2":"_S"},D:{"33":"_Q"},E:{"2":"_e","33":"_CB"},F:{"2":"_T","33":"_a"},G:{"33":"_M"},H:{"2":"vD"},I:{"33":"_O"},J:{"33":"_B"},K:{"2":"_D","33":"H"},L:{"33":"I"},M:{"2":"VC"},N:{"2":"_A"},O:{"33":"YC"},P:{"33":"_F"},Q:{"33":"DE"},R:{"33":"EE"},S:{"2":"_C"}},B:7,C:"CSS Reflections",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-regions.js b/node_modules/caniuse-lite/data/features/css-regions.js new file mode 100644 index 0000000000000000000000000000000000000000..e951e245f6ad17a1520b891ba810a7242fd13d1f --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-regions.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","420":"_A"},B:{"2":"_K","420":"_I"},C:{"2":"_S"},D:{"2":"_H _Y pB _TG","36":"_UB","66":"_hC _7H"},E:{"2":"_vB _rK _VH _xS","33":"_sJ _6Q"},F:{"2":"_b"},G:{"2":"_o _KC","33":"_TC _iT"},H:{"2":"vD"},I:{"2":"_O"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"VC"},N:{"420":"_A"},O:{"2":"YC"},P:{"2":"_F"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Regions",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-relative-colors.js b/node_modules/caniuse-lite/data/features/css-relative-colors.js new file mode 100644 index 0000000000000000000000000000000000000000..1a8b1aad0a78088a42831763a297b9ba6698db6b --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-relative-colors.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_PP _MF _hE","2":"_KF _CO","194":"2","260":"3 _XF _gI PB"},C:{"1":"_MF _gG","2":"_oC _LF _L","260":"_EG"},D:{"1":"_PP _MF _KE","2":"_KF _yG","194":"2","260":"3 _XF _gI PB"},E:{"1":"_dN","2":"_ZD","260":"_BJ"},F:{"1":"_jG _XF CB","2":"_7 _NK _P","194":"o p","260":"0 _SS _eI _gE"},G:{"1":"_gD","2":"_WC","260":"_1K"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_D","260":"H"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"2":"_OM","260":"_NB"},Q:{"2":"DE"},R:{"2":"EE"},S:{"2":"_C"}},B:5,C:"CSS Relative color syntax",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-repeating-gradients.js b/node_modules/caniuse-lite/data/features/css-repeating-gradients.js new file mode 100644 index 0000000000000000000000000000000000000000..42d68e7871c176a98a0c7c834642fa6d1c890e46 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-repeating-gradients.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_FI","2":"_LC","33":"_DC GD"},D:{"1":"_IF","2":"_RC","33":"_lD _UF"},E:{"1":"_iB","2":"_3","33":"_iG"},F:{"1":"_xF","2":"_OD","33":"C XD","36":"_sB"},G:{"1":"_z","2":"_d","33":"_wC"},H:{"2":"vD"},I:{"1":"_X","2":"_KB","33":"_oF"},J:{"1":"A","2":"D"},K:{"1":"_YB","2":"_A","33":"C","36":"_sB"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS Repeating Gradients",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-resize.js b/node_modules/caniuse-lite/data/features/css-resize.js new file mode 100644 index 0000000000000000000000000000000000000000..ff8d315221cf4afb14f32dd5d792db3616d129f4 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-resize.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_GU _IC","2":"_f","33":"J"},D:{"1":"_Q"},E:{"1":"_CB","2":"_e"},F:{"1":"_a","2":"_WE","132":"XC"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_U","2":"J"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:2,C:"CSS resize property",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-revert-value.js b/node_modules/caniuse-lite/data/features/css-revert-value.js new file mode 100644 index 0000000000000000000000000000000000000000..cbb4b33da733ee7de6f7153599a9c356a037678a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-revert-value.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_2R","2":"_0 T"},C:{"1":"_uR","2":"_m _mC _L"},D:{"1":"_3R","2":"_u T"},E:{"1":"_ND","2":"_CI"},F:{"1":"_bJ","2":"_PS"},G:{"1":"_kG","2":"_AI"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_tD","2":"_XE"},Q:{"2":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"CSS revert value",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-rrggbbaa.js b/node_modules/caniuse-lite/data/features/css-rrggbbaa.js new file mode 100644 index 0000000000000000000000000000000000000000..a567162060f2b29689bb8ae598dc97b7913743e8 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-rrggbbaa.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_wD","2":"_VM"},D:{"1":"_H _BC","2":"_9N","194":"_lC _kD"},E:{"1":"_LB","2":"_SB"},F:{"1":"_SI","2":"_XO","194":"_oH _fJ"},G:{"1":"_8","2":"_OB"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_xB","2":"J","194":"_oJ"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"#rrggbbaa hex color notation",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-scroll-behavior.js b/node_modules/caniuse-lite/data/features/css-scroll-behavior.js new file mode 100644 index 0000000000000000000000000000000000000000..0d477e4eb421bb215bb23231e844a281e9439360 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-scroll-behavior.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"2":"_I","129":"_K"},C:{"1":"_8E","2":"_WI"},D:{"2":"_XD","129":"_AH","450":"_YC _mE _CD"},E:{"1":"_uC","2":"_VR","578":"_sH _0K"},F:{"2":"_UK","129":"_HI","450":"_OG _uN"},G:{"1":"_5B","2":"_VF","578":"_YG"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"129":"YC"},P:{"1":"_xB","2":"_nC"},Q:{"129":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:5,C:"CSS Scroll-behavior",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-scrollbar.js b/node_modules/caniuse-lite/data/features/css-scrollbar.js new file mode 100644 index 0000000000000000000000000000000000000000..9b11a99539d81b360ddf2317c07148f48be5ebaf --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-scrollbar.js @@ -0,0 +1 @@ +module.exports={A:{A:{"132":"_E"},B:{"1":"_qH _j","2":"_I","292":"_sD _wH"},C:{"1":"_hR","2":"_wL","3138":"FC"},D:{"1":"_qH _q","292":"_sD _yG"},E:{"1":"K _iM _kT","16":"_3","292":"_gJ _SD _qL _wQ"},F:{"1":"_aL CB","2":"_T","292":"_sC _JK"},G:{"1":"_iM _FG","2":"_hN _oK _wQ","16":"_o","292":"bD","804":"_yJ _9K"},H:{"2":"vD"},I:{"16":"_k","292":"_RB"},J:{"292":"_B"},K:{"2":"_D","292":"H"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"292":"YC"},P:{"1":"_NB","292":"_OM"},Q:{"292":"DE"},R:{"292":"EE"},S:{"2":"_C"}},B:4,C:"CSS scrollbar styling",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-sel2.js b/node_modules/caniuse-lite/data/features/css-sel2.js new file mode 100644 index 0000000000000000000000000000000000000000..e80db498ed6fbddb5f9b90c11e6dbed0393a1146 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-sel2.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_sJ","2":"AD","8":"L"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_b"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS 2.1 selectors",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-sel3.js b/node_modules/caniuse-lite/data/features/css-sel3.js new file mode 100644 index 0000000000000000000000000000000000000000..8588308690dbeb6be10a6ce715b0f9d54d04f09a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-sel3.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"AD","8":"L","132":"_QJ"},B:{"1":"_J"},C:{"1":"_tC","2":"_g"},D:{"1":"_Q"},E:{"1":"_wG","2":"HD"},F:{"1":"_nB","2":"F"},G:{"1":"_M"},H:{"1":"vD"},I:{"1":"_O"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:2,C:"CSS3 selectors",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-selection.js b/node_modules/caniuse-lite/data/features/css-selection.js new file mode 100644 index 0000000000000000000000000000000000000000..10f82a7a65a7229d76d71a422b3cdeb63014b45a --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-selection.js @@ -0,0 +1 @@ +module.exports={A:{A:{"1":"_V","2":"_c"},B:{"1":"_J"},C:{"1":"_TL","33":"_m _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_nB","2":"F"},G:{"2":"_M"},H:{"2":"vD"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"_EQ _TQ","16":"_A WC"},L:{"1":"I"},M:{"1":"VC"},N:{"1":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","33":"FE"}},B:5,C:"::selection CSS pseudo-element",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-shapes.js b/node_modules/caniuse-lite/data/features/css-shapes.js new file mode 100644 index 0000000000000000000000000000000000000000..966b84bb40d7aa2fcc4a277a27c4739b5cc1795e --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-shapes.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_TL","2":"_NR","322":"_ID"},D:{"1":"_UI","2":"_yN","194":"_jE qB"},E:{"1":"_HB","2":"_4C","33":"_6H _lF"},F:{"1":"_6G","2":"_SK"},G:{"1":"_9","2":"_DB","33":"_jC _AF"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"CSS Shapes Level 1",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-snappoints.js b/node_modules/caniuse-lite/data/features/css-snappoints.js new file mode 100644 index 0000000000000000000000000000000000000000..b430916bc8cb2c967c7ed585dbfff7b777885797 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-snappoints.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_Z","6308":"A","6436":"B"},B:{"1":"_K","6436":"_I"},C:{"1":"_7R","2":"_PN sB _L","2052":"_oH _fC _EF"},D:{"1":"_sO","2":"_1Q","8258":"_TP"},E:{"1":"_oB","2":"_TB","3108":"_5R"},F:{"1":"_8F","2":"_XK","8258":"8B _eL _rB"},G:{"1":"_AB","2":"_2","3108":"_HD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_9E","2":"_MD"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"GE","2052":"FE"}},B:4,C:"CSS Scroll Snap",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-sticky.js b/node_modules/caniuse-lite/data/features/css-sticky.js new file mode 100644 index 0000000000000000000000000000000000000000..f2b91d95feebf3a652bef1c5d8c74a945d9349dd --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-sticky.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_lR","2":"_3B","1028":"_IB _MB","4100":"_GE"},C:{"1":"_9P _tB","2":"_BP","194":"_zK lB","516":"_5I _bC _mE"},D:{"1":"_mR","2":"_hJ _AJ _fJ","322":"_CC _eJ _lC 9B","1028":"AC _RG _cC _MB"},E:{"1":"_ZE","2":"_3C","33":"_gT _lF _pL","2084":"D JD"},F:{"1":"_2P _4K","2":"_XO","322":"tB uB vB","1028":"wB _vN _HL"},G:{"1":"_UE","2":"_1","33":"_yJ kD","2084":"aD bD"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_gB","2":"_qC"},Q:{"1028":"DE"},R:{"1":"EE"},S:{"1":"GE","516":"FE"}},B:5,C:"CSS position:sticky",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-subgrid.js b/node_modules/caniuse-lite/data/features/css-subgrid.js new file mode 100644 index 0000000000000000000000000000000000000000..2c2d4e2b95bd3724e818fe8e8ee9ce32721fc041 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-subgrid.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_jG _GI","2":"_DO","194":"0 _aI"},C:{"1":"_MN _VC","2":"_m _nD _L"},D:{"1":"_jG _3G","2":"_GR","194":"0 _aI"},E:{"1":"_0C","2":"_HE"},F:{"1":"_H _cI _cH CB","2":"_7 _eH _P","194":"_TS"},G:{"1":"_jB","2":"_xC"},H:{"2":"vD"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"2":"YC"},P:{"1":"_WF","2":"_aT GB _vE"},Q:{"2":"DE"},R:{"2":"EE"},S:{"1":"GE","2":"FE"}},B:4,C:"CSS Subgrid",D:true}; diff --git a/node_modules/caniuse-lite/data/features/css-supports-api.js b/node_modules/caniuse-lite/data/features/css-supports-api.js new file mode 100644 index 0000000000000000000000000000000000000000..d4eb9116caad3d86ccdca3fc0c1c9818a029ce90 --- /dev/null +++ b/node_modules/caniuse-lite/data/features/css-supports-api.js @@ -0,0 +1 @@ +module.exports={A:{A:{"2":"_E"},B:{"1":"_K","260":"_I"},C:{"1":"_XJ","2":"_n _aC _L","66":"_FH","260":"_zB _LO"},D:{"1":"_AH","2":"_lJ","260":"_OG _OJ _CD"},E:{"1":"_PB","2":"_TB"},F:{"1":"_a","2":"_WE","132":"XC"},G:{"1":"_p","2":"_2"},H:{"132":"vD"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_bB","132":"XC"},L:{"1":"I"},M:{"1":"VC"},N:{"2":"_A"},O:{"1":"YC"},P:{"1":"_F"},Q:{"1":"DE"},R:{"1":"EE"},S:{"1":"_C"}},B:4,C:"CSS.supports() API",D:true};