npm-package-json-lint 11.2.0 → 11.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","names":["Ajv","fs","stripComments","debug","path","debug","path","debug","path","debug","cosmiconfigSync","path","debug","path","debug","path","debug","path","fs","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__commonJSMin","mod","cb","__copyProps","from","keys","i","n","key","to","except","k","desc","__toESM","isNodeMode","target","cosmiconfig","node_path","node_fs","strip_json_comments","minimatch","chalk","globby","ignore","slash","path","isPlainObj","value","prototype","require_code$1","exports","_CodeOrName","Name","s","_Code","code","item","c","names","_","args","strs","addCodeArg","plus","str","expr","safeStringify","optimize","arg","interpolate","res","mergeExprItems","b","a","strConcat","c2","c1","x","stringify","getProperty","getEsmExportName","regexpCode","rx","require_scope","code_1","ValueError","name","UsedValueState","\"Started\"","\"Completed\"","Scope","prefixes","parent","nameOrPrefix","prefix","ng","ValueScopeName","nameStr","property","itemIndex","line","opts","valueKey","vs","_name","keyOrRef","values","scopeName","usedValues","getCode","nameSet","valueCode","def","require_codegen","scope_1","code_2","scope_2","Node","Def","varKind","rhs","es5","_n","optimizeExpr","constants","Assign","lhs","sideEffects","addExprNames","AssignOp","op","Label","label","Break","Throw","error","AnyCode","ParentNode","nodes","subtractNames","addNames","BlockNode","Root","Else","If","condition","cond","e","ns","not","For","ForLoop","iteration","ForRange","ForIter","loop","iterable","Func","async","Return","Try","_a","_b","Catch","Finally","extScope","prefixOrName","constant","_constant","keyValues","thenBody","elseBody","node","forBody","arr","obj","catchCode","finallyCode","tryBody","body","nodeCount","len","toClose","funcBody","N1","N2","replaceName","canOptimize","items","par","andCode","mappend","and","orCode","or","y","require_util","codegen_1","toHash","hash","alwaysValidSchema","schema","checkUnknownRules","it","schemaHasRules","rules","self","checkStrictMode","schemaHasRulesButRef","RULES","schemaRefOrVal","$data","topSchemaRef","schemaPath","keyword","unescapeFragment","unescapeJsonPointer","escapeFragment","escapeJsonPointer","eachItem","xs","f","makeMergeEvaluated","mergeNames","gen","mergeToName","mergeValues","toName","resultToName","setEvaluated","evaluatedPropsToName","ps","props","p","snippets","useFunc","Type","\"Num\"","\"Str\"","getErrorPath","dataProp","isNumber","dataPropType","jsPropertySyntax","mode","msg","require_names","require_errors","util_1","names_1","schemaType","reportError","cxt","errObj","errorObjectCode","errorPaths","overrideAllErrors","compositeRule","allErrors","addError","returnErrors","reportExtraError","resetErrorsCount","errsCount","extendErrors","err","schemaValue","data","schemaEnv","errs","validateName","E","createErrors","errorObject","errorInstancePath","errorSchemaPath","extraErrorProps","instPath","instancePath","errorPath","schPath","parentSchema","errSchemaPath","params","message","propertyName","require_boolSchema","errors_1","boolError","topBoolOrEmptySchema","falseSchemaError","boolOrEmptySchema","valid","require_rules","jsonTypes","isJSONType","getRules","groups","require_applicability","schemaHasRulesForType","group","type","shouldUseGroup","shouldUseRule","rule","kwd","require_dataType","rules_1","applicability_1","DataType","\"Correct\"","\"Wrong\"","getSchemaTypes","types","getJSONTypes","ts","coerceAndCheckDataType","coerceTo","coerceToTypes","checkTypes","wrongType","checkDataTypes","coerceData","reportTypeError","COERCIBLE","coerceTypes","t","dataType","coerced","coerceSpecificType","assignParentData","parentData","parentDataProperty","checkDataType","EQ","correct","numCond","_cond","strictNums","dataTypes","notObj","typeError","getTypeErrorContext","schemaCode","require_defaults","assignDefaults","ty","properties","assignDefault","sch","defaultValue","childData","prop","require_code","util_2","checkReportMissingProp","noPropertyInData","checkMissingProp","missing","reportMissingProp","hasPropFunc","isOwnProperty","propertyInData","ownProperties","allSchemaProperties","schemaMap","schemaProperties","callValidateCode","dataAndSchema","passSchema","valCxt","context","func","newRegExp","usePattern","u","regExp","pattern","validateArray","validArr","validateItems","notValid","validateUnion","schValid","schCxt","require_keyword","macroKeywordCode","macroSchema","schemaRef","useKeyword","funcKeywordCode","checkAsyncKeyword","validateRef","validateKeyword","assignValid","modifyData","reportErrs","ruleErrs","validateAsync","validateSync","addErrs","validateErrs","passCxt","_await","errors","result","validSchemaType","st","allowUndefined","validateKeywordUsage","deps","require_subschema","getSubschema","schemaProp","extendSubschemaData","dpType","dataContextProps","dataPathArr","subschema","_nextData","extendSubschemaMode","jtdDiscriminator","jtdMetadata","require_fast_deep_equal","equal","length","require_json_schema_traverse","traverse","pre","post","_traverse","jsonPtr","rootSchema","parentJsonPtr","parentKeyword","keyIndex","escapeJsonPtr","require_resolve","SIMPLE_INLINED","inlineRef","limit","hasRef","countKeys","REF_KEYWORDS","count","getFullPath","normalize","normalizeId","id","_getFullPath","resolver","TRAILING_SLASH_HASH","resolveUrl","baseId","ANCHOR","getSchemaRefs","schId","schemaId","baseIds","pathPrefix","uriResolver","localRefs","schemaRefs","fullPath","innerBaseId","addRef","addAnchor","_resolve","ref","ambiguos","schOrRef","checkAmbiguosRef","anchor","sch2","sch1","require_validate","boolSchema_1","dataType_1","dataType_2","defaults_1","keyword_1","subschema_1","resolve_1","validateFunctionCode","isSchemaObj","checkKeywords","schemaCxtHasRules","topSchemaObjCode","validateFunction","funcSourceUrl","destructureValCxtES5","destructureValCxt","commentKeyword","checkNoDefault","resetEvaluated","typeAndKeywords","returnResults","subschemaCode","subSchemaObjCode","updateContext","checkAsyncSchema","checkRefsAndKeywords","schemaKeywords","rootName","ValidationError","assignEvaluated","evaluated","keywordCode","checkStrictTypes","groupKeywords","iterateKeywords","typeErrors","useDefaults","checkContextTypes","checkMultipleTypes","checkKeywordTypes","includesType","strictTypesError","narrowSchemaTypes","hasApplicableType","schTs","kwdT","withTypes","KeywordCxt","getData","successAction","failAction","errorParams","append","assign","$dataValid","codeBlock","wrong$DataType","invalid$DataSchema","validateSchemaRef","appl","nextContext","schemaCxt","ruleType","JSON_POINTER","RELATIVE_JSON_POINTER","jsonPointer","matches","up","dataLevel","errorMsg","dataNames","segments","segment","pointerType","require_validation_error","require_ref_error","require_compile","validation_error_1","validate_1","SchemaEnv","env","compileSchema","_sch","getCompilingSchema","rootId","_ValidationError","sourceCode","validateCode","validate","resolveRef","schOrFunc","root","resolve","inlineOrCompile","sameSchemaEnv","schEnv","s1","s2","resolveSchema","refPath","getJsonPointer","PREVENT_SCOPE_CHANGE","parsedRef","part","partSchema","$ref","require_data","\"$id\"","\"description\"","\"type\"","\"required\"","\"properties\"","\"$data\"","\"anyOf\"","\"format\"","\"additionalProperties\"","require_utils","isUUID","isIPv4","isPort","isHexPair","isUnreserved","isPathCharacter","isQueryFragmentCharacter","isUserinfoCharacter","BYTE_HEX","HEX_DIGITS","percentEncodeNonAscii","cp","stringArrayToHexStripped","acc","input","isHextet","isIPvFuture","isZoneCharacter","nonSimpleDomain","isZoneIdentifier","zone","compressIPv6ZeroRun","bestStart","bestLength","runStart","runLength","hextets","head","tail","normalizeIPv6Address","compression","left","right","parts","hextetCount","expanded","normalizeIPv6","bracketed","host","findToken","zoneIdentifier","zoneSeparator","separatorLength","address","ind","token","removeDotSegments","output","nextSlash","removeDotSegmentsRelative","last","trailingDirectory","HOST_DELIMS","HOST_DELIM_RE","HOST_DELIM_NO_COLON_RE","reescapeHostDelimiters","re","isIP","ch","normalizePercentEncoding","hex","normalizedHex","decoded","decodeUnreserved","normalizePathEncoding","isEscapeSafe","low","serializePathEncoding","firstSegment","pathNoScheme","encodeComponent","isAllowed","encodeUserinfo","encodeQuery","encodeFragment","normalizeQueryFragmentEncoding","escapePreservingEscapes","recomposeAuthority","uriTokens","component","ipV6res","port","require_schemes","URN_REG","supportedSchemeNames","isValidSchemeName","wsIsSecure","wsComponent","httpParse","httpSerialize","secure","wsParse","wsSerialize","queryIndex","urnParse","urnComponent","scheme","options","schemeHandler","getSchemeHandler","urnSerialize","nid","uriComponent","nss","urnuuidParse","uuidComponent","urnuuidSerialize","http","https","ws","SCHEMES","require_fast_uri","VALID_SCHEME","MALFORMED_SCHEME_ERROR","MALFORMED_HOST_ERROR","FORBIDDEN_DOMAIN_HOST_CHARACTER","validateScheme","stringScheme","uri","normalizeString","parse","serialize","schemelessOptions","baseParsed","baseMalformed","baseMalformedPercentEncoding","baseMalformedSchemeSpecific","baseMalformedHost","baseMalformedScheme","parseWithStatus","baseURI","relativeParsed","relativeMalformed","relativeMalformedPercentEncoding","relativeMalformedSchemeSpecific","relativeMalformedHost","relativeMalformedScheme","relativeURI","resolved","resolveComponent","resolvedSchemeHandler","resolvedHost","resolvedHostIsIP","hasForbiddenDomainHost","canonicalizeHost","encodedASCIIHost","skipNormalization","base","relative","baseHasAuthority","normalizedA","normalizeComparableURI","uriA","normalizedB","uriB","cmpts","hasAuthority","schemelessReference","authority","URI_PARSE","AUTHORITY_PREFIX","AUTHORITY_INTRODUCER_REGION","getParseError","parsed","hasMalformedPercentEncoding","percent","isIPLiteral","hasMalformedComponentPercentEncoding","url","isHostOnlyURL","malformedAuthorityOrPort","malformedPercentEncoding","malformedSchemeSpecific","malformedHost","malformedIPLiteral","malformedScheme","authorityMatch","introducerMatch","region","normalizedRegion","parseError","bracketedIPLiteral","hasIPLiteralBracket","ipv6result","normalizeStringWithStatus","normalized","fastUri","require_uri","require_core$1","ref_error_1","compile_1","codegen_2","$dataRefSchema","uri_1","defaultRegExp","flags","META_IGNORE_OPTIONS","EXT_SCOPE_NAMES","removedOptions","deprecatedOptions","requiredOptions","o","_optz","Ajv","getLogger","formatOpt","checkOptions","getMetaSchemaOptions","addInitialFormats","addInitialKeywords","addInitialSchemas","_dataRefSchema","meta","v","schemaKeyRef","_meta","runCompileAsync","loadMetaSchema","_schema","_compileAsync","checkLoaded","loadMissingSchema","missingRef","_loadSchema","loadSchema","_validateSchema","$schema","throwOrLogError","getSchEnv","keyRef","cacheKey","definitions","kwdOrDef","checkKeyword","addRule","keywordMetaschema","definition","format","dataVar","text","separator","metaSchema","keywordsJsonPointers","keywords","seg","schemaOrData","schemas","regex","addSchema","validateSchema","currentOpts","checkOpts","opt","log","optsSchemas","defs","metaOpts","noLogs","logger","KEYWORD_NAME","ruleGroup","addBeforeRule","_rule","before","$dataRef","require_id","require_ref","callRootRef","schOrEnv","callValidate","inlineRefSchema","callRef","getValidate","schName","$async","callAsyncRef","callSyncRef","addEvaluatedFrom","addErrorsFrom","source","schEvaluated","require_core","id_1","ref_1","require_limitNumber","ops","KWDs","require_multipleOf","prec","invalid","require_ucs2length","ucs2length","pos","require_limitLength","ucs2length_1","comp","require_pattern","regExpCode","require_limitProperties","require_required","missingProperty","useLoop","allErrorsMode","exitOnErrorMode","requiredKey","definedProperties","loopAllRequired","loopUntilMissing","require_limitItems","require_equal","require_uniqueItems","equal_1","j","itemTypes","validateUniqueItems","loopN","loopN2","indices","eql","outer","require_const","require_enum","getEql","loopEnum","vSchema","equalCode","require_validation","limitNumber_1","multipleOf_1","limitLength_1","pattern_1","limitProperties_1","required_1","limitItems_1","uniqueItems_1","const_1","enum_1","require_additionalItems","validateAdditionalItems","require_items","validateTuple","checkStrictTuple","schArr","l","fullTuple","extraItems","require_prefixItems","items_1","require_items2020","additionalItems_1","prefixItems","require_contains","max","min","minContains","maxContains","validateItemsWithCount","checkLimits","_valid","block","require_dependencies","property_ies","depsCount","propDeps","schDeps","splitDependencies","validatePropertyDeps","validateSchemaDeps","propertyDeps","schemaDeps","hasProperty","depProp","require_propertyNames","require_additionalProperties","patProps","checkAdditionalProperties","additionalPropertyCode","isAdditional","definedProp","propsSchema","deleteAdditional","applyAdditionalSchema","require_properties","additionalProperties_1","allProps","hasDefault","applyPropertySchema","require_patternProperties","patterns","alwaysValidPatterns","checkProperties","validatePatternProperties","pat","checkMatchingProperties","validateProperties","alwaysValid","require_not","require_anyOf","require_oneOf","passing","validateOneOf","require_allOf","require_if","hasThen","hasSchema","hasElse","validateIf","ifClause","validateClause","require_thenElse","require_applicator","prefixItems_1","items2020_1","contains_1","dependencies_1","propertyNames_1","properties_1","patternProperties_1","not_1","anyOf_1","oneOf_1","allOf_1","if_1","thenElse_1","getApplicator","applicator","draft2020","require_format$1","validate$DataFormat","validateFormat","fmts","fDef","fType","unknownFmt","invalidFmt","callFormat","validData","formatDef","unknownFormat","fmtType","fmtRef","getFormat","validCondition","unknownMsg","fmtDef","fmt","require_format","require_metadata","require_draft7","core_1","validation_1","applicator_1","format_1","metadata_1","require_types","DiscrError","\"Tag\"","\"Mapping\"","require_discriminator","types_1","discrError","tagName","tag","oneOf","validateMapping","mapping","getMapping","tagValue","applyTagSchema","oneOfMapping","topRequired","hasRequired","tagRequired","propSch","addMappings","required","addMapping","require_json_schema_draft_07","\"$schema\"","\"title\"","\"definitions\"","\"schemaArray\"","\"minItems\"","\"items\"","\"$ref\"","\"nonNegativeInteger\"","\"minimum\"","\"nonNegativeIntegerDefault0\"","\"allOf\"","\"default\"","\"simpleTypes\"","\"enum\"","\"stringArray\"","\"uniqueItems\"","\"$comment\"","\"readOnly\"","\"examples\"","\"multipleOf\"","\"exclusiveMinimum\"","\"maximum\"","\"exclusiveMaximum\"","\"maxLength\"","\"minLength\"","\"pattern\"","\"additionalItems\"","\"maxItems\"","\"contains\"","\"maxProperties\"","\"minProperties\"","\"patternProperties\"","\"propertyNames\"","\"dependencies\"","\"const\"","\"contentMediaType\"","\"contentEncoding\"","\"if\"","\"then\"","\"else\"","\"oneOf\"","\"not\"","require_ajv","draft7_1","discriminator_1","draft7MetaSchema","META_SUPPORT_DATA","META_SCHEMA_ID","require_dist","ajv_1","used","KEYWORD_PROPERTY_PARAMS","INTERPOLATION","INTERPOLATION_REPLACE","EMPTY_STR","errorMessage","kwdPropErrors","kwdErrors","keywordErrorsConfig","processKeywordErrors","processKeywordPropErrors","processChildErrors","childErrorsConfig","schMessage","processAllErrors","removeUsedErrors","propErrors","emSchema","kwdSch","errMap","kwdErrs","templates","getTemplatesCode","matchKeywordError","singleError","paramsErrors","loopErrors","errMessage","templatesCode","kwdPropParams","propParam","keyProp","tmpl","childErrors","isObj","isArr","childErrs","childKwd","childProp","init","ifMatchesChildError","child","children","msgs","matchAnyError","templateExpr","childRegex","templateFunc","ptr","ajvErrors","ajv","import_ajv","import_dist","getAjv","ajvInstance","formatSchemaErrors","standardRuleSchema","arrayRuleSchema","objectRuleSchema","optionalObjExceptionsSchema","isStandardRuleSchemaValid","ruleConfig","isArrayRuleSchemaValid","minItems","isObjectRuleSchemaValid","isOptionalObjExceptSchemaValid","isObjectRuleConfigValid","isOptionalObjRuleConfigValid","isArrayRuleConfigValid","isStandardRuleConfigValid","validateRule","ruleModule","userConfig","error_","modifiedErrorMessage","ruleName","validateRules","rulesConfig","requireFile","fileName","readFile","handleError","sourceSymbol","parseJsonFile","json","fileContents","parseJavaScriptFile","defaultConfig","\"rules\"","debug$7","virtualConfigs","applyExtends","config","extendsConfig","loadFromModule","moduleName","originalFilePath","mergedConfig","previousConfig","extendsConfigPlugins","previousConfigPlugins","plugins","uniquePlugins","extendsConfigOverrides","previousConfigOverrides","overrides","parentName","adjustedModuleName","loadConfigFile","resolvedModule","filePath","applyExtendsIfSpecified","npmPackageJsonLintConfig","filepath","debug$6","applyOverrides","finalRules","relativeFilePath","cwd","transformedPatterns","override","debug$5","transform","configBaseDirectory","cosmiconfigResult","configAfterExtends","filePathBeingLinted","debug$4","Config","configFile","filePathToSearch","configBeforeOverrides","Rules","rulesDirectory","ruleId","filePathToRuleModule","Severity","\"Error\"","\"Warning\"","\"Off\"","aggregateCountsPerFile","issues","isErrorSeverity","issue","counts","aggregateOverallCounts","results","debug$3","createResultObject","lint","lintIssues","configObj","severity","lintResult","packageJsonData","processPackageJsonObject","packageJsonObj","processPackageJsonFile","executeOnPackageJsonObject","resolvedFilename","filename","ignorer","configHelper","packageJsonObject","stats","executeOnPackageJsonFiles","fileList","debug$2","GLOB_CHARS","splitGlobBase","firstGlobIndex","baseSegments","restSegments","isOutsideCwd","globOutsideCwd","rest","getFileList","filteredPatterns","globPatterns","insidePatterns","outsidePatterns","globFiles","files","globFile","debug$1","getIgnorer","ignoreFilePath","ignorePath","absoluteIgnoreFilePath","ignoreText","readError","require_package","\"name\"","\"version\"","\"keywords\"","\"homepage\"","\"bugs\"","\"url\"","\"author\"","\"repository\"","\"bin\"","\"npmPkgJsonLint\"","\"files\"","\"main\"","\"types\"","\"scripts\"","\"build\"","\"eslint\"","\"npmpackagejsonlint\"","\"lint\"","\"test\"","\"chalk\"","\"cosmiconfig\"","\"debug\"","\"globby\"","\"ignore\"","\"meow\"","\"minimatch\"","\"semver\"","\"devDependencies\"","\"ajv\"","\"globals\"","\"jest\"","\"prettier\"","\"tsdown\"","\"typescript\"","\"engines\"","\"node\"","\"npm\"","\"license\"","debug","pkg","isIssueAnError","isPackageJsonObjectValid","isRequiredOptionsValid","getErrorResults","filtered","filteredIssues","filteredResult","NpmPackageJsonLint","packageJsonFilePath","quiet","fix","linterOutput","LintIssue","lintId","lintMessage","plur","singularWord","printResultSetIssues","printIndividualResultSet","resultSet","ignored","errorCount","isQuiet","warningCount","errorCountMessage","warningCountMessage","printTotals","ignoreCountMessage","ignoreCount","write"],"sources":["../src/utils/slash.ts","../src/utils/isPlainObj.ts","../node_modules/ajv/dist/compile/codegen/code.js","../node_modules/ajv/dist/compile/codegen/scope.js","../node_modules/ajv/dist/compile/codegen/index.js","../node_modules/ajv/dist/compile/util.js","../node_modules/ajv/dist/compile/names.js","../node_modules/ajv/dist/compile/errors.js","../node_modules/ajv/dist/compile/validate/boolSchema.js","../node_modules/ajv/dist/compile/rules.js","../node_modules/ajv/dist/compile/validate/applicability.js","../node_modules/ajv/dist/compile/validate/dataType.js","../node_modules/ajv/dist/compile/validate/defaults.js","../node_modules/ajv/dist/vocabularies/code.js","../node_modules/ajv/dist/compile/validate/keyword.js","../node_modules/ajv/dist/compile/validate/subschema.js","../node_modules/fast-deep-equal/index.js","../node_modules/json-schema-traverse/index.js","../node_modules/ajv/dist/compile/resolve.js","../node_modules/ajv/dist/compile/validate/index.js","../node_modules/ajv/dist/runtime/validation_error.js","../node_modules/ajv/dist/compile/ref_error.js","../node_modules/ajv/dist/compile/index.js","../node_modules/ajv/dist/refs/data.json","../node_modules/fast-uri/lib/utils.js","../node_modules/fast-uri/lib/schemes.js","../node_modules/fast-uri/index.js","../node_modules/ajv/dist/runtime/uri.js","../node_modules/ajv/dist/core.js","../node_modules/ajv/dist/vocabularies/core/id.js","../node_modules/ajv/dist/vocabularies/core/ref.js","../node_modules/ajv/dist/vocabularies/core/index.js","../node_modules/ajv/dist/vocabularies/validation/limitNumber.js","../node_modules/ajv/dist/vocabularies/validation/multipleOf.js","../node_modules/ajv/dist/runtime/ucs2length.js","../node_modules/ajv/dist/vocabularies/validation/limitLength.js","../node_modules/ajv/dist/vocabularies/validation/pattern.js","../node_modules/ajv/dist/vocabularies/validation/limitProperties.js","../node_modules/ajv/dist/vocabularies/validation/required.js","../node_modules/ajv/dist/vocabularies/validation/limitItems.js","../node_modules/ajv/dist/runtime/equal.js","../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js","../node_modules/ajv/dist/vocabularies/validation/const.js","../node_modules/ajv/dist/vocabularies/validation/enum.js","../node_modules/ajv/dist/vocabularies/validation/index.js","../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js","../node_modules/ajv/dist/vocabularies/applicator/items.js","../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js","../node_modules/ajv/dist/vocabularies/applicator/items2020.js","../node_modules/ajv/dist/vocabularies/applicator/contains.js","../node_modules/ajv/dist/vocabularies/applicator/dependencies.js","../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js","../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js","../node_modules/ajv/dist/vocabularies/applicator/properties.js","../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js","../node_modules/ajv/dist/vocabularies/applicator/not.js","../node_modules/ajv/dist/vocabularies/applicator/anyOf.js","../node_modules/ajv/dist/vocabularies/applicator/oneOf.js","../node_modules/ajv/dist/vocabularies/applicator/allOf.js","../node_modules/ajv/dist/vocabularies/applicator/if.js","../node_modules/ajv/dist/vocabularies/applicator/thenElse.js","../node_modules/ajv/dist/vocabularies/applicator/index.js","../node_modules/ajv/dist/vocabularies/format/format.js","../node_modules/ajv/dist/vocabularies/format/index.js","../node_modules/ajv/dist/vocabularies/metadata.js","../node_modules/ajv/dist/vocabularies/draft7.js","../node_modules/ajv/dist/vocabularies/discriminator/types.js","../node_modules/ajv/dist/vocabularies/discriminator/index.js","../node_modules/ajv/dist/refs/json-schema-draft-07.json","../node_modules/ajv/dist/ajv.js","../node_modules/ajv-errors/dist/index.js","../src/config/ConfigSchema.ts","../src/config/ConfigValidator.ts","../src/file-parser.ts","../src/config/default-rules.json","../src/config/default.ts","../src/config/applyExtendsIfSpecified.ts","../src/config/applyOverrides.ts","../src/config/cosmicConfigTransformer.ts","../src/configuration.ts","../src/native-rules.ts","../src/types/severity.ts","../src/linter/results-helper.ts","../src/linter/linter.ts","../src/utils/getFileList.ts","../src/utils/getIgnorer.ts","../package.json","../src/npm-package-json-lint.ts","../src/lint-issue.ts","../src/utils/plur.ts","../src/console-reporter.ts"],"sourcesContent":["export const slash = (path: string): string => {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n return isExtendedLengthPath ? path : path.replaceAll('\\\\', '/');\n};\n","export const isPlainObj = (value: unknown): boolean => {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n // These `in` checks must traverse the prototype chain (e.g. to detect Map/Set), so Object.hasOwn()\n // (own-properties-only) would be a behavior regression here.\n return (\n (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) &&\n // eslint-disable-next-line unicorn/no-computed-property-existence-check\n !(Symbol.toStringTag in value) &&\n // eslint-disable-next-line unicorn/no-computed-property-existence-check\n !(Symbol.iterator in value)\n );\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nclass _CodeOrName {\n}\nexports._CodeOrName = _CodeOrName;\nexports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nclass Name extends _CodeOrName {\n constructor(s) {\n super();\n if (!exports.IDENTIFIER.test(s))\n throw new Error(\"CodeGen: name must be a valid identifier\");\n this.str = s;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n return false;\n }\n get names() {\n return { [this.str]: 1 };\n }\n}\nexports.Name = Name;\nclass _Code extends _CodeOrName {\n constructor(code) {\n super();\n this._items = typeof code === \"string\" ? [code] : code;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n if (this._items.length > 1)\n return false;\n const item = this._items[0];\n return item === \"\" || item === '\"\"';\n }\n get str() {\n var _a;\n return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, \"\")));\n }\n get names() {\n var _a;\n return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {\n if (c instanceof Name)\n names[c.str] = (names[c.str] || 0) + 1;\n return names;\n }, {})));\n }\n}\nexports._Code = _Code;\nexports.nil = new _Code(\"\");\nfunction _(strs, ...args) {\n const code = [strs[0]];\n let i = 0;\n while (i < args.length) {\n addCodeArg(code, args[i]);\n code.push(strs[++i]);\n }\n return new _Code(code);\n}\nexports._ = _;\nconst plus = new _Code(\"+\");\nfunction str(strs, ...args) {\n const expr = [safeStringify(strs[0])];\n let i = 0;\n while (i < args.length) {\n expr.push(plus);\n addCodeArg(expr, args[i]);\n expr.push(plus, safeStringify(strs[++i]));\n }\n optimize(expr);\n return new _Code(expr);\n}\nexports.str = str;\nfunction addCodeArg(code, arg) {\n if (arg instanceof _Code)\n code.push(...arg._items);\n else if (arg instanceof Name)\n code.push(arg);\n else\n code.push(interpolate(arg));\n}\nexports.addCodeArg = addCodeArg;\nfunction optimize(expr) {\n let i = 1;\n while (i < expr.length - 1) {\n if (expr[i] === plus) {\n const res = mergeExprItems(expr[i - 1], expr[i + 1]);\n if (res !== undefined) {\n expr.splice(i - 1, 3, res);\n continue;\n }\n expr[i++] = \"+\";\n }\n i++;\n }\n}\nfunction mergeExprItems(a, b) {\n if (b === '\"\"')\n return a;\n if (a === '\"\"')\n return b;\n if (typeof a == \"string\") {\n if (b instanceof Name || a[a.length - 1] !== '\"')\n return;\n if (typeof b != \"string\")\n return `${a.slice(0, -1)}${b}\"`;\n if (b[0] === '\"')\n return a.slice(0, -1) + b.slice(1);\n return;\n }\n if (typeof b == \"string\" && b[0] === '\"' && !(a instanceof Name))\n return `\"${a}${b.slice(1)}`;\n return;\n}\nfunction strConcat(c1, c2) {\n return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;\n}\nexports.strConcat = strConcat;\n// TODO do not allow arrays here\nfunction interpolate(x) {\n return typeof x == \"number\" || typeof x == \"boolean\" || x === null\n ? x\n : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n}\nfunction stringify(x) {\n return new _Code(safeStringify(x));\n}\nexports.stringify = stringify;\nfunction safeStringify(x) {\n return JSON.stringify(x)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\nexports.safeStringify = safeStringify;\nfunction getProperty(key) {\n return typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;\n}\nexports.getProperty = getProperty;\n//Does best effort to format the name properly\nfunction getEsmExportName(key) {\n if (typeof key == \"string\" && exports.IDENTIFIER.test(key)) {\n return new _Code(`${key}`);\n }\n throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n}\nexports.getEsmExportName = getEsmExportName;\nfunction regexpCode(rx) {\n return new _Code(rx.toString());\n}\nexports.regexpCode = regexpCode;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\nconst code_1 = require(\"./code\");\nclass ValueError extends Error {\n constructor(name) {\n super(`CodeGen: \"code\" for ${name} not defined`);\n this.value = name.value;\n }\n}\nvar UsedValueState;\n(function (UsedValueState) {\n UsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n UsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\nexports.varKinds = {\n const: new code_1.Name(\"const\"),\n let: new code_1.Name(\"let\"),\n var: new code_1.Name(\"var\"),\n};\nclass Scope {\n constructor({ prefixes, parent } = {}) {\n this._names = {};\n this._prefixes = prefixes;\n this._parent = parent;\n }\n toName(nameOrPrefix) {\n return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n }\n name(prefix) {\n return new code_1.Name(this._newName(prefix));\n }\n _newName(prefix) {\n const ng = this._names[prefix] || this._nameGroup(prefix);\n return `${prefix}${ng.index++}`;\n }\n _nameGroup(prefix) {\n var _a, _b;\n if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {\n throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n }\n return (this._names[prefix] = { prefix, index: 0 });\n }\n}\nexports.Scope = Scope;\nclass ValueScopeName extends code_1.Name {\n constructor(prefix, nameStr) {\n super(nameStr);\n this.prefix = prefix;\n }\n setValue(value, { property, itemIndex }) {\n this.value = value;\n this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;\n }\n}\nexports.ValueScopeName = ValueScopeName;\nconst line = (0, code_1._) `\\n`;\nclass ValueScope extends Scope {\n constructor(opts) {\n super(opts);\n this._values = {};\n this._scope = opts.scope;\n this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };\n }\n get() {\n return this._scope;\n }\n name(prefix) {\n return new ValueScopeName(prefix, this._newName(prefix));\n }\n value(nameOrPrefix, value) {\n var _a;\n if (value.ref === undefined)\n throw new Error(\"CodeGen: ref must be passed in value\");\n const name = this.toName(nameOrPrefix);\n const { prefix } = name;\n const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n let vs = this._values[prefix];\n if (vs) {\n const _name = vs.get(valueKey);\n if (_name)\n return _name;\n }\n else {\n vs = this._values[prefix] = new Map();\n }\n vs.set(valueKey, name);\n const s = this._scope[prefix] || (this._scope[prefix] = []);\n const itemIndex = s.length;\n s[itemIndex] = value.ref;\n name.setValue(value, { property: prefix, itemIndex });\n return name;\n }\n getValue(prefix, keyOrRef) {\n const vs = this._values[prefix];\n if (!vs)\n return;\n return vs.get(keyOrRef);\n }\n scopeRefs(scopeName, values = this._values) {\n return this._reduceValues(values, (name) => {\n if (name.scopePath === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return (0, code_1._) `${scopeName}${name.scopePath}`;\n });\n }\n scopeCode(values = this._values, usedValues, getCode) {\n return this._reduceValues(values, (name) => {\n if (name.value === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return name.value.code;\n }, usedValues, getCode);\n }\n _reduceValues(values, valueCode, usedValues = {}, getCode) {\n let code = code_1.nil;\n for (const prefix in values) {\n const vs = values[prefix];\n if (!vs)\n continue;\n const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());\n vs.forEach((name) => {\n if (nameSet.has(name))\n return;\n nameSet.set(name, UsedValueState.Started);\n let c = valueCode(name);\n if (c) {\n const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;\n }\n else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {\n code = (0, code_1._) `${code}${c}${this.opts._n}`;\n }\n else {\n throw new ValueError(name);\n }\n nameSet.set(name, UsedValueState.Completed);\n });\n }\n return code;\n }\n}\nexports.ValueScope = ValueScope;\n//# sourceMappingURL=scope.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\nconst code_1 = require(\"./code\");\nconst scope_1 = require(\"./scope\");\nvar code_2 = require(\"./code\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return code_2._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return code_2.str; } });\nObject.defineProperty(exports, \"strConcat\", { enumerable: true, get: function () { return code_2.strConcat; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return code_2.nil; } });\nObject.defineProperty(exports, \"getProperty\", { enumerable: true, get: function () { return code_2.getProperty; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return code_2.stringify; } });\nObject.defineProperty(exports, \"regexpCode\", { enumerable: true, get: function () { return code_2.regexpCode; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return code_2.Name; } });\nvar scope_2 = require(\"./scope\");\nObject.defineProperty(exports, \"Scope\", { enumerable: true, get: function () { return scope_2.Scope; } });\nObject.defineProperty(exports, \"ValueScope\", { enumerable: true, get: function () { return scope_2.ValueScope; } });\nObject.defineProperty(exports, \"ValueScopeName\", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });\nObject.defineProperty(exports, \"varKinds\", { enumerable: true, get: function () { return scope_2.varKinds; } });\nexports.operators = {\n GT: new code_1._Code(\">\"),\n GTE: new code_1._Code(\">=\"),\n LT: new code_1._Code(\"<\"),\n LTE: new code_1._Code(\"<=\"),\n EQ: new code_1._Code(\"===\"),\n NEQ: new code_1._Code(\"!==\"),\n NOT: new code_1._Code(\"!\"),\n OR: new code_1._Code(\"||\"),\n AND: new code_1._Code(\"&&\"),\n ADD: new code_1._Code(\"+\"),\n};\nclass Node {\n optimizeNodes() {\n return this;\n }\n optimizeNames(_names, _constants) {\n return this;\n }\n}\nclass Def extends Node {\n constructor(varKind, name, rhs) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.rhs = rhs;\n }\n render({ es5, _n }) {\n const varKind = es5 ? scope_1.varKinds.var : this.varKind;\n const rhs = this.rhs === undefined ? \"\" : ` = ${this.rhs}`;\n return `${varKind} ${this.name}${rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (!names[this.name.str])\n return;\n if (this.rhs)\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n }\n}\nclass Assign extends Node {\n constructor(lhs, rhs, sideEffects) {\n super();\n this.lhs = lhs;\n this.rhs = rhs;\n this.sideEffects = sideEffects;\n }\n render({ _n }) {\n return `${this.lhs} = ${this.rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)\n return;\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };\n return addExprNames(names, this.rhs);\n }\n}\nclass AssignOp extends Assign {\n constructor(lhs, op, rhs, sideEffects) {\n super(lhs, rhs, sideEffects);\n this.op = op;\n }\n render({ _n }) {\n return `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n }\n}\nclass Label extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n return `${this.label}:` + _n;\n }\n}\nclass Break extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n const label = this.label ? ` ${this.label}` : \"\";\n return `break${label};` + _n;\n }\n}\nclass Throw extends Node {\n constructor(error) {\n super();\n this.error = error;\n }\n render({ _n }) {\n return `throw ${this.error};` + _n;\n }\n get names() {\n return this.error.names;\n }\n}\nclass AnyCode extends Node {\n constructor(code) {\n super();\n this.code = code;\n }\n render({ _n }) {\n return `${this.code};` + _n;\n }\n optimizeNodes() {\n return `${this.code}` ? this : undefined;\n }\n optimizeNames(names, constants) {\n this.code = optimizeExpr(this.code, names, constants);\n return this;\n }\n get names() {\n return this.code instanceof code_1._CodeOrName ? this.code.names : {};\n }\n}\nclass ParentNode extends Node {\n constructor(nodes = []) {\n super();\n this.nodes = nodes;\n }\n render(opts) {\n return this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n }\n optimizeNodes() {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n const n = nodes[i].optimizeNodes();\n if (Array.isArray(n))\n nodes.splice(i, 1, ...n);\n else if (n)\n nodes[i] = n;\n else\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n optimizeNames(names, constants) {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n // iterating backwards improves 1-pass optimization\n const n = nodes[i];\n if (n.optimizeNames(names, constants))\n continue;\n subtractNames(names, n.names);\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n get names() {\n return this.nodes.reduce((names, n) => addNames(names, n.names), {});\n }\n}\nclass BlockNode extends ParentNode {\n render(opts) {\n return \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n }\n}\nclass Root extends ParentNode {\n}\nclass Else extends BlockNode {\n}\nElse.kind = \"else\";\nclass If extends BlockNode {\n constructor(condition, nodes) {\n super(nodes);\n this.condition = condition;\n }\n render(opts) {\n let code = `if(${this.condition})` + super.render(opts);\n if (this.else)\n code += \"else \" + this.else.render(opts);\n return code;\n }\n optimizeNodes() {\n super.optimizeNodes();\n const cond = this.condition;\n if (cond === true)\n return this.nodes; // else is ignored here\n let e = this.else;\n if (e) {\n const ns = e.optimizeNodes();\n e = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n }\n if (e) {\n if (cond === false)\n return e instanceof If ? e : e.nodes;\n if (this.nodes.length)\n return this;\n return new If(not(cond), e instanceof If ? [e] : e.nodes);\n }\n if (cond === false || !this.nodes.length)\n return undefined;\n return this;\n }\n optimizeNames(names, constants) {\n var _a;\n this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n if (!(super.optimizeNames(names, constants) || this.else))\n return;\n this.condition = optimizeExpr(this.condition, names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n addExprNames(names, this.condition);\n if (this.else)\n addNames(names, this.else.names);\n return names;\n }\n}\nIf.kind = \"if\";\nclass For extends BlockNode {\n}\nFor.kind = \"for\";\nclass ForLoop extends For {\n constructor(iteration) {\n super();\n this.iteration = iteration;\n }\n render(opts) {\n return `for(${this.iteration})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iteration = optimizeExpr(this.iteration, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iteration.names);\n }\n}\nclass ForRange extends For {\n constructor(varKind, name, from, to) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.from = from;\n this.to = to;\n }\n render(opts) {\n const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n const { name, from, to } = this;\n return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n }\n get names() {\n const names = addExprNames(super.names, this.from);\n return addExprNames(names, this.to);\n }\n}\nclass ForIter extends For {\n constructor(loop, varKind, name, iterable) {\n super();\n this.loop = loop;\n this.varKind = varKind;\n this.name = name;\n this.iterable = iterable;\n }\n render(opts) {\n return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iterable = optimizeExpr(this.iterable, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iterable.names);\n }\n}\nclass Func extends BlockNode {\n constructor(name, args, async) {\n super();\n this.name = name;\n this.args = args;\n this.async = async;\n }\n render(opts) {\n const _async = this.async ? \"async \" : \"\";\n return `${_async}function ${this.name}(${this.args})` + super.render(opts);\n }\n}\nFunc.kind = \"func\";\nclass Return extends ParentNode {\n render(opts) {\n return \"return \" + super.render(opts);\n }\n}\nReturn.kind = \"return\";\nclass Try extends BlockNode {\n render(opts) {\n let code = \"try\" + super.render(opts);\n if (this.catch)\n code += this.catch.render(opts);\n if (this.finally)\n code += this.finally.render(opts);\n return code;\n }\n optimizeNodes() {\n var _a, _b;\n super.optimizeNodes();\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();\n return this;\n }\n optimizeNames(names, constants) {\n var _a, _b;\n super.optimizeNames(names, constants);\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n if (this.catch)\n addNames(names, this.catch.names);\n if (this.finally)\n addNames(names, this.finally.names);\n return names;\n }\n}\nclass Catch extends BlockNode {\n constructor(error) {\n super();\n this.error = error;\n }\n render(opts) {\n return `catch(${this.error})` + super.render(opts);\n }\n}\nCatch.kind = \"catch\";\nclass Finally extends BlockNode {\n render(opts) {\n return \"finally\" + super.render(opts);\n }\n}\nFinally.kind = \"finally\";\nclass CodeGen {\n constructor(extScope, opts = {}) {\n this._values = {};\n this._blockStarts = [];\n this._constants = {};\n this.opts = { ...opts, _n: opts.lines ? \"\\n\" : \"\" };\n this._extScope = extScope;\n this._scope = new scope_1.Scope({ parent: extScope });\n this._nodes = [new Root()];\n }\n toString() {\n return this._root.render(this.opts);\n }\n // returns unique name in the internal scope\n name(prefix) {\n return this._scope.name(prefix);\n }\n // reserves unique name in the external scope\n scopeName(prefix) {\n return this._extScope.name(prefix);\n }\n // reserves unique name in the external scope and assigns value to it\n scopeValue(prefixOrName, value) {\n const name = this._extScope.value(prefixOrName, value);\n const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());\n vs.add(name);\n return name;\n }\n getScopeValue(prefix, keyOrRef) {\n return this._extScope.getValue(prefix, keyOrRef);\n }\n // return code that assigns values in the external scope to the names that are used internally\n // (same names that were returned by gen.scopeName or gen.scopeValue)\n scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }\n scopeCode() {\n return this._extScope.scopeCode(this._values);\n }\n _def(varKind, nameOrPrefix, rhs, constant) {\n const name = this._scope.toName(nameOrPrefix);\n if (rhs !== undefined && constant)\n this._constants[name.str] = rhs;\n this._leafNode(new Def(varKind, name, rhs));\n return name;\n }\n // `const` declaration (`var` in es5 mode)\n const(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n }\n // `let` declaration with optional assignment (`var` in es5 mode)\n let(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n }\n // `var` declaration with optional assignment\n var(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n }\n // assignment code\n assign(lhs, rhs, sideEffects) {\n return this._leafNode(new Assign(lhs, rhs, sideEffects));\n }\n // `+=` code\n add(lhs, rhs) {\n return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n }\n // appends passed SafeExpr to code or executes Block\n code(c) {\n if (typeof c == \"function\")\n c();\n else if (c !== code_1.nil)\n this._leafNode(new AnyCode(c));\n return this;\n }\n // returns code for object literal for the passed argument list of key-value pairs\n object(...keyValues) {\n const code = [\"{\"];\n for (const [key, value] of keyValues) {\n if (code.length > 1)\n code.push(\",\");\n code.push(key);\n if (key !== value || this.opts.es5) {\n code.push(\":\");\n (0, code_1.addCodeArg)(code, value);\n }\n }\n code.push(\"}\");\n return new code_1._Code(code);\n }\n // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)\n if(condition, thenBody, elseBody) {\n this._blockNode(new If(condition));\n if (thenBody && elseBody) {\n this.code(thenBody).else().code(elseBody).endIf();\n }\n else if (thenBody) {\n this.code(thenBody).endIf();\n }\n else if (elseBody) {\n throw new Error('CodeGen: \"else\" body without \"then\" body');\n }\n return this;\n }\n // `else if` clause - invalid without `if` or after `else` clauses\n elseIf(condition) {\n return this._elseNode(new If(condition));\n }\n // `else` clause - only valid after `if` or `else if` clauses\n else() {\n return this._elseNode(new Else());\n }\n // end `if` statement (needed if gen.if was used only with condition)\n endIf() {\n return this._endBlockNode(If, Else);\n }\n _for(node, forBody) {\n this._blockNode(node);\n if (forBody)\n this.code(forBody).endFor();\n return this;\n }\n // a generic `for` clause (or statement if `forBody` is passed)\n for(iteration, forBody) {\n return this._for(new ForLoop(iteration), forBody);\n }\n // `for` statement for a range of values\n forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }\n // `for-of` statement (in es5 mode replace with a normal for loop)\n forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n const name = this._scope.toName(nameOrPrefix);\n if (this.opts.es5) {\n const arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n return this.forRange(\"_i\", 0, (0, code_1._) `${arr}.length`, (i) => {\n this.var(name, (0, code_1._) `${arr}[${i}]`);\n forBody(name);\n });\n }\n return this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n }\n // `for-in` statement.\n // With option `ownProperties` replaced with a `for-of` loop for object keys\n forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n if (this.opts.ownProperties) {\n return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);\n }\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n }\n // end `for` loop\n endFor() {\n return this._endBlockNode(For);\n }\n // `label` statement\n label(label) {\n return this._leafNode(new Label(label));\n }\n // `break` statement\n break(label) {\n return this._leafNode(new Break(label));\n }\n // `return` statement\n return(value) {\n const node = new Return();\n this._blockNode(node);\n this.code(value);\n if (node.nodes.length !== 1)\n throw new Error('CodeGen: \"return\" should have one node');\n return this._endBlockNode(Return);\n }\n // `try` statement\n try(tryBody, catchCode, finallyCode) {\n if (!catchCode && !finallyCode)\n throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');\n const node = new Try();\n this._blockNode(node);\n this.code(tryBody);\n if (catchCode) {\n const error = this.name(\"e\");\n this._currNode = node.catch = new Catch(error);\n catchCode(error);\n }\n if (finallyCode) {\n this._currNode = node.finally = new Finally();\n this.code(finallyCode);\n }\n return this._endBlockNode(Catch, Finally);\n }\n // `throw` statement\n throw(error) {\n return this._leafNode(new Throw(error));\n }\n // start self-balancing block\n block(body, nodeCount) {\n this._blockStarts.push(this._nodes.length);\n if (body)\n this.code(body).endBlock(nodeCount);\n return this;\n }\n // end the current self-balancing block\n endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }\n // `function` heading (or definition if funcBody is passed)\n func(name, args = code_1.nil, async, funcBody) {\n this._blockNode(new Func(name, args, async));\n if (funcBody)\n this.code(funcBody).endFunc();\n return this;\n }\n // end function definition\n endFunc() {\n return this._endBlockNode(Func);\n }\n optimize(n = 1) {\n while (n-- > 0) {\n this._root.optimizeNodes();\n this._root.optimizeNames(this._root.names, this._constants);\n }\n }\n _leafNode(node) {\n this._currNode.nodes.push(node);\n return this;\n }\n _blockNode(node) {\n this._currNode.nodes.push(node);\n this._nodes.push(node);\n }\n _endBlockNode(N1, N2) {\n const n = this._currNode;\n if (n instanceof N1 || (N2 && n instanceof N2)) {\n this._nodes.pop();\n return this;\n }\n throw new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n }\n _elseNode(node) {\n const n = this._currNode;\n if (!(n instanceof If)) {\n throw new Error('CodeGen: \"else\" without \"if\"');\n }\n this._currNode = n.else = node;\n return this;\n }\n get _root() {\n return this._nodes[0];\n }\n get _currNode() {\n const ns = this._nodes;\n return ns[ns.length - 1];\n }\n set _currNode(node) {\n const ns = this._nodes;\n ns[ns.length - 1] = node;\n }\n}\nexports.CodeGen = CodeGen;\nfunction addNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) + (from[n] || 0);\n return names;\n}\nfunction addExprNames(names, from) {\n return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n}\nfunction optimizeExpr(expr, names, constants) {\n if (expr instanceof code_1.Name)\n return replaceName(expr);\n if (!canOptimize(expr))\n return expr;\n return new code_1._Code(expr._items.reduce((items, c) => {\n if (c instanceof code_1.Name)\n c = replaceName(c);\n if (c instanceof code_1._Code)\n items.push(...c._items);\n else\n items.push(c);\n return items;\n }, []));\n function replaceName(n) {\n const c = constants[n.str];\n if (c === undefined || names[n.str] !== 1)\n return n;\n delete names[n.str];\n return c;\n }\n function canOptimize(e) {\n return (e instanceof code_1._Code &&\n e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));\n }\n}\nfunction subtractNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) - (from[n] || 0);\n}\nfunction not(x) {\n return typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._) `!${par(x)}`;\n}\nexports.not = not;\nconst andCode = mappend(exports.operators.AND);\n// boolean AND (&&) expression with the passed arguments\nfunction and(...args) {\n return args.reduce(andCode);\n}\nexports.and = and;\nconst orCode = mappend(exports.operators.OR);\n// boolean OR (||) expression with the passed arguments\nfunction or(...args) {\n return args.reduce(orCode);\n}\nexports.or = or;\nfunction mappend(op) {\n return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);\n}\nfunction par(x) {\n return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst code_1 = require(\"./codegen/code\");\n// TODO refactor to use Set\nfunction toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}\nexports.toHash = toHash;\nfunction alwaysValidSchema(it, schema) {\n if (typeof schema == \"boolean\")\n return schema;\n if (Object.keys(schema).length === 0)\n return true;\n checkUnknownRules(it, schema);\n return !schemaHasRules(schema, it.self.RULES.all);\n}\nexports.alwaysValidSchema = alwaysValidSchema;\nfunction checkUnknownRules(it, schema = it.schema) {\n const { opts, self } = it;\n if (!opts.strictSchema)\n return;\n if (typeof schema === \"boolean\")\n return;\n const rules = self.RULES.keywords;\n for (const key in schema) {\n if (!rules[key])\n checkStrictMode(it, `unknown keyword: \"${key}\"`);\n }\n}\nexports.checkUnknownRules = checkUnknownRules;\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (rules[key])\n return true;\n return false;\n}\nexports.schemaHasRules = schemaHasRules;\nfunction schemaHasRulesButRef(schema, RULES) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (key !== \"$ref\" && RULES.all[key])\n return true;\n return false;\n}\nexports.schemaHasRulesButRef = schemaHasRulesButRef;\nfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n if (!$data) {\n if (typeof schema == \"number\" || typeof schema == \"boolean\")\n return schema;\n if (typeof schema == \"string\")\n return (0, codegen_1._) `${schema}`;\n }\n return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n}\nexports.schemaRefOrVal = schemaRefOrVal;\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\nexports.unescapeFragment = unescapeFragment;\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\nexports.escapeFragment = escapeFragment;\nfunction escapeJsonPointer(str) {\n if (typeof str == \"number\")\n return `${str}`;\n return str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexports.escapeJsonPointer = escapeJsonPointer;\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}\nexports.unescapeJsonPointer = unescapeJsonPointer;\nfunction eachItem(xs, f) {\n if (Array.isArray(xs)) {\n for (const x of xs)\n f(x);\n }\n else {\n f(xs);\n }\n}\nexports.eachItem = eachItem;\nfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {\n return (gen, from, to, toName) => {\n const res = to === undefined\n ? from\n : to instanceof codegen_1.Name\n ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)\n : from instanceof codegen_1.Name\n ? (mergeToName(gen, to, from), from)\n : mergeValues(from, to);\n return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n };\n}\nexports.mergeEvaluated = {\n props: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {\n gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));\n }),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {\n if (from === true) {\n gen.assign(to, true);\n }\n else {\n gen.assign(to, (0, codegen_1._) `${to} || {}`);\n setEvaluated(gen, to, from);\n }\n }),\n mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),\n resultToName: evaluatedPropsToName,\n }),\n items: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),\n mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),\n resultToName: (gen, items) => gen.var(\"items\", items),\n }),\n};\nfunction evaluatedPropsToName(gen, ps) {\n if (ps === true)\n return gen.var(\"props\", true);\n const props = gen.var(\"props\", (0, codegen_1._) `{}`);\n if (ps !== undefined)\n setEvaluated(gen, props, ps);\n return props;\n}\nexports.evaluatedPropsToName = evaluatedPropsToName;\nfunction setEvaluated(gen, props, ps) {\n Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));\n}\nexports.setEvaluated = setEvaluated;\nconst snippets = {};\nfunction useFunc(gen, f) {\n return gen.scopeValue(\"func\", {\n ref: f,\n code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),\n });\n}\nexports.useFunc = useFunc;\nvar Type;\n(function (Type) {\n Type[Type[\"Num\"] = 0] = \"Num\";\n Type[Type[\"Str\"] = 1] = \"Str\";\n})(Type || (exports.Type = Type = {}));\nfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n // let path\n if (dataProp instanceof codegen_1.Name) {\n const isNumber = dataPropType === Type.Num;\n return jsPropertySyntax\n ? isNumber\n ? (0, codegen_1._) `\"[\" + ${dataProp} + \"]\"`\n : (0, codegen_1._) `\"['\" + ${dataProp} + \"']\"`\n : isNumber\n ? (0, codegen_1._) `\"/\" + ${dataProp}`\n : (0, codegen_1._) `\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`; // TODO maybe use global escapePointer\n }\n return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n}\nexports.getErrorPath = getErrorPath;\nfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n if (!mode)\n return;\n msg = `strict mode: ${msg}`;\n if (mode === true)\n throw new Error(msg);\n it.self.logger.warn(msg);\n}\nexports.checkStrictMode = checkStrictMode;\n//# sourceMappingURL=util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"./codegen\");\nconst names = {\n // validation function arguments\n data: new codegen_1.Name(\"data\"), // data passed to validation function\n // args passed from referencing schema\n valCxt: new codegen_1.Name(\"valCxt\"), // validation/data context - should not be used directly, it is destructured to the names below\n instancePath: new codegen_1.Name(\"instancePath\"),\n parentData: new codegen_1.Name(\"parentData\"),\n parentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n rootData: new codegen_1.Name(\"rootData\"), // root data - same as the data passed to the first/top validation function\n dynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"), // used to support recursiveRef and dynamicRef\n // function scoped variables\n vErrors: new codegen_1.Name(\"vErrors\"), // null or array of validation errors\n errors: new codegen_1.Name(\"errors\"), // counter of validation errors\n this: new codegen_1.Name(\"this\"),\n // \"globals\"\n self: new codegen_1.Name(\"self\"),\n scope: new codegen_1.Name(\"scope\"),\n // JTD serialize/parse name for JSON string and position\n json: new codegen_1.Name(\"json\"),\n jsonPos: new codegen_1.Name(\"jsonPos\"),\n jsonLen: new codegen_1.Name(\"jsonLen\"),\n jsonPart: new codegen_1.Name(\"jsonPart\"),\n};\nexports.default = names;\n//# sourceMappingURL=names.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst util_1 = require(\"./util\");\nconst names_1 = require(\"./names\");\nexports.keywordError = {\n message: ({ keyword }) => (0, codegen_1.str) `must pass \"${keyword}\" keyword validation`,\n};\nexports.keyword$DataError = {\n message: ({ keyword, schemaType }) => schemaType\n ? (0, codegen_1.str) `\"${keyword}\" keyword must be ${schemaType} ($data)`\n : (0, codegen_1.str) `\"${keyword}\" keyword is invalid ($data)`,\n};\nfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {\n addError(gen, errObj);\n }\n else {\n returnErrors(it, (0, codegen_1._) `[${errObj}]`);\n }\n}\nexports.reportError = reportError;\nfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n addError(gen, errObj);\n if (!(compositeRule || allErrors)) {\n returnErrors(it, names_1.default.vErrors);\n }\n}\nexports.reportExtraError = reportExtraError;\nfunction resetErrorsCount(gen, errsCount) {\n gen.assign(names_1.default.errors, errsCount);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n}\nexports.resetErrorsCount = resetErrorsCount;\nfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {\n /* istanbul ignore if */\n if (errsCount === undefined)\n throw new Error(\"ajv implementation error\");\n const err = gen.name(\"err\");\n gen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);\n gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);\n if (it.opts.verbose) {\n gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);\n gen.assign((0, codegen_1._) `${err}.data`, data);\n }\n });\n}\nexports.extendErrors = extendErrors;\nfunction addError(gen, errObj) {\n const err = gen.const(\"err\", errObj);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);\n gen.code((0, codegen_1._) `${names_1.default.errors}++`);\n}\nfunction returnErrors(it, errs) {\n const { gen, validateName, schemaEnv } = it;\n if (schemaEnv.$async) {\n gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, errs);\n gen.return(false);\n }\n}\nconst E = {\n keyword: new codegen_1.Name(\"keyword\"),\n schemaPath: new codegen_1.Name(\"schemaPath\"), // also used in JTD errors\n params: new codegen_1.Name(\"params\"),\n propertyName: new codegen_1.Name(\"propertyName\"),\n message: new codegen_1.Name(\"message\"),\n schema: new codegen_1.Name(\"schema\"),\n parentSchema: new codegen_1.Name(\"parentSchema\"),\n};\nfunction errorObjectCode(cxt, error, errorPaths) {\n const { createErrors } = cxt.it;\n if (createErrors === false)\n return (0, codegen_1._) `{}`;\n return errorObject(cxt, error, errorPaths);\n}\nfunction errorObject(cxt, error, errorPaths = {}) {\n const { gen, it } = cxt;\n const keyValues = [\n errorInstancePath(it, errorPaths),\n errorSchemaPath(cxt, errorPaths),\n ];\n extraErrorProps(cxt, error, keyValues);\n return gen.object(...keyValues);\n}\nfunction errorInstancePath({ errorPath }, { instancePath }) {\n const instPath = instancePath\n ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`\n : errorPath;\n return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n}\nfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;\n if (schemaPath) {\n schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n }\n return [E.schemaPath, schPath];\n}\nfunction extraErrorProps(cxt, { params, message }, keyValues) {\n const { keyword, data, schemaValue, it } = cxt;\n const { opts, propertyName, topSchemaRef, schemaPath } = it;\n keyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._) `{}`]);\n if (opts.messages) {\n keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n }\n if (opts.verbose) {\n keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n }\n if (propertyName)\n keyValues.push([E.propertyName, propertyName]);\n}\n//# sourceMappingURL=errors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst boolError = {\n message: \"boolean schema is false\",\n};\nfunction topBoolOrEmptySchema(it) {\n const { gen, schema, validateName } = it;\n if (schema === false) {\n falseSchemaError(it, false);\n }\n else if (typeof schema == \"object\" && schema.$async === true) {\n gen.return(names_1.default.data);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, null);\n gen.return(true);\n }\n}\nexports.topBoolOrEmptySchema = topBoolOrEmptySchema;\nfunction boolOrEmptySchema(it, valid) {\n const { gen, schema } = it;\n if (schema === false) {\n gen.var(valid, false); // TODO var\n falseSchemaError(it);\n }\n else {\n gen.var(valid, true); // TODO var\n }\n}\nexports.boolOrEmptySchema = boolOrEmptySchema;\nfunction falseSchemaError(it, overrideAllErrors) {\n const { gen, data } = it;\n // TODO maybe some other interface should be used for non-keyword validation errors...\n const cxt = {\n gen,\n keyword: \"false schema\",\n data,\n schema: false,\n schemaCode: false,\n schemaValue: false,\n params: {},\n it,\n };\n (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);\n}\n//# sourceMappingURL=boolSchema.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRules = exports.isJSONType = void 0;\nconst _jsonTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"null\", \"object\", \"array\"];\nconst jsonTypes = new Set(_jsonTypes);\nfunction isJSONType(x) {\n return typeof x == \"string\" && jsonTypes.has(x);\n}\nexports.isJSONType = isJSONType;\nfunction getRules() {\n const groups = {\n number: { type: \"number\", rules: [] },\n string: { type: \"string\", rules: [] },\n array: { type: \"array\", rules: [] },\n object: { type: \"object\", rules: [] },\n };\n return {\n types: { ...groups, integer: true, boolean: true, null: true },\n rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],\n post: { rules: [] },\n all: {},\n keywords: {},\n };\n}\nexports.getRules = getRules;\n//# sourceMappingURL=rules.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\nfunction schemaHasRulesForType({ schema, self }, type) {\n const group = self.RULES.types[type];\n return group && group !== true && shouldUseGroup(schema, group);\n}\nexports.schemaHasRulesForType = schemaHasRulesForType;\nfunction shouldUseGroup(schema, group) {\n return group.rules.some((rule) => shouldUseRule(schema, rule));\n}\nexports.shouldUseGroup = shouldUseGroup;\nfunction shouldUseRule(schema, rule) {\n var _a;\n return (schema[rule.keyword] !== undefined ||\n ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));\n}\nexports.shouldUseRule = shouldUseRule;\n//# sourceMappingURL=applicability.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\nconst rules_1 = require(\"../rules\");\nconst applicability_1 = require(\"./applicability\");\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nvar DataType;\n(function (DataType) {\n DataType[DataType[\"Correct\"] = 0] = \"Correct\";\n DataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n})(DataType || (exports.DataType = DataType = {}));\nfunction getSchemaTypes(schema) {\n const types = getJSONTypes(schema.type);\n const hasNull = types.includes(\"null\");\n if (hasNull) {\n if (schema.nullable === false)\n throw new Error(\"type: null contradicts nullable: false\");\n }\n else {\n if (!types.length && schema.nullable !== undefined) {\n throw new Error('\"nullable\" cannot be used without \"type\"');\n }\n if (schema.nullable === true)\n types.push(\"null\");\n }\n return types;\n}\nexports.getSchemaTypes = getSchemaTypes;\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction getJSONTypes(ts) {\n const types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n if (types.every(rules_1.isJSONType))\n return types;\n throw new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n}\nexports.getJSONTypes = getJSONTypes;\nfunction coerceAndCheckDataType(it, types) {\n const { gen, data, opts } = it;\n const coerceTo = coerceToTypes(types, opts.coerceTypes);\n const checkTypes = types.length > 0 &&\n !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n if (checkTypes) {\n const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n gen.if(wrongType, () => {\n if (coerceTo.length)\n coerceData(it, types, coerceTo);\n else\n reportTypeError(it);\n });\n }\n return checkTypes;\n}\nexports.coerceAndCheckDataType = coerceAndCheckDataType;\nconst COERCIBLE = new Set([\"string\", \"number\", \"integer\", \"boolean\", \"null\"]);\nfunction coerceToTypes(types, coerceTypes) {\n return coerceTypes\n ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === \"array\" && t === \"array\"))\n : [];\n}\nfunction coerceData(it, types, coerceTo) {\n const { gen, data, opts } = it;\n const dataType = gen.let(\"dataType\", (0, codegen_1._) `typeof ${data}`);\n const coerced = gen.let(\"coerced\", (0, codegen_1._) `undefined`);\n if (opts.coerceTypes === \"array\") {\n gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen\n .assign(data, (0, codegen_1._) `${data}[0]`)\n .assign(dataType, (0, codegen_1._) `typeof ${data}`)\n .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n }\n gen.if((0, codegen_1._) `${coerced} !== undefined`);\n for (const t of coerceTo) {\n if (COERCIBLE.has(t) || (t === \"array\" && opts.coerceTypes === \"array\")) {\n coerceSpecificType(t);\n }\n }\n gen.else();\n reportTypeError(it);\n gen.endIf();\n gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {\n gen.assign(data, coerced);\n assignParentData(it, coerced);\n });\n function coerceSpecificType(t) {\n switch (t) {\n case \"string\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"number\" || ${dataType} == \"boolean\"`)\n .assign(coerced, (0, codegen_1._) `\"\" + ${data}`)\n .elseIf((0, codegen_1._) `${data} === null`)\n .assign(coerced, (0, codegen_1._) `\"\"`);\n return;\n case \"number\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"integer\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"boolean\":\n gen\n .elseIf((0, codegen_1._) `${data} === \"false\" || ${data} === 0 || ${data} === null`)\n .assign(coerced, false)\n .elseIf((0, codegen_1._) `${data} === \"true\" || ${data} === 1`)\n .assign(coerced, true);\n return;\n case \"null\":\n gen.elseIf((0, codegen_1._) `${data} === \"\" || ${data} === 0 || ${data} === false`);\n gen.assign(coerced, null);\n return;\n case \"array\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`)\n .assign(coerced, (0, codegen_1._) `[${data}]`);\n }\n }\n}\nfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n // TODO use gen.property\n gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));\n}\nfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n let cond;\n switch (dataType) {\n case \"null\":\n return (0, codegen_1._) `${data} ${EQ} null`;\n case \"array\":\n cond = (0, codegen_1._) `Array.isArray(${data})`;\n break;\n case \"object\":\n cond = (0, codegen_1._) `${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n break;\n case \"integer\":\n cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);\n break;\n case \"number\":\n cond = numCond();\n break;\n default:\n return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;\n }\n return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n function numCond(_cond = codegen_1.nil) {\n return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);\n }\n}\nexports.checkDataType = checkDataType;\nfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n if (dataTypes.length === 1) {\n return checkDataType(dataTypes[0], data, strictNums, correct);\n }\n let cond;\n const types = (0, util_1.toHash)(dataTypes);\n if (types.array && types.object) {\n const notObj = (0, codegen_1._) `typeof ${data} != \"object\"`;\n cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;\n delete types.null;\n delete types.array;\n delete types.object;\n }\n else {\n cond = codegen_1.nil;\n }\n if (types.number)\n delete types.integer;\n for (const t in types)\n cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n return cond;\n}\nexports.checkDataTypes = checkDataTypes;\nconst typeError = {\n message: ({ schema }) => `must be ${schema}`,\n params: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,\n};\nfunction reportTypeError(it) {\n const cxt = getTypeErrorContext(it);\n (0, errors_1.reportError)(cxt, typeError);\n}\nexports.reportTypeError = reportTypeError;\nfunction getTypeErrorContext(it) {\n const { gen, data, schema } = it;\n const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n return {\n gen,\n keyword: \"type\",\n data,\n schema: schema.type,\n schemaCode,\n schemaValue: schemaCode,\n parentSchema: schema,\n params: {},\n it,\n };\n}\n//# sourceMappingURL=dataType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assignDefaults = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction assignDefaults(it, ty) {\n const { properties, items } = it.schema;\n if (ty === \"object\" && properties) {\n for (const key in properties) {\n assignDefault(it, key, properties[key].default);\n }\n }\n else if (ty === \"array\" && Array.isArray(items)) {\n items.forEach((sch, i) => assignDefault(it, i, sch.default));\n }\n}\nexports.assignDefaults = assignDefaults;\nfunction assignDefault(it, prop, defaultValue) {\n const { gen, compositeRule, data, opts } = it;\n if (defaultValue === undefined)\n return;\n const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;\n if (compositeRule) {\n (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n return;\n }\n let condition = (0, codegen_1._) `${childData} === undefined`;\n if (opts.useDefaults === \"empty\") {\n condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === \"\"`;\n }\n // `${childData} === undefined` +\n // (opts.useDefaults === \"empty\" ? ` || ${childData} === null || ${childData} === \"\"` : \"\")\n gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n}\n//# sourceMappingURL=defaults.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\nconst codegen_1 = require(\"../compile/codegen\");\nconst util_1 = require(\"../compile/util\");\nconst names_1 = require(\"../compile/names\");\nconst util_2 = require(\"../compile/util\");\nfunction checkReportMissingProp(cxt, prop) {\n const { gen, data, it } = cxt;\n gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);\n cxt.error();\n });\n}\nexports.checkReportMissingProp = checkReportMissingProp;\nfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));\n}\nexports.checkMissingProp = checkMissingProp;\nfunction reportMissingProp(cxt, missing) {\n cxt.setParams({ missingProperty: missing }, true);\n cxt.error();\n}\nexports.reportMissingProp = reportMissingProp;\nfunction hasPropFunc(gen) {\n return gen.scopeValue(\"func\", {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ref: Object.prototype.hasOwnProperty,\n code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,\n });\n}\nexports.hasPropFunc = hasPropFunc;\nfunction isOwnProperty(gen, data, property) {\n return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;\n}\nexports.isOwnProperty = isOwnProperty;\nfunction propertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n}\nexports.propertyInData = propertyInData;\nfunction noPropertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n}\nexports.noPropertyInData = noPropertyInData;\nfunction allSchemaProperties(schemaMap) {\n return schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n}\nexports.allSchemaProperties = allSchemaProperties;\nfunction schemaProperties(it, schemaMap) {\n return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n}\nexports.schemaProperties = schemaProperties;\nfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n const valCxt = [\n [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n [names_1.default.parentData, it.parentData],\n [names_1.default.parentDataProperty, it.parentDataProperty],\n [names_1.default.rootData, names_1.default.rootData],\n ];\n if (it.opts.dynamicRef)\n valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;\n return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;\n}\nexports.callValidateCode = callValidateCode;\nconst newRegExp = (0, codegen_1._) `new RegExp`;\nfunction usePattern({ gen, it: { opts } }, pattern) {\n const u = opts.unicodeRegExp ? \"u\" : \"\";\n const { regExp } = opts.code;\n const rx = regExp(pattern, u);\n return gen.scopeValue(\"pattern\", {\n key: rx.toString(),\n ref: rx,\n code: (0, codegen_1._) `${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,\n });\n}\nexports.usePattern = usePattern;\nfunction validateArray(cxt) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n if (it.allErrors) {\n const validArr = gen.let(\"valid\", true);\n validateItems(() => gen.assign(validArr, false));\n return validArr;\n }\n gen.var(valid, true);\n validateItems(() => gen.break());\n return valid;\n function validateItems(notValid) {\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword,\n dataProp: i,\n dataPropType: util_1.Type.Num,\n }, valid);\n gen.if((0, codegen_1.not)(valid), notValid);\n });\n }\n}\nexports.validateArray = validateArray;\nfunction validateUnion(cxt) {\n const { gen, schema, keyword, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));\n if (alwaysValid && !it.opts.unevaluated)\n return;\n const valid = gen.let(\"valid\", false);\n const schValid = gen.name(\"_valid\");\n gen.block(() => schema.forEach((_sch, i) => {\n const schCxt = cxt.subschema({\n keyword,\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);\n const merged = cxt.mergeValidEvaluated(schCxt, schValid);\n // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)\n // or if all properties and items were evaluated (it.props === true && it.items === true)\n if (!merged)\n gen.if((0, codegen_1.not)(valid));\n }));\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n}\nexports.validateUnion = validateUnion;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst code_1 = require(\"../../vocabularies/code\");\nconst errors_1 = require(\"../errors\");\nfunction macroKeywordCode(cxt, def) {\n const { gen, keyword, schema, parentSchema, it } = cxt;\n const macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n const schemaRef = useKeyword(gen, keyword, macroSchema);\n if (it.opts.validateSchema !== false)\n it.self.validateSchema(macroSchema, true);\n const valid = gen.name(\"valid\");\n cxt.subschema({\n schema: macroSchema,\n schemaPath: codegen_1.nil,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n topSchemaRef: schemaRef,\n compositeRule: true,\n }, valid);\n cxt.pass(valid, () => cxt.error(true));\n}\nexports.macroKeywordCode = macroKeywordCode;\nfunction funcKeywordCode(cxt, def) {\n var _a;\n const { gen, keyword, schema, parentSchema, $data, it } = cxt;\n checkAsyncKeyword(it, def);\n const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;\n const validateRef = useKeyword(gen, keyword, validate);\n const valid = gen.let(\"valid\");\n cxt.block$data(valid, validateKeyword);\n cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n function validateKeyword() {\n if (def.errors === false) {\n assignValid();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => cxt.error());\n }\n else {\n const ruleErrs = def.async ? validateAsync() : validateSync();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => addErrs(cxt, ruleErrs));\n }\n }\n function validateAsync() {\n const ruleErrs = gen.let(\"ruleErrs\", null);\n gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));\n return ruleErrs;\n }\n function validateSync() {\n const validateErrs = (0, codegen_1._) `${validateRef}.errors`;\n gen.assign(validateErrs, null);\n assignValid(codegen_1.nil);\n return validateErrs;\n }\n function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {\n const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n const passSchema = !((\"compile\" in def && !$data) || def.schema === false);\n gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n }\n function reportErrs(errors) {\n var _a;\n gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);\n }\n}\nexports.funcKeywordCode = funcKeywordCode;\nfunction modifyData(cxt) {\n const { gen, data, it } = cxt;\n gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));\n}\nfunction addErrs(cxt, errs) {\n const { gen } = cxt;\n gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {\n gen\n .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)\n .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n (0, errors_1.extendErrors)(cxt);\n }, () => cxt.error());\n}\nfunction checkAsyncKeyword({ schemaEnv }, def) {\n if (def.async && !schemaEnv.$async)\n throw new Error(\"async keyword in sync schema\");\n}\nfunction useKeyword(gen, keyword, result) {\n if (result === undefined)\n throw new Error(`keyword \"${keyword}\" failed to compile`);\n return gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });\n}\nfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n // TODO add tests\n return (!schemaType.length ||\n schemaType.some((st) => st === \"array\"\n ? Array.isArray(schema)\n : st === \"object\"\n ? schema && typeof schema == \"object\" && !Array.isArray(schema)\n : typeof schema == st || (allowUndefined && typeof schema == \"undefined\")));\n}\nexports.validSchemaType = validSchemaType;\nfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n /* istanbul ignore if */\n if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {\n throw new Error(\"ajv implementation error\");\n }\n const deps = def.dependencies;\n if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {\n throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n }\n if (def.validateSchema) {\n const valid = def.validateSchema(schema[keyword]);\n if (!valid) {\n const msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` +\n self.errorsText(def.validateSchema.errors);\n if (opts.validateSchema === \"log\")\n self.logger.error(msg);\n else\n throw new Error(msg);\n }\n }\n}\nexports.validateKeywordUsage = validateKeywordUsage;\n//# sourceMappingURL=keyword.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n if (keyword !== undefined && schema !== undefined) {\n throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');\n }\n if (keyword !== undefined) {\n const sch = it.schema[keyword];\n return schemaProp === undefined\n ? {\n schema: sch,\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n }\n : {\n schema: sch[schemaProp],\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,\n };\n }\n if (schema !== undefined) {\n if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {\n throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');\n }\n return {\n schema,\n schemaPath,\n topSchemaRef,\n errSchemaPath,\n };\n }\n throw new Error('either \"keyword\" or \"schema\" must be passed');\n}\nexports.getSubschema = getSubschema;\nfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n if (data !== undefined && dataProp !== undefined) {\n throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');\n }\n const { gen } = it;\n if (dataProp !== undefined) {\n const { errorPath, dataPathArr, opts } = it;\n const nextData = gen.let(\"data\", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);\n dataContextProps(nextData);\n subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;\n subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n }\n if (data !== undefined) {\n const nextData = data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true); // replaceable if used once?\n dataContextProps(nextData);\n if (propertyName !== undefined)\n subschema.propertyName = propertyName;\n // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr\n }\n if (dataTypes)\n subschema.dataTypes = dataTypes;\n function dataContextProps(_nextData) {\n subschema.data = _nextData;\n subschema.dataLevel = it.dataLevel + 1;\n subschema.dataTypes = [];\n it.definedProperties = new Set();\n subschema.parentData = it.data;\n subschema.dataNames = [...it.dataNames, _nextData];\n }\n}\nexports.extendSubschemaData = extendSubschemaData;\nfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n if (compositeRule !== undefined)\n subschema.compositeRule = compositeRule;\n if (createErrors !== undefined)\n subschema.createErrors = createErrors;\n if (allErrors !== undefined)\n subschema.allErrors = allErrors;\n subschema.jtdDiscriminator = jtdDiscriminator; // not inherited\n subschema.jtdMetadata = jtdMetadata; // not inherited\n}\nexports.extendSubschemaMode = extendSubschemaMode;\n//# sourceMappingURL=subschema.js.map","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\nconst util_1 = require(\"./util\");\nconst equal = require(\"fast-deep-equal\");\nconst traverse = require(\"json-schema-traverse\");\n// TODO refactor to use keyword definitions\nconst SIMPLE_INLINED = new Set([\n \"type\",\n \"format\",\n \"pattern\",\n \"maxLength\",\n \"minLength\",\n \"maxProperties\",\n \"minProperties\",\n \"maxItems\",\n \"minItems\",\n \"maximum\",\n \"minimum\",\n \"uniqueItems\",\n \"multipleOf\",\n \"required\",\n \"enum\",\n \"const\",\n]);\nfunction inlineRef(schema, limit = true) {\n if (typeof schema == \"boolean\")\n return true;\n if (limit === true)\n return !hasRef(schema);\n if (!limit)\n return false;\n return countKeys(schema) <= limit;\n}\nexports.inlineRef = inlineRef;\nconst REF_KEYWORDS = new Set([\n \"$ref\",\n \"$recursiveRef\",\n \"$recursiveAnchor\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n]);\nfunction hasRef(schema) {\n for (const key in schema) {\n if (REF_KEYWORDS.has(key))\n return true;\n const sch = schema[key];\n if (Array.isArray(sch) && sch.some(hasRef))\n return true;\n if (typeof sch == \"object\" && hasRef(sch))\n return true;\n }\n return false;\n}\nfunction countKeys(schema) {\n let count = 0;\n for (const key in schema) {\n if (key === \"$ref\")\n return Infinity;\n count++;\n if (SIMPLE_INLINED.has(key))\n continue;\n if (typeof schema[key] == \"object\") {\n (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));\n }\n if (count === Infinity)\n return Infinity;\n }\n return count;\n}\nfunction getFullPath(resolver, id = \"\", normalize) {\n if (normalize !== false)\n id = normalizeId(id);\n const p = resolver.parse(id);\n return _getFullPath(resolver, p);\n}\nexports.getFullPath = getFullPath;\nfunction _getFullPath(resolver, p) {\n const serialized = resolver.serialize(p);\n return serialized.split(\"#\")[0] + \"#\";\n}\nexports._getFullPath = _getFullPath;\nconst TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n}\nexports.normalizeId = normalizeId;\nfunction resolveUrl(resolver, baseId, id) {\n id = normalizeId(id);\n return resolver.resolve(baseId, id);\n}\nexports.resolveUrl = resolveUrl;\nconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\nfunction getSchemaRefs(schema, baseId) {\n if (typeof schema == \"boolean\")\n return {};\n const { schemaId, uriResolver } = this.opts;\n const schId = normalizeId(schema[schemaId] || baseId);\n const baseIds = { \"\": schId };\n const pathPrefix = getFullPath(uriResolver, schId, false);\n const localRefs = {};\n const schemaRefs = new Set();\n traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n if (parentJsonPtr === undefined)\n return;\n const fullPath = pathPrefix + jsonPtr;\n let innerBaseId = baseIds[parentJsonPtr];\n if (typeof sch[schemaId] == \"string\")\n innerBaseId = addRef.call(this, sch[schemaId]);\n addAnchor.call(this, sch.$anchor);\n addAnchor.call(this, sch.$dynamicAnchor);\n baseIds[jsonPtr] = innerBaseId;\n function addRef(ref) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _resolve = this.opts.uriResolver.resolve;\n ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n if (schemaRefs.has(ref))\n throw ambiguos(ref);\n schemaRefs.add(ref);\n let schOrRef = this.refs[ref];\n if (typeof schOrRef == \"string\")\n schOrRef = this.refs[schOrRef];\n if (typeof schOrRef == \"object\") {\n checkAmbiguosRef(sch, schOrRef.schema, ref);\n }\n else if (ref !== normalizeId(fullPath)) {\n if (ref[0] === \"#\") {\n checkAmbiguosRef(sch, localRefs[ref], ref);\n localRefs[ref] = sch;\n }\n else {\n this.refs[ref] = fullPath;\n }\n }\n return ref;\n }\n function addAnchor(anchor) {\n if (typeof anchor == \"string\") {\n if (!ANCHOR.test(anchor))\n throw new Error(`invalid anchor \"${anchor}\"`);\n addRef.call(this, `#${anchor}`);\n }\n }\n });\n return localRefs;\n function checkAmbiguosRef(sch1, sch2, ref) {\n if (sch2 !== undefined && !equal(sch1, sch2))\n throw ambiguos(ref);\n }\n function ambiguos(ref) {\n return new Error(`reference \"${ref}\" resolves to more than one schema`);\n }\n}\nexports.getSchemaRefs = getSchemaRefs;\n//# sourceMappingURL=resolve.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\nconst boolSchema_1 = require(\"./boolSchema\");\nconst dataType_1 = require(\"./dataType\");\nconst applicability_1 = require(\"./applicability\");\nconst dataType_2 = require(\"./dataType\");\nconst defaults_1 = require(\"./defaults\");\nconst keyword_1 = require(\"./keyword\");\nconst subschema_1 = require(\"./subschema\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst resolve_1 = require(\"../resolve\");\nconst util_1 = require(\"../util\");\nconst errors_1 = require(\"../errors\");\n// schema compilation - generates validation function, subschemaCode (below) is used for subschemas\nfunction validateFunctionCode(it) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n topSchemaObjCode(it);\n return;\n }\n }\n validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n}\nexports.validateFunctionCode = validateFunctionCode;\nfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n if (opts.code.es5) {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n gen.code((0, codegen_1._) `\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n destructureValCxtES5(gen, opts);\n gen.code(body);\n });\n }\n else {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n }\n}\nfunction destructureValCxt(opts) {\n return (0, codegen_1._) `{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n}\nfunction destructureValCxtES5(gen, opts) {\n gen.if(names_1.default.valCxt, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n }, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `\"\"`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.rootData, names_1.default.data);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);\n });\n}\nfunction topSchemaObjCode(it) {\n const { schema, opts, gen } = it;\n validateFunction(it, () => {\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n checkNoDefault(it);\n gen.let(names_1.default.vErrors, null);\n gen.let(names_1.default.errors, 0);\n if (opts.unevaluated)\n resetEvaluated(it);\n typeAndKeywords(it);\n returnResults(it);\n });\n return;\n}\nfunction resetEvaluated(it) {\n // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated\n const { gen, validateName } = it;\n it.evaluated = gen.const(\"evaluated\", (0, codegen_1._) `${validateName}.evaluated`);\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));\n}\nfunction funcSourceUrl(schema, opts) {\n const schId = typeof schema == \"object\" && schema[opts.schemaId];\n return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;\n}\n// schema compilation - this function is used recursively to generate code for sub-schemas\nfunction subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}\nfunction schemaCxtHasRules({ schema, self }) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (self.RULES.all[key])\n return true;\n return false;\n}\nfunction isSchemaObj(it) {\n return typeof it.schema != \"boolean\";\n}\nfunction subSchemaObjCode(it, valid) {\n const { schema, gen, opts } = it;\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n updateContext(it);\n checkAsyncSchema(it);\n const errsCount = gen.const(\"_errs\", names_1.default.errors);\n typeAndKeywords(it, errsCount);\n // TODO var\n gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n}\nfunction checkKeywords(it) {\n (0, util_1.checkUnknownRules)(it);\n checkRefsAndKeywords(it);\n}\nfunction typeAndKeywords(it, errsCount) {\n if (it.opts.jtd)\n return schemaKeywords(it, [], false, errsCount);\n const types = (0, dataType_1.getSchemaTypes)(it.schema);\n const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);\n schemaKeywords(it, types, !checkedTypes, errsCount);\n}\nfunction checkRefsAndKeywords(it) {\n const { schema, errSchemaPath, opts, self } = it;\n if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {\n self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n }\n}\nfunction checkNoDefault(it) {\n const { schema, opts } = it;\n if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {\n (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n }\n}\nfunction updateContext(it) {\n const schId = it.schema[it.opts.schemaId];\n if (schId)\n it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n}\nfunction checkAsyncSchema(it) {\n if (it.schema.$async && !it.schemaEnv.$async)\n throw new Error(\"async schema in sync schema\");\n}\nfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n const msg = schema.$comment;\n if (opts.$comment === true) {\n gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);\n }\n else if (typeof opts.$comment == \"function\") {\n const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;\n const rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n }\n}\nfunction returnResults(it) {\n const { gen, schemaEnv, validateName, ValidationError, opts } = it;\n if (schemaEnv.$async) {\n // TODO assign unevaluated\n gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);\n if (opts.unevaluated)\n assignEvaluated(it);\n gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);\n }\n}\nfunction assignEvaluated({ gen, evaluated, props, items }) {\n if (props instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.props`, props);\n if (items instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.items`, items);\n}\nfunction schemaKeywords(it, types, typeErrors, errsCount) {\n const { gen, schema, data, allErrors, opts, self } = it;\n const { RULES } = self;\n if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n gen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition)); // TODO typecast\n return;\n }\n if (!opts.jtd)\n checkStrictTypes(it, types);\n gen.block(() => {\n for (const group of RULES.rules)\n groupKeywords(group);\n groupKeywords(RULES.post);\n });\n function groupKeywords(group) {\n if (!(0, applicability_1.shouldUseGroup)(schema, group))\n return;\n if (group.type) {\n gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n iterateKeywords(it, group);\n if (types.length === 1 && types[0] === group.type && typeErrors) {\n gen.else();\n (0, dataType_2.reportTypeError)(it);\n }\n gen.endIf();\n }\n else {\n iterateKeywords(it, group);\n }\n // TODO make it \"ok\" call?\n if (!allErrors)\n gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);\n }\n}\nfunction iterateKeywords(it, group) {\n const { gen, schema, opts: { useDefaults }, } = it;\n if (useDefaults)\n (0, defaults_1.assignDefaults)(it, group.type);\n gen.block(() => {\n for (const rule of group.rules) {\n if ((0, applicability_1.shouldUseRule)(schema, rule)) {\n keywordCode(it, rule.keyword, rule.definition, group.type);\n }\n }\n });\n}\nfunction checkStrictTypes(it, types) {\n if (it.schemaEnv.meta || !it.opts.strictTypes)\n return;\n checkContextTypes(it, types);\n if (!it.opts.allowUnionTypes)\n checkMultipleTypes(it, types);\n checkKeywordTypes(it, it.dataTypes);\n}\nfunction checkContextTypes(it, types) {\n if (!types.length)\n return;\n if (!it.dataTypes.length) {\n it.dataTypes = types;\n return;\n }\n types.forEach((t) => {\n if (!includesType(it.dataTypes, t)) {\n strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n }\n });\n narrowSchemaTypes(it, types);\n}\nfunction checkMultipleTypes(it, ts) {\n if (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) {\n strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n }\n}\nfunction checkKeywordTypes(it, ts) {\n const rules = it.self.RULES.all;\n for (const keyword in rules) {\n const rule = rules[keyword];\n if (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n const { type } = rule.definition;\n if (type.length && !type.some((t) => hasApplicableType(ts, t))) {\n strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n }\n }\n }\n}\nfunction hasApplicableType(schTs, kwdT) {\n return schTs.includes(kwdT) || (kwdT === \"number\" && schTs.includes(\"integer\"));\n}\nfunction includesType(ts, t) {\n return ts.includes(t) || (t === \"integer\" && ts.includes(\"number\"));\n}\nfunction narrowSchemaTypes(it, withTypes) {\n const ts = [];\n for (const t of it.dataTypes) {\n if (includesType(withTypes, t))\n ts.push(t);\n else if (withTypes.includes(\"integer\") && t === \"number\")\n ts.push(\"integer\");\n }\n it.dataTypes = ts;\n}\nfunction strictTypesError(it, msg) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n msg += ` at \"${schemaPath}\" (strictTypes)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n}\nclass KeywordCxt {\n constructor(it, def, keyword) {\n (0, keyword_1.validateKeywordUsage)(it, def, keyword);\n this.gen = it.gen;\n this.allErrors = it.allErrors;\n this.keyword = keyword;\n this.data = it.data;\n this.schema = it.schema[keyword];\n this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n this.schemaType = def.schemaType;\n this.parentSchema = it.schema;\n this.params = {};\n this.it = it;\n this.def = def;\n if (this.$data) {\n this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n }\n else {\n this.schemaCode = this.schemaValue;\n if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {\n throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n }\n }\n if (\"code\" in def ? def.trackErrors : def.errors !== false) {\n this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n }\n }\n result(condition, successAction, failAction) {\n this.failResult((0, codegen_1.not)(condition), successAction, failAction);\n }\n failResult(condition, successAction, failAction) {\n this.gen.if(condition);\n if (failAction)\n failAction();\n else\n this.error();\n if (successAction) {\n this.gen.else();\n successAction();\n if (this.allErrors)\n this.gen.endIf();\n }\n else {\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n }\n pass(condition, failAction) {\n this.failResult((0, codegen_1.not)(condition), undefined, failAction);\n }\n fail(condition) {\n if (condition === undefined) {\n this.error();\n if (!this.allErrors)\n this.gen.if(false); // this branch will be removed by gen.optimize\n return;\n }\n this.gen.if(condition);\n this.error();\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n fail$data(condition) {\n if (!this.$data)\n return this.fail(condition);\n const { schemaCode } = this;\n this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n }\n error(append, errorParams, errorPaths) {\n if (errorParams) {\n this.setParams(errorParams);\n this._error(append, errorPaths);\n this.setParams({});\n return;\n }\n this._error(append, errorPaths);\n }\n _error(append, errorPaths) {\n ;\n (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n }\n $dataError() {\n (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n }\n reset() {\n if (this.errsCount === undefined)\n throw new Error('add \"trackErrors\" to keyword definition');\n (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n }\n ok(cond) {\n if (!this.allErrors)\n this.gen.if(cond);\n }\n setParams(obj, assign) {\n if (assign)\n Object.assign(this.params, obj);\n else\n this.params = obj;\n }\n block$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n this.gen.block(() => {\n this.check$data(valid, $dataValid);\n codeBlock();\n });\n }\n check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n if (!this.$data)\n return;\n const { gen, schemaCode, schemaType, def } = this;\n gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));\n if (valid !== codegen_1.nil)\n gen.assign(valid, true);\n if (schemaType.length || def.validateSchema) {\n gen.elseIf(this.invalid$data());\n this.$dataError();\n if (valid !== codegen_1.nil)\n gen.assign(valid, false);\n }\n gen.else();\n }\n invalid$data() {\n const { gen, schemaCode, schemaType, def, it } = this;\n return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n function wrong$DataType() {\n if (schemaType.length) {\n /* istanbul ignore if */\n if (!(schemaCode instanceof codegen_1.Name))\n throw new Error(\"ajv implementation error\");\n const st = Array.isArray(schemaType) ? schemaType : [schemaType];\n return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n }\n return codegen_1.nil;\n }\n function invalid$DataSchema() {\n if (def.validateSchema) {\n const validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema }); // TODO value.code for standalone\n return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;\n }\n return codegen_1.nil;\n }\n }\n subschema(appl, valid) {\n const subschema = (0, subschema_1.getSubschema)(this.it, appl);\n (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n (0, subschema_1.extendSubschemaMode)(subschema, appl);\n const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };\n subschemaCode(nextContext, valid);\n return nextContext;\n }\n mergeEvaluated(schemaCxt, toName) {\n const { it, gen } = this;\n if (!it.opts.unevaluated)\n return;\n if (it.props !== true && schemaCxt.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n }\n if (it.items !== true && schemaCxt.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n }\n }\n mergeValidEvaluated(schemaCxt, valid) {\n const { it, gen } = this;\n if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n return true;\n }\n }\n}\nexports.KeywordCxt = KeywordCxt;\nfunction keywordCode(it, keyword, def, ruleType) {\n const cxt = new KeywordCxt(it, def, keyword);\n if (\"code\" in def) {\n def.code(cxt, ruleType);\n }\n else if (cxt.$data && def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n else if (\"macro\" in def) {\n (0, keyword_1.macroKeywordCode)(cxt, def);\n }\n else if (def.compile || def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n}\nconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n let jsonPointer;\n let data;\n if ($data === \"\")\n return names_1.default.rootData;\n if ($data[0] === \"/\") {\n if (!JSON_POINTER.test($data))\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n jsonPointer = $data;\n data = names_1.default.rootData;\n }\n else {\n const matches = RELATIVE_JSON_POINTER.exec($data);\n if (!matches)\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n const up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer === \"#\") {\n if (up >= dataLevel)\n throw new Error(errorMsg(\"property/index\", up));\n return dataPathArr[dataLevel - up];\n }\n if (up > dataLevel)\n throw new Error(errorMsg(\"data\", up));\n data = dataNames[dataLevel - up];\n if (!jsonPointer)\n return data;\n }\n let expr = data;\n const segments = jsonPointer.split(\"/\");\n for (const segment of segments) {\n if (segment) {\n data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n expr = (0, codegen_1._) `${expr} && ${data}`;\n }\n }\n return expr;\n function errorMsg(pointerType, up) {\n return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n }\n}\nexports.getData = getData;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ValidationError extends Error {\n constructor(errors) {\n super(\"validation failed\");\n this.errors = errors;\n this.ajv = this.validation = true;\n }\n}\nexports.default = ValidationError;\n//# sourceMappingURL=validation_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst resolve_1 = require(\"./resolve\");\nclass MissingRefError extends Error {\n constructor(resolver, baseId, ref, msg) {\n super(msg || `can't resolve reference ${ref} from id ${baseId}`);\n this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n }\n}\nexports.default = MissingRefError;\n//# sourceMappingURL=ref_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst validation_error_1 = require(\"../runtime/validation_error\");\nconst names_1 = require(\"./names\");\nconst resolve_1 = require(\"./resolve\");\nconst util_1 = require(\"./util\");\nconst validate_1 = require(\"./validate\");\nclass SchemaEnv {\n constructor(env) {\n var _a;\n this.refs = {};\n this.dynamicAnchors = {};\n let schema;\n if (typeof env.schema == \"object\")\n schema = env.schema;\n this.schema = env.schema;\n this.schemaId = env.schemaId;\n this.root = env.root || this;\n this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n this.schemaPath = env.schemaPath;\n this.localRefs = env.localRefs;\n this.meta = env.meta;\n this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n this.refs = {};\n }\n}\nexports.SchemaEnv = SchemaEnv;\n// let codeSize = 0\n// let nodeCount = 0\n// Compiles schema in SchemaEnv\nfunction compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: (0, codegen_1._) `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: (0, codegen_1._) `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n (0, validate_1.validateFunctionCode)(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}\nexports.compileSchema = compileSchema;\nfunction resolveRef(root, baseId, ref) {\n var _a;\n ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n const schOrFunc = root.refs[ref];\n if (schOrFunc)\n return schOrFunc;\n let _sch = resolve.call(this, root, ref);\n if (_sch === undefined) {\n const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv\n const { schemaId } = this.opts;\n if (schema)\n _sch = new SchemaEnv({ schema, schemaId, root, baseId });\n }\n if (_sch === undefined)\n return;\n return (root.refs[ref] = inlineOrCompile.call(this, _sch));\n}\nexports.resolveRef = resolveRef;\nfunction inlineOrCompile(sch) {\n if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))\n return sch.schema;\n return sch.validate ? sch : compileSchema.call(this, sch);\n}\n// Index of schema compilation in the currently compiled list\nfunction getCompilingSchema(schEnv) {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv))\n return sch;\n }\n}\nexports.getCompilingSchema = getCompilingSchema;\nfunction sameSchemaEnv(s1, s2) {\n return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n}\n// resolve and compile the references ($ref)\n// TODO returns AnySchemaObject (if the schema can be inlined) or validation function\nfunction resolve(root, // information about the root schema for the current schema\nref // reference to resolve\n) {\n let sch;\n while (typeof (sch = this.refs[ref]) == \"string\")\n ref = sch;\n return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n}\n// Resolve schema, its root and baseId\nfunction resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = this.opts.uriResolver.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}\nexports.resolveSchema = resolveSchema;\nconst PREVENT_SCOPE_CHANGE = new Set([\n \"properties\",\n \"patternProperties\",\n \"enum\",\n \"dependencies\",\n \"definitions\",\n]);\nfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n var _a;\n if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\")\n return;\n for (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n if (typeof schema === \"boolean\")\n return;\n const partSchema = schema[(0, util_1.unescapeFragment)(part)];\n if (partSchema === undefined)\n return;\n schema = partSchema;\n // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?\n const schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n }\n }\n let env;\n if (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n env = resolveSchema.call(this, root, $ref);\n }\n // even though resolution failed we need to return SchemaEnv to throw exception\n // so that compileAsync loads missing schema.\n const { schemaId } = this.opts;\n env = env || new SchemaEnv({ schema, schemaId, root, baseId });\n if (env.schema !== env.root.schema)\n return env;\n return undefined;\n}\n//# sourceMappingURL=index.js.map","","'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isPort = RegExp.prototype.test.bind(/^\\d*$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:]$/u)\n\nconst BYTE_HEX = new Array(256)\n{\n const HEX_DIGITS = '0123456789ABCDEF'\n for (let i = 0; i < 256; i++) {\n BYTE_HEX[i] = '%' + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 0xF]\n }\n}\nfunction percentEncodeNonAscii (cp) {\n if (cp < 0x800) {\n return BYTE_HEX[0xC0 | (cp >> 6)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n if (cp < 0x10000) {\n return BYTE_HEX[0xE0 | (cp >> 12)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n return BYTE_HEX[0xF0 | (cp >> 18)] +\n BYTE_HEX[0x80 | ((cp >> 12) & 0x3F)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n}\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/** @type {(value: string) => boolean} */\nconst isHextet = RegExp.prototype.test.bind(/^[\\dA-Fa-f]{1,4}$/)\n\n/** @type {(value: string) => boolean} */\nconst isIPvFuture = RegExp.prototype.test.bind(/^[vV][\\dA-Fa-f]+\\.[A-Za-z\\d\\-._~!$&'()*+,;=:]+$/)\n\n/** @type {(value: string) => boolean} */\nconst isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\\d\\-._~]$/)\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {string} zone\n * @returns {boolean}\n */\nfunction isZoneIdentifier (zone) {\n if (zone.length === 0) return false\n\n for (let i = 0; i < zone.length; i++) {\n if (isZoneCharacter(zone[i])) continue\n if (zone[i] === '%' && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {\n i += 2\n continue\n }\n return false\n }\n\n return true\n}\n\n/**\n * Compresses the longest run of zero hextets to \"::\" per RFC 5952. A run of a\n * single zero hextet is left uncompressed. On ties the leftmost run wins.\n *\n * @param {string[]} hextets\n * @returns {string}\n */\nfunction compressIPv6ZeroRun (hextets) {\n let bestStart = -1\n let bestLength = 0\n let runStart = -1\n let runLength = 0\n for (let i = 0; i < hextets.length; i++) {\n if (hextets[i] === '0') {\n if (runStart === -1) runStart = i\n runLength++\n if (runLength > bestLength) {\n bestLength = runLength\n bestStart = runStart\n }\n } else {\n runStart = -1\n runLength = 0\n }\n }\n\n if (bestLength < 2) return hextets.join(':')\n\n const head = hextets.slice(0, bestStart).join(':')\n const tail = hextets.slice(bestStart + bestLength).join(':')\n return head + '::' + tail\n}\n\n/**\n * Validates an IPv6 address against the alternatives in RFC 3986 section\n * 3.2.2 and returns the same address with leading hextet zeroes removed.\n * An embedded IPv4 address counts as two hextets and is only valid at the end.\n *\n * @param {string} input\n * @returns {string|undefined}\n */\nfunction normalizeIPv6Address (input) {\n const compression = input.indexOf('::')\n if (compression !== -1 && input.indexOf('::', compression + 1) !== -1) return undefined\n\n const left = compression === -1 ? input.split(':') : input.slice(0, compression).split(':')\n const right = compression === -1 ? [] : input.slice(compression + 2).split(':')\n if (compression !== -1) {\n if (left.length === 1 && left[0] === '') left.length = 0\n if (right.length === 1 && right[0] === '') right.length = 0\n }\n\n const parts = left.concat(right)\n let hextetCount = 0\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (part === '') return undefined\n\n if (part.indexOf('.') !== -1) {\n if (i !== parts.length - 1 || (compression !== -1 && right.length === 0) || !isIPv4(part)) return undefined\n hextetCount += 2\n continue\n }\n\n if (!isHextet(part)) return undefined\n parts[i] = parseInt(part, 16).toString(16)\n hextetCount++\n }\n\n if (compression === -1) {\n if (hextetCount !== 8) return undefined\n return compressIPv6ZeroRun(parts)\n }\n if (hextetCount >= 8) return undefined\n\n // expand \"::\" then re-compress the longest run for a canonical result\n const expanded = parts.slice(0, left.length)\n for (let i = hextetCount; i < 8; i++) expanded.push('0')\n for (let i = left.length; i < parts.length; i++) expanded.push(parts[i])\n return compressIPv6ZeroRun(expanded)\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n * @property {boolean} [isIPVFuture] - Indicates if the host is an IPvFuture literal.\n * @property {boolean} [error] - Indicates if a bracketed IP literal is malformed.\n */\n\n/**\n * Validates and normalizes a bracketed IP literal. Raw zone separators remain\n * accepted for backwards compatibility, while encoded separators and zone\n * contents follow RFC 6874.\n *\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n const bracketed = host[0] === '[' && host[host.length - 1] === ']'\n const hasBracket = host[0] === '[' || host[host.length - 1] === ']'\n if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }\n\n let input = bracketed ? host.slice(1, -1) : host\n if (bracketed && isIPvFuture(input)) {\n input = input.toLowerCase()\n return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }\n }\n\n if (findToken(input, ':') < 2) {\n return { host, isIPV6: false, error: bracketed }\n }\n\n let zoneIdentifier = ''\n const zoneSeparator = input.indexOf('%')\n if (zoneSeparator !== -1) {\n const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === '%25' ? 3 : 1\n zoneIdentifier = input.slice(zoneSeparator + separatorLength)\n if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }\n input = input.slice(0, zoneSeparator)\n }\n\n const address = normalizeIPv6Address(input)\n if (address === undefined) return { host, isIPV6: false, error: true }\n\n return {\n host: address + (zoneIdentifier ? '%' + zoneIdentifier : ''),\n escapedHost: address + (zoneIdentifier ? '%25' + zoneIdentifier : ''),\n isIPV6: true\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.' || input[1] === '/') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Removes dot segments from the path of a relative reference (a path that does\n * not start with \"/\") without changing what it resolves to against any base.\n * Unlike `removeDotSegments`, leading \"..\" segments that cannot be collapsed\n * are kept, the result never becomes root-relative, and a result that would be\n * empty or start with an empty segment is prefixed with \".\" (an empty path\n * means \"same document\" and a leading \"//\" would introduce an authority).\n *\n * @param {string} path\n * @returns {string}\n */\nfunction removeDotSegmentsRelative (path) {\n if (path === '' || path[0] === '/') {\n return removeDotSegments(path)\n }\n\n const segments = path.split('/')\n const last = segments.length - 1\n /** @type {string[]} */\n const output = []\n let trailingDirectory = false\n\n for (let i = 0; i <= last; i++) {\n const segment = segments[i]\n if (segment === '.' || segment === '..') {\n if (segment === '..') {\n if (output.length !== 0 && output[output.length - 1] !== '..') {\n output.pop()\n } else {\n output.push('..')\n }\n }\n trailingDirectory = i === last\n } else {\n output.push(segment)\n }\n }\n\n if (trailingDirectory && output[output.length - 1] !== '..') {\n output.push('')\n }\n if (output.length === 0 || output[0] === '' || output[0].includes(':')) {\n // An empty path, a leading empty segment (\"//\"), or a first segment\n // containing \":\" (which would be mistaken for a scheme, RFC 3986 section\n // 4.2) must stay behind a \".\" segment so the reference keeps its meaning.\n output.unshift('.')\n }\n\n return output.join('/')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` stay escaped; `%2E` is unreserved.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Serializes a path without rewriting reserved data. Raw RFC 3986 path\n * characters remain literal, valid escapes are preserved and uppercased, and\n * everything else is UTF-8 percent-encoded. In a path-noscheme, a colon in the\n * first segment must be escaped so the result cannot be parsed as a scheme.\n *\n * @param {string} input\n * @param {boolean} [pathNoScheme=false]\n * @returns {string}\n */\nfunction serializePathEncoding (input, pathNoScheme = false) {\n let output = ''\n let firstSegment = pathNoScheme && input[0] !== '/'\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (ch === '/') {\n firstSegment = false\n }\n\n if (isPathCharacter(ch) && (ch !== ':' || !firstSegment)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Percent-encodes a URI component using its RFC 3986 literal character set.\n * Existing valid escapes are preserved and normalized to uppercase hex.\n *\n * @param {string} input\n * @param {(value: string) => boolean} isAllowed\n * @returns {string}\n */\nfunction encodeComponent (input, isAllowed) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (isAllowed(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Encodes userinfo while preserving its RFC 3986 §3.2.1 literal characters.\n * In particular, authority delimiters such as `@`, `/`, `?`, and `#` are data.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeUserinfo (input) {\n return encodeComponent(input, isUserinfoCharacter)\n}\n\n/**\n * Encodes query data using the RFC 3986 §3.4 grammar. A literal `#` must be\n * escaped because it would otherwise begin the fragment component.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeQuery (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\n/**\n * Encodes fragment data using the RFC 3986 §3.5 grammar.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeFragment (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\nfunction isEscapeSafe (cp) {\n return (\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5A) ||\n (cp >= 0x61 && cp <= 0x7A) ||\n cp === 0x2A || cp === 0x2B || cp === 0x2D || cp === 0x2E ||\n cp === 0x2F || cp === 0x40 || cp === 0x5F\n )\n}\n\n/**\n * Normalizes the percent-encoding of a query or fragment component.\n *\n * Like `normalizePathEncoding`, but uses the query/fragment character set\n * (which additionally allows `?`) and decodes `.` since it has no dot-segment\n * meaning outside of a path.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeQueryFragmentEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isQueryFragmentCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n output += escape(input[i])\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(encodeUserinfo(component.userinfo))\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = component.host\n if (!isIPv4(host)) {\n let ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {\n // Decode only unreserved bytes, once. In particular, keep %25 encoded\n // so it cannot introduce a second escape during recomposition.\n host = normalizePercentEncoding(host, true)\n ipV6res = normalizeIPv6(host)\n }\n if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n const port = String(component.port)\n if (!isPort(port)) {\n throw new TypeError('URI port is malformed.')\n }\n uriTokens.push(':')\n uriTokens.push(port)\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n serializePathEncoding,\n normalizeQueryFragmentEncoding,\n encodeUserinfo,\n encodeQuery,\n encodeFragment,\n escapePreservingEscapes,\n removeDotSegments,\n removeDotSegmentsRelative,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n","'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /^([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-./:;=@]|%[\\da-f]{2})+)$/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const queryIndex = wsComponent.resourceName.indexOf('?')\n const path = queryIndex === -1\n ? wsComponent.resourceName\n : wsComponent.resourceName.slice(0, queryIndex)\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = queryIndex === -1\n ? undefined\n : wsComponent.resourceName.slice(queryIndex + 1)\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches && matches[0] === urnComponent.path) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n","'use strict'\n\nconst { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\nconst VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u\nconst MALFORMED_SCHEME_ERROR = 'URI scheme is malformed.'\nconst MALFORMED_HOST_ERROR = 'URI host is malformed.'\n// ASCII characters outside the RFC 3986 reg-name set (unreserved, sub-delims\n// and \"%\" for pct-encoded): C0 controls, space, DEL, and \"#/:<>?@[\\]^`{|}.\nconst FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\\0-\\x20\"#/:<>?@[\\\\\\]^`{|}\\x7F]/u\n\n/**\n * RFC 3986 section 3.1 does not allow percent-encoding in a scheme, so the\n * scheme is validated as-is and never decoded. Decoding would let inert input\n * such as `%6Aavascript:` become a live `javascript:` scheme.\n *\n * @param {string} scheme\n * @returns {string}\n */\nfunction validateScheme (scheme) {\n const stringScheme = String(scheme)\n if (!VALID_SCHEME.test(stringScheme)) {\n throw new TypeError(MALFORMED_SCHEME_ERROR)\n }\n return stringScheme\n}\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const {\n parsed: baseParsed,\n malformedAuthorityOrPort: baseMalformed,\n malformedPercentEncoding: baseMalformedPercentEncoding,\n malformedSchemeSpecific: baseMalformedSchemeSpecific,\n malformedHost: baseMalformedHost,\n malformedScheme: baseMalformedScheme\n } = parseWithStatus(baseURI, schemelessOptions)\n const {\n parsed: relativeParsed,\n malformedAuthorityOrPort: relativeMalformed,\n malformedPercentEncoding: relativeMalformedPercentEncoding,\n malformedSchemeSpecific: relativeMalformedSchemeSpecific,\n malformedHost: relativeMalformedHost,\n malformedScheme: relativeMalformedScheme\n } = parseWithStatus(relativeURI, schemelessOptions)\n if (\n baseMalformed ||\n relativeMalformed ||\n baseMalformedPercentEncoding ||\n relativeMalformedPercentEncoding ||\n baseMalformedSchemeSpecific ||\n relativeMalformedSchemeSpecific ||\n baseMalformedHost ||\n relativeMalformedHost ||\n baseMalformedScheme ||\n relativeMalformedScheme\n ) {\n throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.')\n }\n const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true)\n const resolvedSchemeHandler = getSchemeHandler((options && options.scheme) || resolved.scheme)\n const resolvedHost = resolved.host\n const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== '' &&\n (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6)\n // Inputs are parsed scheme-neutrally, so delimiters and controls in a domain\n // host are only detected here, once the final scheme is known. They always\n // fail closed, including in percent-encoded hosts.\n if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {\n throw new Error(MALFORMED_HOST_ERROR)\n }\n canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)\n // Percent escapes in an ASCII reg-name are encoded data. The WHATWG hostname\n // parser can reject them even though fast-uri preserves them safely as RFC\n // 3986 data. A raw non-ASCII host must still fail closed if conversion fails.\n const encodedASCIIHost = resolvedHost && resolvedHost.indexOf('%') !== -1 &&\n !/\\P{ASCII}/u.test(resolvedHost)\n if (resolved.error && !encodedASCIIHost) {\n throw new Error(resolved.error)\n }\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined\n if (baseHasAuthority && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== '/'\n ? removeDotSegmentsRelative(target.path)\n : removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n if (component.scheme) {\n component.scheme = validateScheme(component.scheme)\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined\n // A reference with no emitted scheme is path-noscheme: a bare ':' in its\n // first path segment would reparse as a scheme (RFC 3986 3.3/4.2). Enforced\n // under skipEscape too (resolve()), so the reapply below gates on this flag.\n const schemelessReference = (component.scheme === undefined || options.reference === 'suffix') && !hasAuthority\n const pathNoScheme = !options.skipEscape && schemelessReference\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = serializePathEncoding(component.path, pathNoScheme)\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n // Scheme handlers may replace the scheme during serialization.\n component.scheme = validateScheme(component.scheme)\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n // A relative-path reference keeps its unresolvable leading \"..\" segments\n // and must never become root-relative (RFC 3986 section 5.2.4 applies to\n // merged target paths, not to the reference itself).\n s = schemelessReference && s[0] !== '/'\n ? removeDotSegmentsRelative(s)\n : removeDotSegments(s)\n }\n\n // Dot-segment removal can expose a colon that was not originally in the\n // first segment (for example, \"./a:b\"). Reapply path-noscheme encoding so\n // the serialized relative reference cannot be reparsed as a URI scheme.\n if (schemelessReference) {\n s = serializePathEncoding(s, true)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', encodeQuery(component.query))\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', encodeFragment(component.fragment))\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n// Captures the authority component (between \"//\" and the next \"/\", \"?\" or \"#\"),\n// with or without a scheme prefix, for the literal-backslash rejection below.\nconst AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\\/\\/([^/?#]*)/\n\n// Captures the leading authority-introducer region after an optional scheme: a\n// run of forward slashes, backslashes, and the characters the WHATWG URL parser\n// removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer\n// is exactly \"//\". Node treats \"\\\" as \"/\" on special schemes and strips those\n// characters first, so forms like \"\\\\\", \"/\\\", \"\\/\", \"/<TAB>/\", or a leading\n// \"<TAB>//\" reach an authority in Node while fast-uri's URI_PARSE folds them into\n// the path group (host confusion / SSRF / redirect bypass).\nconst AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\\\\t\\n\\r]*)/\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * Checks percent syntax without decoding the represented octets. RFC 3986\n * percent-encoding is byte-oriented, so sequences such as `%FF` are valid even\n * though they are not independently valid UTF-8.\n *\n * @param {string|undefined} component\n * @returns {boolean}\n */\nfunction hasMalformedPercentEncoding (component) {\n if (component === undefined) return false\n\n let percent = component.indexOf('%')\n while (percent !== -1) {\n if (percent + 2 >= component.length || !/^[\\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {\n return true\n }\n percent = component.indexOf('%', percent + 3)\n }\n\n return false\n}\n\n/**\n * Whether the host is a bracketed IP literal (RFC 3986 `IP-literal`).\n * An unterminated `[` is not a literal, so it must still be validated as a\n * reg-name instead of being waved through as an IP.\n *\n * @param {string} host\n * @returns {boolean}\n */\nfunction isIPLiteral (host) {\n return host[0] === '[' && host[host.length - 1] === ']'\n}\n\n/**\n * @param {RegExpMatchArray} matches\n * @returns {boolean}\n */\nfunction hasMalformedComponentPercentEncoding (matches) {\n // Bracketed IP literals use a raw \"%\" as the zone separator for historical\n // compatibility. Their parsing is intentionally left to normalizeIPv6.\n const host = matches[4]\n return hasMalformedPercentEncoding(matches[3]) ||\n (host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host)) ||\n hasMalformedPercentEncoding(matches[6]) ||\n hasMalformedPercentEncoding(matches[7]) ||\n hasMalformedPercentEncoding(matches[8])\n}\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {import('./types/index').Options} options\n * @param {{ domainHost?: boolean, unicodeSupport?: boolean }|undefined} schemeHandler\n * @param {boolean} isIP\n * @returns {boolean} whether host conversion failed\n */\nfunction canonicalizeHost (parsed, options, schemeHandler, isIP) {\n if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n return true\n }\n\n if (\n !options.unicodeSupport &&\n (!schemeHandler || !schemeHandler.unicodeSupport) &&\n parsed.host &&\n !isIPLiteral(parsed.host) &&\n (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&\n isIP === false &&\n nonSimpleDomain(parsed.host)\n ) {\n let url\n try {\n url = new URL('http://' + parsed.host)\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n return true\n }\n // The WHATWG parser must have read the whole input as a host. Anything\n // else means it found a delimiter fast-uri did not, so its hostname would\n // describe a different authority.\n if (!isHostOnlyURL(url)) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n return true\n }\n parsed.host = url.hostname\n }\n return false\n}\n\n/**\n * Whether a domain host contains an ASCII character that RFC 3986 does not\n * allow in a reg-name (unreserved, sub-delims, or pct-encoded). Such a host is\n * rejected instead of being handed to the WHATWG URL parser, which would treat\n * \"@\" as a userinfo delimiter (silently dropping the data before it) and strip\n * TAB, LF, and CR. Non-ASCII characters remain allowed for IDNs.\n *\n * @param {import('./types/index').URIComponent} parsed\n * @param {import('./types/index').Options} options\n * @param {{ domainHost?: boolean }|undefined} schemeHandler\n * @param {boolean} isIP\n * @returns {boolean}\n */\nfunction hasForbiddenDomainHost (parsed, options, schemeHandler, isIP) {\n return Boolean(\n parsed.host &&\n isIP === false &&\n !isIPLiteral(parsed.host) &&\n (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&\n FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)\n )\n}\n\n/**\n * @param {URL} url\n * @returns {boolean}\n */\nfunction isHostOnlyURL (url) {\n return url.username === '' &&\n url.password === '' &&\n url.port === '' &&\n url.pathname === '/' &&\n url.search === '' &&\n url.hash === '' &&\n url.hostname !== ''\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n let malformedPercentEncoding = false\n let malformedSchemeSpecific = false\n let malformedHost = false\n let malformedIPLiteral = false\n let malformedScheme = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is\n // not an authority delimiter. Reject it in the authority rather than\n // rewriting it: normalizing \"\\\" -> \"/\" (WHATWG error recovery) could silently\n // change the resource identified by an otherwise-invalid input, and lets \"\\\"\n // act as a host delimiter here while Node's native URL parses a different\n // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is\n // untouched and remains valid encoded data.\n const authorityMatch = uri.match(AUTHORITY_PREFIX)\n if (authorityMatch !== null && authorityMatch[1].indexOf('\\\\') !== -1) {\n parsed.error = 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n }\n\n // Reject a malformed or whitespace-smuggled authority introducer. fast-uri\n // only recognizes a literal \"//\"; anything else in the leading separator run\n // (a backslash, or a \"//\" that appears only after removing the TAB/LF/CR that\n // Node strips) means the authority fast-uri parses differs from the one Node's\n // URL resolves. Reject rather than rewrite, mirroring the literal-backslash\n // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data.\n const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION)\n if (introducerMatch !== null) {\n const region = introducerMatch[1]\n const normalizedRegion = region.replace(/[\\t\\n\\r]/g, '')\n // Two or more leading separators introduce an authority.\n if (normalizedRegion.length >= 2) {\n if (normalizedRegion.slice(0, 2) !== '//') {\n parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n } else if (region.length !== normalizedRegion.length) {\n parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'\n malformedAuthorityOrPort = true\n }\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n if (parsed.scheme !== undefined) {\n if (VALID_SCHEME.test(parsed.scheme)) {\n parsed.scheme = parsed.scheme.toLowerCase()\n } else {\n parsed.error = parsed.error || MALFORMED_SCHEME_ERROR\n malformedScheme = true\n }\n }\n\n malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches)\n if (malformedPercentEncoding) {\n parsed.error = parsed.error || 'URI contains malformed percent-encoding.'\n }\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const bracketedIPLiteral = isIPLiteral(parsed.host)\n const hasIPLiteralBracket = parsed.host.indexOf('[') !== -1 || parsed.host.indexOf(']') !== -1\n const ipv6result = normalizeIPv6(parsed.host)\n isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true\n malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true)\n parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase()\n\n if (malformedIPLiteral) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n malformedAuthorityOrPort = true\n }\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // convert Unicode IDN -> ASCII IDN when the effective scheme uses domain hosts\n if (!malformedIPLiteral) {\n malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP)\n }\n\n if (uri.indexOf('%') !== -1 && parsed.host !== undefined && !malformedIPLiteral) {\n let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true)\n if (!isIP) {\n // Fold reg-name case after decoding unreserved octets. The second\n // pass only restores uppercase hex in escapes that remain encoded.\n host = normalizePercentEncoding(host.toLowerCase())\n }\n // Resolution parses both inputs with the internal `null` scheme before\n // the effective scheme is known. Keep raw host delimiters for that step\n // so resolve() can reject them for domain-host schemes; the resolved\n // authority is encoded when it is serialized.\n parsed.host = isIP || options.scheme !== 'null' ? reescapeHostDelimiters(host, isIP) : host\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.query) {\n parsed.query = normalizeQueryFragmentEncoding(parsed.query)\n }\n if (parsed.fragment) {\n parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment)\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {\n malformedSchemeSpecific = true\n }\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort,\n malformedPercentEncoding,\n malformedSchemeSpecific,\n malformedHost,\n malformedScheme\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri !== 'string' && typeof uri !== 'object') {\n return undefined\n }\n\n let value\n try {\n value = typeof uri === 'string' ? uri : serialize(uri, opts)\n } catch {\n return undefined\n }\n const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts)\n return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uri = require(\"fast-uri\");\nuri.code = 'require(\"ajv/dist/runtime/uri\").default';\nexports.default = uri;\n//# sourceMappingURL=uri.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nconst validation_error_1 = require(\"./runtime/validation_error\");\nconst ref_error_1 = require(\"./compile/ref_error\");\nconst rules_1 = require(\"./compile/rules\");\nconst compile_1 = require(\"./compile\");\nconst codegen_2 = require(\"./compile/codegen\");\nconst resolve_1 = require(\"./compile/resolve\");\nconst dataType_1 = require(\"./compile/validate/dataType\");\nconst util_1 = require(\"./compile/util\");\nconst $dataRefSchema = require(\"./refs/data.json\");\nconst uri_1 = require(\"./runtime/uri\");\nconst defaultRegExp = (str, flags) => new RegExp(str, flags);\ndefaultRegExp.code = \"new RegExp\";\nconst META_IGNORE_OPTIONS = [\"removeAdditional\", \"useDefaults\", \"coerceTypes\"];\nconst EXT_SCOPE_NAMES = new Set([\n \"validate\",\n \"serialize\",\n \"parse\",\n \"wrapper\",\n \"root\",\n \"schema\",\n \"keyword\",\n \"pattern\",\n \"formats\",\n \"validate$data\",\n \"func\",\n \"obj\",\n \"Error\",\n]);\nconst removedOptions = {\n errorDataPath: \"\",\n format: \"`validateFormats: false` can be used instead.\",\n nullable: '\"nullable\" keyword is supported by default.',\n jsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n extendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n missingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n processCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n sourceCode: \"Use option `code: {source: true}`\",\n strictDefaults: \"It is default now, see option `strict`.\",\n strictKeywords: \"It is default now, see option `strict`.\",\n uniqueItems: '\"uniqueItems\" keyword is always validated.',\n unknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n cache: \"Map is used as cache, schema object as key.\",\n serialize: \"Map is used as cache, schema object as key.\",\n ajvErrors: \"It is default now.\",\n};\nconst deprecatedOptions = {\n ignoreKeywordsWithRef: \"\",\n jsPropertySyntax: \"\",\n unicode: '\"minLength\"/\"maxLength\" account for unicode characters by default.',\n};\nconst MAX_EXPRESSION = 200;\n// eslint-disable-next-line complexity\nfunction requiredOptions(o) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n const s = o.strict;\n const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;\n const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n return {\n strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },\n loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n uriResolver: uriResolver,\n };\n}\nclass Ajv {\n constructor(opts = {}) {\n this.schemas = {};\n this.refs = {};\n this.formats = Object.create(null);\n this._compilations = new Set();\n this._loading = {};\n this._cache = new Map();\n opts = this.opts = { ...opts, ...requiredOptions(opts) };\n const { es5, lines } = this.opts.code;\n this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });\n this.logger = getLogger(opts.logger);\n const formatOpt = opts.validateFormats;\n opts.validateFormats = false;\n this.RULES = (0, rules_1.getRules)();\n checkOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n checkOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n this._metaOpts = getMetaSchemaOptions.call(this);\n if (opts.formats)\n addInitialFormats.call(this);\n this._addVocabularies();\n this._addDefaultMetaSchema();\n if (opts.keywords)\n addInitialKeywords.call(this, opts.keywords);\n if (typeof opts.meta == \"object\")\n this.addMetaSchema(opts.meta);\n addInitialSchemas.call(this);\n opts.validateFormats = formatOpt;\n }\n _addVocabularies() {\n this.addKeyword(\"$async\");\n }\n _addDefaultMetaSchema() {\n const { $data, meta, schemaId } = this.opts;\n let _dataRefSchema = $dataRefSchema;\n if (schemaId === \"id\") {\n _dataRefSchema = { ...$dataRefSchema };\n _dataRefSchema.id = _dataRefSchema.$id;\n delete _dataRefSchema.$id;\n }\n if (meta && $data)\n this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n }\n defaultMeta() {\n const { meta, schemaId } = this.opts;\n return (this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : undefined);\n }\n validate(schemaKeyRef, // key, ref or schema object\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n data // to be validated\n ) {\n let v;\n if (typeof schemaKeyRef == \"string\") {\n v = this.getSchema(schemaKeyRef);\n if (!v)\n throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n }\n else {\n v = this.compile(schemaKeyRef);\n }\n const valid = v(data);\n if (!(\"$async\" in v))\n this.errors = v.errors;\n return valid;\n }\n compile(schema, _meta) {\n const sch = this._addSchema(schema, _meta);\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n compileAsync(schema, meta) {\n if (typeof this.opts.loadSchema != \"function\") {\n throw new Error(\"options.loadSchema should be a function\");\n }\n const { loadSchema } = this.opts;\n return runCompileAsync.call(this, schema, meta);\n async function runCompileAsync(_schema, _meta) {\n await loadMetaSchema.call(this, _schema.$schema);\n const sch = this._addSchema(_schema, _meta);\n return sch.validate || _compileAsync.call(this, sch);\n }\n async function loadMetaSchema($ref) {\n if ($ref && !this.getSchema($ref)) {\n await runCompileAsync.call(this, { $ref }, true);\n }\n }\n async function _compileAsync(sch) {\n try {\n return this._compileSchemaEnv(sch);\n }\n catch (e) {\n if (!(e instanceof ref_error_1.default))\n throw e;\n checkLoaded.call(this, e);\n await loadMissingSchema.call(this, e.missingSchema);\n return _compileAsync.call(this, sch);\n }\n }\n function checkLoaded({ missingSchema: ref, missingRef }) {\n if (this.refs[ref]) {\n throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n }\n }\n async function loadMissingSchema(ref) {\n const _schema = await _loadSchema.call(this, ref);\n if (!this.refs[ref])\n await loadMetaSchema.call(this, _schema.$schema);\n if (!this.refs[ref])\n this.addSchema(_schema, ref, meta);\n }\n async function _loadSchema(ref) {\n const p = this._loading[ref];\n if (p)\n return p;\n try {\n return await (this._loading[ref] = loadSchema(ref));\n }\n finally {\n delete this._loading[ref];\n }\n }\n }\n // Adds schema to the instance\n addSchema(schema, // If array is passed, `key` will be ignored\n key, // 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`.\n _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.\n ) {\n if (Array.isArray(schema)) {\n for (const sch of schema)\n this.addSchema(sch, undefined, _meta, _validateSchema);\n return this;\n }\n let id;\n if (typeof schema === \"object\") {\n const { schemaId } = this.opts;\n id = schema[schemaId];\n if (id !== undefined && typeof id != \"string\") {\n throw new Error(`schema ${schemaId} must be string`);\n }\n }\n key = (0, resolve_1.normalizeId)(key || id);\n this._checkUnique(key);\n this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n return this;\n }\n // Add schema that will be used to validate other schemas\n // options in META_IGNORE_OPTIONS are alway set to false\n addMetaSchema(schema, key, // schema key\n _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema\n ) {\n this.addSchema(schema, key, true, _validateSchema);\n return this;\n }\n // Validate schema against its meta-schema\n validateSchema(schema, throwOrLogError) {\n if (typeof schema == \"boolean\")\n return true;\n let $schema;\n $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != \"string\") {\n throw new Error(\"$schema must be a string\");\n }\n $schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n if (!$schema) {\n this.logger.warn(\"meta-schema not available\");\n this.errors = null;\n return true;\n }\n const valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n const message = \"schema is invalid: \" + this.errorsText();\n if (this.opts.validateSchema === \"log\")\n this.logger.error(message);\n else\n throw new Error(message);\n }\n return valid;\n }\n // Get compiled schema by `key` or `ref`.\n // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)\n getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n // Remove cached schema(s).\n // If no parameter is passed all schemas but meta-schemas are removed.\n // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n this._removeAllSchemas(this.schemas, schemaKeyRef);\n this._removeAllSchemas(this.refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case \"undefined\":\n this._removeAllSchemas(this.schemas);\n this._removeAllSchemas(this.refs);\n this._cache.clear();\n return this;\n case \"string\": {\n const sch = getSchEnv.call(this, schemaKeyRef);\n if (typeof sch == \"object\")\n this._cache.delete(sch.schema);\n delete this.schemas[schemaKeyRef];\n delete this.refs[schemaKeyRef];\n return this;\n }\n case \"object\": {\n const cacheKey = schemaKeyRef;\n this._cache.delete(cacheKey);\n let id = schemaKeyRef[this.opts.schemaId];\n if (id) {\n id = (0, resolve_1.normalizeId)(id);\n delete this.schemas[id];\n delete this.refs[id];\n }\n return this;\n }\n default:\n throw new Error(\"ajv.removeSchema: invalid parameter\");\n }\n }\n // add \"vocabulary\" - a collection of keywords\n addVocabulary(definitions) {\n for (const def of definitions)\n this.addKeyword(def);\n return this;\n }\n addKeyword(kwdOrDef, def // deprecated\n ) {\n let keyword;\n if (typeof kwdOrDef == \"string\") {\n keyword = kwdOrDef;\n if (typeof def == \"object\") {\n this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n def.keyword = keyword;\n }\n }\n else if (typeof kwdOrDef == \"object\" && def === undefined) {\n def = kwdOrDef;\n keyword = def.keyword;\n if (Array.isArray(keyword) && !keyword.length) {\n throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n }\n }\n else {\n throw new Error(\"invalid addKeywords parameters\");\n }\n checkKeyword.call(this, keyword, def);\n if (!def) {\n (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n return this;\n }\n keywordMetaschema.call(this, def);\n const definition = {\n ...def,\n type: (0, dataType_1.getJSONTypes)(def.type),\n schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),\n };\n (0, util_1.eachItem)(keyword, definition.type.length === 0\n ? (k) => addRule.call(this, k, definition)\n : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n return this;\n }\n getKeyword(keyword) {\n const rule = this.RULES.all[keyword];\n return typeof rule == \"object\" ? rule.definition : !!rule;\n }\n // Remove keyword\n removeKeyword(keyword) {\n // TODO return type should be Ajv\n const { RULES } = this;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n for (const group of RULES.rules) {\n const i = group.rules.findIndex((rule) => rule.keyword === keyword);\n if (i >= 0)\n group.rules.splice(i, 1);\n }\n return this;\n }\n // Add format\n addFormat(name, format) {\n if (typeof format == \"string\")\n format = new RegExp(format);\n this.formats[name] = format;\n return this;\n }\n errorsText(errors = this.errors, // optional array of validation errors\n { separator = \", \", dataVar = \"data\" } = {} // optional options with properties `separator` and `dataVar`\n ) {\n if (!errors || errors.length === 0)\n return \"No errors\";\n return errors\n .map((e) => `${dataVar}${e.instancePath} ${e.message}`)\n .reduce((text, msg) => text + separator + msg);\n }\n $dataMetaSchema(metaSchema, keywordsJsonPointers) {\n const rules = this.RULES.all;\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n for (const jsonPointer of keywordsJsonPointers) {\n const segments = jsonPointer.split(\"/\").slice(1); // first segment is an empty string\n let keywords = metaSchema;\n for (const seg of segments)\n keywords = keywords[seg];\n for (const key in rules) {\n const rule = rules[key];\n if (typeof rule != \"object\")\n continue;\n const { $data } = rule.definition;\n const schema = keywords[key];\n if ($data && schema)\n keywords[key] = schemaOrData(schema);\n }\n }\n return metaSchema;\n }\n _removeAllSchemas(schemas, regex) {\n for (const keyRef in schemas) {\n const sch = schemas[keyRef];\n if (!regex || regex.test(keyRef)) {\n if (typeof sch == \"string\") {\n delete schemas[keyRef];\n }\n else if (sch && !sch.meta) {\n this._cache.delete(sch.schema);\n delete schemas[keyRef];\n }\n }\n }\n }\n _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n let id;\n const { schemaId } = this.opts;\n if (typeof schema == \"object\") {\n id = schema[schemaId];\n }\n else {\n if (this.opts.jtd)\n throw new Error(\"schema must be object\");\n else if (typeof schema != \"boolean\")\n throw new Error(\"schema must be object or boolean\");\n }\n let sch = this._cache.get(schema);\n if (sch !== undefined)\n return sch;\n baseId = (0, resolve_1.normalizeId)(id || baseId);\n const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });\n this._cache.set(sch.schema, sch);\n if (addSchema && !baseId.startsWith(\"#\")) {\n // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)\n if (baseId)\n this._checkUnique(baseId);\n this.refs[baseId] = sch;\n }\n if (validateSchema)\n this.validateSchema(schema, true);\n return sch;\n }\n _checkUnique(id) {\n if (this.schemas[id] || this.refs[id]) {\n throw new Error(`schema with key or id \"${id}\" already exists`);\n }\n }\n _compileSchemaEnv(sch) {\n if (sch.meta)\n this._compileMetaSchema(sch);\n else\n compile_1.compileSchema.call(this, sch);\n /* istanbul ignore if */\n if (!sch.validate)\n throw new Error(\"ajv implementation error\");\n return sch.validate;\n }\n _compileMetaSchema(sch) {\n const currentOpts = this.opts;\n this.opts = this._metaOpts;\n try {\n compile_1.compileSchema.call(this, sch);\n }\n finally {\n this.opts = currentOpts;\n }\n }\n}\nAjv.ValidationError = validation_error_1.default;\nAjv.MissingRefError = ref_error_1.default;\nexports.default = Ajv;\nfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n for (const key in checkOpts) {\n const opt = key;\n if (opt in options)\n this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n }\n}\nfunction getSchEnv(keyRef) {\n keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line\n return this.schemas[keyRef] || this.refs[keyRef];\n}\nfunction addInitialSchemas() {\n const optsSchemas = this.opts.schemas;\n if (!optsSchemas)\n return;\n if (Array.isArray(optsSchemas))\n this.addSchema(optsSchemas);\n else\n for (const key in optsSchemas)\n this.addSchema(optsSchemas[key], key);\n}\nfunction addInitialFormats() {\n for (const name in this.opts.formats) {\n const format = this.opts.formats[name];\n if (format)\n this.addFormat(name, format);\n }\n}\nfunction addInitialKeywords(defs) {\n if (Array.isArray(defs)) {\n this.addVocabulary(defs);\n return;\n }\n this.logger.warn(\"keywords option as map is deprecated, pass array\");\n for (const keyword in defs) {\n const def = defs[keyword];\n if (!def.keyword)\n def.keyword = keyword;\n this.addKeyword(def);\n }\n}\nfunction getMetaSchemaOptions() {\n const metaOpts = { ...this.opts };\n for (const opt of META_IGNORE_OPTIONS)\n delete metaOpts[opt];\n return metaOpts;\n}\nconst noLogs = { log() { }, warn() { }, error() { } };\nfunction getLogger(logger) {\n if (logger === false)\n return noLogs;\n if (logger === undefined)\n return console;\n if (logger.log && logger.warn && logger.error)\n return logger;\n throw new Error(\"logger must implement log, warn and error methods\");\n}\nconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\nfunction checkKeyword(keyword, def) {\n const { RULES } = this;\n (0, util_1.eachItem)(keyword, (kwd) => {\n if (RULES.keywords[kwd])\n throw new Error(`Keyword ${kwd} is already defined`);\n if (!KEYWORD_NAME.test(kwd))\n throw new Error(`Keyword ${kwd} has invalid name`);\n });\n if (!def)\n return;\n if (def.$data && !(\"code\" in def || \"validate\" in def)) {\n throw new Error('$data keyword must have \"code\" or \"validate\" function');\n }\n}\nfunction addRule(keyword, definition, dataType) {\n var _a;\n const post = definition === null || definition === void 0 ? void 0 : definition.post;\n if (dataType && post)\n throw new Error('keyword with \"post\" flag cannot have \"type\"');\n const { RULES } = this;\n let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.rules.push(ruleGroup);\n }\n RULES.keywords[keyword] = true;\n if (!definition)\n return;\n const rule = {\n keyword,\n definition: {\n ...definition,\n type: (0, dataType_1.getJSONTypes)(definition.type),\n schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),\n },\n };\n if (definition.before)\n addBeforeRule.call(this, ruleGroup, rule, definition.before);\n else\n ruleGroup.rules.push(rule);\n RULES.all[keyword] = rule;\n (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));\n}\nfunction addBeforeRule(ruleGroup, rule, before) {\n const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n if (i >= 0) {\n ruleGroup.rules.splice(i, 0, rule);\n }\n else {\n ruleGroup.rules.push(rule);\n this.logger.warn(`rule ${before} is not defined`);\n }\n}\nfunction keywordMetaschema(def) {\n let { metaSchema } = def;\n if (metaSchema === undefined)\n return;\n if (def.$data && this.opts.$data)\n metaSchema = schemaOrData(metaSchema);\n def.validateSchema = this.compile(metaSchema, true);\n}\nconst $dataRef = {\n $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n};\nfunction schemaOrData(schema) {\n return { anyOf: [schema, $dataRef] };\n}\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst def = {\n keyword: \"id\",\n code() {\n throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID');\n },\n};\nexports.default = def;\n//# sourceMappingURL=id.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callRef = exports.getValidate = void 0;\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst compile_1 = require(\"../../compile\");\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"$ref\",\n schemaType: \"string\",\n code(cxt) {\n const { gen, schema: $ref, it } = cxt;\n const { baseId, schemaEnv: env, validateName, opts, self } = it;\n const { root } = env;\n if (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId)\n return callRootRef();\n const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n if (schOrEnv === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n if (schOrEnv instanceof compile_1.SchemaEnv)\n return callValidate(schOrEnv);\n return inlineRefSchema(schOrEnv);\n function callRootRef() {\n if (env === root)\n return callRef(cxt, validateName, env, env.$async);\n const rootName = gen.scopeValue(\"root\", { ref: root });\n return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);\n }\n function callValidate(sch) {\n const v = getValidate(cxt, sch);\n callRef(cxt, v, sch, sch.$async);\n }\n function inlineRefSchema(sch) {\n const schName = gen.scopeValue(\"schema\", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });\n const valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({\n schema: sch,\n dataTypes: [],\n schemaPath: codegen_1.nil,\n topSchemaRef: schName,\n errSchemaPath: $ref,\n }, valid);\n cxt.mergeEvaluated(schCxt);\n cxt.ok(valid);\n }\n },\n};\nfunction getValidate(cxt, sch) {\n const { gen } = cxt;\n return sch.validate\n ? gen.scopeValue(\"validate\", { ref: sch.validate })\n : (0, codegen_1._) `${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n}\nexports.getValidate = getValidate;\nfunction callRef(cxt, v, sch, $async) {\n const { gen, it } = cxt;\n const { allErrors, schemaEnv: env, opts } = it;\n const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n if ($async)\n callAsyncRef();\n else\n callSyncRef();\n function callAsyncRef() {\n if (!env.$async)\n throw new Error(\"async schema referenced by sync schema\");\n const valid = gen.let(\"valid\");\n gen.try(() => {\n gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result\n if (!allErrors)\n gen.assign(valid, true);\n }, (e) => {\n gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n addErrorsFrom(e);\n if (!allErrors)\n gen.assign(valid, false);\n });\n cxt.ok(valid);\n }\n function callSyncRef() {\n cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n }\n function addErrorsFrom(source) {\n const errs = (0, codegen_1._) `${source}.errors`;\n gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged\n gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n }\n function addEvaluatedFrom(source) {\n var _a;\n if (!it.opts.unevaluated)\n return;\n const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n // TODO refactor\n if (it.props !== true) {\n if (schEvaluated && !schEvaluated.dynamicProps) {\n if (schEvaluated.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n }\n }\n else {\n const props = gen.var(\"props\", (0, codegen_1._) `${source}.evaluated.props`);\n it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n }\n }\n if (it.items !== true) {\n if (schEvaluated && !schEvaluated.dynamicItems) {\n if (schEvaluated.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n }\n }\n else {\n const items = gen.var(\"items\", (0, codegen_1._) `${source}.evaluated.items`);\n it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n }\n }\n }\n}\nexports.callRef = callRef;\nexports.default = def;\n//# sourceMappingURL=ref.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst id_1 = require(\"./id\");\nconst ref_1 = require(\"./ref\");\nconst core = [\n \"$schema\",\n \"$id\",\n \"$defs\",\n \"$vocabulary\",\n { keyword: \"$comment\" },\n \"definitions\",\n id_1.default,\n ref_1.default,\n];\nexports.default = core;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst ops = codegen_1.operators;\nconst KWDs = {\n maximum: { okStr: \"<=\", ok: ops.LTE, fail: ops.GT },\n minimum: { okStr: \">=\", ok: ops.GTE, fail: ops.LT },\n exclusiveMaximum: { okStr: \"<\", ok: ops.LT, fail: ops.GTE },\n exclusiveMinimum: { okStr: \">\", ok: ops.GT, fail: ops.LTE },\n};\nconst error = {\n message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,\n params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: Object.keys(KWDs),\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitNumber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,\n params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"multipleOf\",\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, schemaCode, it } = cxt;\n // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)\n const prec = it.opts.multipleOfPrecision;\n const res = gen.let(\"res\");\n const invalid = prec\n ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`\n : (0, codegen_1._) `${res} !== parseInt(${res})`;\n cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=multipleOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nfunction ucs2length(str) {\n const len = str.length;\n let length = 0;\n let pos = 0;\n let value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xfc00) === 0xdc00)\n pos++; // low surrogate\n }\n }\n return length;\n}\nexports.default = ucs2length;\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default';\n//# sourceMappingURL=ucs2length.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst ucs2length_1 = require(\"../../runtime/ucs2length\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxLength\", \"minLength\"],\n type: \"string\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode, it } = cxt;\n const op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitLength.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"pattern\",\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const u = it.opts.unicodeRegExp ? \"u\" : \"\";\n if ($data) {\n const { regExp } = it.opts.code;\n const regExpCode = regExp.code === \"new RegExp\" ? (0, codegen_1._) `new RegExp` : (0, util_1.useFunc)(gen, regExp);\n const valid = gen.let(\"valid\");\n gen.try(() => gen.assign(valid, (0, codegen_1._) `${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));\n cxt.fail$data((0, codegen_1._) `!${valid}`);\n }\n else {\n const regExp = (0, code_1.usePattern)(cxt, schema);\n cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxProperties\", \"minProperties\"],\n type: \"object\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,\n params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,\n};\nconst def = {\n keyword: \"required\",\n type: \"object\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, schema, schemaCode, data, $data, it } = cxt;\n const { opts } = it;\n if (!$data && schema.length === 0)\n return;\n const useLoop = schema.length >= opts.loopRequired;\n if (it.allErrors)\n allErrorsMode();\n else\n exitOnErrorMode();\n if (opts.strictRequired) {\n const props = cxt.parentSchema.properties;\n const { definedProperties } = cxt.it;\n for (const requiredKey of schema) {\n if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n const msg = `required property \"${requiredKey}\" is not defined at \"${schemaPath}\" (strictRequired)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n }\n }\n }\n function allErrorsMode() {\n if (useLoop || $data) {\n cxt.block$data(codegen_1.nil, loopAllRequired);\n }\n else {\n for (const prop of schema) {\n (0, code_1.checkReportMissingProp)(cxt, prop);\n }\n }\n }\n function exitOnErrorMode() {\n const missing = gen.let(\"missing\");\n if (useLoop || $data) {\n const valid = gen.let(\"valid\", true);\n cxt.block$data(valid, () => loopUntilMissing(missing, valid));\n cxt.ok(valid);\n }\n else {\n gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n function loopAllRequired() {\n gen.forOf(\"prop\", schemaCode, (prop) => {\n cxt.setParams({ missingProperty: prop });\n gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n });\n }\n function loopUntilMissing(missing, valid) {\n cxt.setParams({ missingProperty: missing });\n gen.forOf(missing, schemaCode, () => {\n gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error();\n gen.break();\n });\n }, codegen_1.nil);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=required.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxItems\", \"minItems\"],\n type: \"array\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://github.com/ajv-validator/ajv/issues/889\nconst equal = require(\"fast-deep-equal\");\nequal.code = 'require(\"ajv/dist/runtime/equal\").default';\nexports.default = equal;\n//# sourceMappingURL=equal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dataType_1 = require(\"../../compile/validate/dataType\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,\n};\nconst def = {\n keyword: \"uniqueItems\",\n type: \"array\",\n schemaType: \"boolean\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n if (!$data && !schema)\n return;\n const valid = gen.let(\"valid\");\n const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);\n cxt.ok(valid);\n function validateUniqueItems() {\n const i = gen.let(\"i\", (0, codegen_1._) `${data}.length`);\n const j = gen.let(\"j\");\n cxt.setParams({ i, j });\n gen.assign(valid, true);\n gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n }\n function canOptimize() {\n return itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n }\n function loopN(i, j) {\n const item = gen.name(\"item\");\n const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n const indices = gen.const(\"indices\", (0, codegen_1._) `{}`);\n gen.for((0, codegen_1._) `;${i}--;`, () => {\n gen.let(item, (0, codegen_1._) `${data}[${i}]`);\n gen.if(wrongType, (0, codegen_1._) `continue`);\n if (itemTypes.length > 1)\n gen.if((0, codegen_1._) `typeof ${item} == \"string\"`, (0, codegen_1._) `${item} += \"_\"`);\n gen\n .if((0, codegen_1._) `typeof ${indices}[${item}] == \"number\"`, () => {\n gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);\n cxt.error();\n gen.assign(valid, false).break();\n })\n .code((0, codegen_1._) `${indices}[${item}] = ${i}`);\n });\n }\n function loopN2(i, j) {\n const eql = (0, util_1.useFunc)(gen, equal_1.default);\n const outer = gen.name(\"outer\");\n gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {\n cxt.error();\n gen.assign(valid, false).break(outer);\n })));\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=uniqueItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to constant\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"const\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schemaCode, schema } = cxt;\n if ($data || (schema && typeof schema == \"object\")) {\n cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n }\n else {\n cxt.fail((0, codegen_1._) `${schema} !== ${data}`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=const.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to one of the allowed values\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"enum\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n if (!$data && schema.length === 0)\n throw new Error(\"enum must have non-empty array\");\n const useLoop = schema.length >= it.opts.loopEnum;\n let eql;\n const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));\n let valid;\n if (useLoop || $data) {\n valid = gen.let(\"valid\");\n cxt.block$data(valid, loopEnum);\n }\n else {\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const vSchema = gen.const(\"vSchema\", schemaCode);\n valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n }\n cxt.pass(valid);\n function loopEnum() {\n gen.assign(valid, false);\n gen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n }\n function equalCode(vSchema, i) {\n const sch = schema[i];\n return typeof sch === \"object\" && sch !== null\n ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`\n : (0, codegen_1._) `${data} === ${sch}`;\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=enum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst limitNumber_1 = require(\"./limitNumber\");\nconst multipleOf_1 = require(\"./multipleOf\");\nconst limitLength_1 = require(\"./limitLength\");\nconst pattern_1 = require(\"./pattern\");\nconst limitProperties_1 = require(\"./limitProperties\");\nconst required_1 = require(\"./required\");\nconst limitItems_1 = require(\"./limitItems\");\nconst uniqueItems_1 = require(\"./uniqueItems\");\nconst const_1 = require(\"./const\");\nconst enum_1 = require(\"./enum\");\nconst validation = [\n // number\n limitNumber_1.default,\n multipleOf_1.default,\n // string\n limitLength_1.default,\n pattern_1.default,\n // object\n limitProperties_1.default,\n required_1.default,\n // array\n limitItems_1.default,\n uniqueItems_1.default,\n // any\n { keyword: \"type\", schemaType: [\"string\", \"array\"] },\n { keyword: \"nullable\", schemaType: \"boolean\" },\n const_1.default,\n enum_1.default,\n];\nexports.default = validation;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateAdditionalItems = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"additionalItems\",\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { parentSchema, it } = cxt;\n const { items } = parentSchema;\n if (!Array.isArray(items)) {\n (0, util_1.checkStrictMode)(it, '\"additionalItems\" is ignored when \"items\" is not an array of schemas');\n return;\n }\n validateAdditionalItems(cxt, items);\n },\n};\nfunction validateAdditionalItems(cxt, items) {\n const { gen, schema, data, keyword, it } = cxt;\n it.items = true;\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n if (schema === false) {\n cxt.setParams({ len: items.length });\n cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);\n }\n else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.var(\"valid\", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var\n gen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n cxt.ok(valid);\n }\n function validateItems(valid) {\n gen.forRange(\"i\", items.length, len, (i) => {\n cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);\n if (!it.allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n });\n }\n}\nexports.validateAdditionalItems = validateAdditionalItems;\nexports.default = def;\n//# sourceMappingURL=additionalItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateTuple = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"array\", \"boolean\"],\n before: \"uniqueItems\",\n code(cxt) {\n const { schema, it } = cxt;\n if (Array.isArray(schema))\n return validateTuple(cxt, \"additionalItems\", schema);\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n const { gen, parentSchema, data, keyword, it } = cxt;\n checkStrictTuple(parentSchema);\n if (it.opts.unevaluated && schArr.length && it.items !== true) {\n it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n }\n const valid = gen.name(\"valid\");\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n schArr.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({\n keyword,\n schemaProp: i,\n dataProp: i,\n }, valid));\n cxt.ok(valid);\n });\n function checkStrictTuple(sch) {\n const { opts, errSchemaPath } = it;\n const l = schArr.length;\n const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n if (opts.strictTuples && !fullTuple) {\n const msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n }\n }\n}\nexports.validateTuple = validateTuple;\nexports.default = def;\n//# sourceMappingURL=items.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst items_1 = require(\"./items\");\nconst def = {\n keyword: \"prefixItems\",\n type: \"array\",\n schemaType: [\"array\"],\n before: \"uniqueItems\",\n code: (cxt) => (0, items_1.validateTuple)(cxt, \"items\"),\n};\nexports.default = def;\n//# sourceMappingURL=prefixItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst additionalItems_1 = require(\"./additionalItems\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { schema, parentSchema, it } = cxt;\n const { prefixItems } = parentSchema;\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n if (prefixItems)\n (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n else\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nexports.default = def;\n//# sourceMappingURL=items2020.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { min, max } }) => max === undefined\n ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`\n : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,\n params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,\n};\nconst def = {\n keyword: \"contains\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n let min;\n let max;\n const { minContains, maxContains } = parentSchema;\n if (it.opts.next) {\n min = minContains === undefined ? 1 : minContains;\n max = maxContains;\n }\n else {\n min = 1;\n }\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n cxt.setParams({ min, max });\n if (max === undefined && min === 0) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n return;\n }\n if (max !== undefined && min > max) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n cxt.fail();\n return;\n }\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n let cond = (0, codegen_1._) `${len} >= ${min}`;\n if (max !== undefined)\n cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;\n cxt.pass(cond);\n return;\n }\n it.items = true;\n const valid = gen.name(\"valid\");\n if (max === undefined && min === 1) {\n validateItems(valid, () => gen.if(valid, () => gen.break()));\n }\n else if (min === 0) {\n gen.let(valid, true);\n if (max !== undefined)\n gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);\n }\n else {\n gen.let(valid, false);\n validateItemsWithCount();\n }\n cxt.result(valid, () => cxt.reset());\n function validateItemsWithCount() {\n const schValid = gen.name(\"_valid\");\n const count = gen.let(\"count\", 0);\n validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n }\n function validateItems(_valid, block) {\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword: \"contains\",\n dataProp: i,\n dataPropType: util_1.Type.Num,\n compositeRule: true,\n }, _valid);\n block();\n });\n }\n function checkLimits(count) {\n gen.code((0, codegen_1._) `${count}++`);\n if (max === undefined) {\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());\n }\n else {\n gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());\n if (min === 1)\n gen.assign(valid, true);\n else\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=contains.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nexports.error = {\n message: ({ params: { property, depsCount, deps } }) => {\n const property_ies = depsCount === 1 ? \"property\" : \"properties\";\n return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;\n },\n params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`, // TODO change to reference\n};\nconst def = {\n keyword: \"dependencies\",\n type: \"object\",\n schemaType: \"object\",\n error: exports.error,\n code(cxt) {\n const [propDeps, schDeps] = splitDependencies(cxt);\n validatePropertyDeps(cxt, propDeps);\n validateSchemaDeps(cxt, schDeps);\n },\n};\nfunction splitDependencies({ schema }) {\n const propertyDeps = {};\n const schemaDeps = {};\n for (const key in schema) {\n if (key === \"__proto__\")\n continue;\n const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n deps[key] = schema[key];\n }\n return [propertyDeps, schemaDeps];\n}\nfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n const { gen, data, it } = cxt;\n if (Object.keys(propertyDeps).length === 0)\n return;\n const missing = gen.let(\"missing\");\n for (const prop in propertyDeps) {\n const deps = propertyDeps[prop];\n if (deps.length === 0)\n continue;\n const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n cxt.setParams({\n property: prop,\n depsCount: deps.length,\n deps: deps.join(\", \"),\n });\n if (it.allErrors) {\n gen.if(hasProperty, () => {\n for (const depProp of deps) {\n (0, code_1.checkReportMissingProp)(cxt, depProp);\n }\n });\n }\n else {\n gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n}\nexports.validatePropertyDeps = validatePropertyDeps;\nfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n for (const prop in schemaDeps) {\n if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))\n continue;\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);\n cxt.mergeValidEvaluated(schCxt, valid);\n }, () => gen.var(valid, true) // TODO var\n );\n cxt.ok(valid);\n }\n}\nexports.validateSchemaDeps = validateSchemaDeps;\nexports.default = def;\n//# sourceMappingURL=dependencies.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"property name must be valid\",\n params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,\n};\nconst def = {\n keyword: \"propertyNames\",\n type: \"object\",\n schemaType: [\"object\", \"boolean\"],\n error,\n code(cxt) {\n const { gen, schema, data, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n const valid = gen.name(\"valid\");\n gen.forIn(\"key\", data, (key) => {\n cxt.setParams({ propertyName: key });\n cxt.subschema({\n keyword: \"propertyNames\",\n data: key,\n dataTypes: [\"string\"],\n propertyName: key,\n compositeRule: true,\n }, valid);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error(true);\n if (!it.allErrors)\n gen.break();\n });\n });\n cxt.ok(valid);\n },\n};\nexports.default = def;\n//# sourceMappingURL=propertyNames.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must NOT have additional properties\",\n params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,\n};\nconst def = {\n keyword: \"additionalProperties\",\n type: [\"object\"],\n schemaType: [\"boolean\", \"object\"],\n allowUndefined: true,\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, errsCount, it } = cxt;\n /* istanbul ignore if */\n if (!errsCount)\n throw new Error(\"ajv implementation error\");\n const { allErrors, opts } = it;\n it.props = true;\n if (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema))\n return;\n const props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n checkAdditionalProperties();\n cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n function checkAdditionalProperties() {\n gen.forIn(\"key\", data, (key) => {\n if (!props.length && !patProps.length)\n additionalPropertyCode(key);\n else\n gen.if(isAdditional(key), () => additionalPropertyCode(key));\n });\n }\n function isAdditional(key) {\n let definedProp;\n if (props.length > 8) {\n // TODO maybe an option instead of hard-coded 8?\n const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n }\n else if (props.length) {\n definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));\n }\n else {\n definedProp = codegen_1.nil;\n }\n if (patProps.length) {\n definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n }\n return (0, codegen_1.not)(definedProp);\n }\n function deleteAdditional(key) {\n gen.code((0, codegen_1._) `delete ${data}[${key}]`);\n }\n function additionalPropertyCode(key) {\n if (opts.removeAdditional === \"all\" || (opts.removeAdditional && schema === false)) {\n deleteAdditional(key);\n return;\n }\n if (schema === false) {\n cxt.setParams({ additionalProperty: key });\n cxt.error();\n if (!allErrors)\n gen.break();\n return;\n }\n if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.name(\"valid\");\n if (opts.removeAdditional === \"failing\") {\n applyAdditionalSchema(key, valid, false);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.reset();\n deleteAdditional(key);\n });\n }\n else {\n applyAdditionalSchema(key, valid);\n if (!allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n }\n }\n function applyAdditionalSchema(key, valid, errors) {\n const subschema = {\n keyword: \"additionalProperties\",\n dataProp: key,\n dataPropType: util_1.Type.Str,\n };\n if (errors === false) {\n Object.assign(subschema, {\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n });\n }\n cxt.subschema(subschema, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=additionalProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_1 = require(\"../../compile/validate\");\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst def = {\n keyword: \"properties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n if (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === undefined) {\n additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n }\n const allProps = (0, code_1.allSchemaProperties)(schema);\n for (const prop of allProps) {\n it.definedProperties.add(prop);\n }\n if (it.opts.unevaluated && allProps.length && it.props !== true) {\n it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n }\n const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n if (properties.length === 0)\n return;\n const valid = gen.name(\"valid\");\n for (const prop of properties) {\n if (hasDefault(prop)) {\n applyPropertySchema(prop);\n }\n else {\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n applyPropertySchema(prop);\n if (!it.allErrors)\n gen.else().var(valid, true);\n gen.endIf();\n }\n cxt.it.definedProperties.add(prop);\n cxt.ok(valid);\n }\n function hasDefault(prop) {\n return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;\n }\n function applyPropertySchema(prop) {\n cxt.subschema({\n keyword: \"properties\",\n schemaProp: prop,\n dataProp: prop,\n }, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=properties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst util_2 = require(\"../../compile/util\");\nconst def = {\n keyword: \"patternProperties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, data, parentSchema, it } = cxt;\n const { opts } = it;\n const patterns = (0, code_1.allSchemaProperties)(schema);\n const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n if (patterns.length === 0 ||\n (alwaysValidPatterns.length === patterns.length &&\n (!it.opts.unevaluated || it.props === true))) {\n return;\n }\n const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n const valid = gen.name(\"valid\");\n if (it.props !== true && !(it.props instanceof codegen_1.Name)) {\n it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n }\n const { props } = it;\n validatePatternProperties();\n function validatePatternProperties() {\n for (const pat of patterns) {\n if (checkProperties)\n checkMatchingProperties(pat);\n if (it.allErrors) {\n validateProperties(pat);\n }\n else {\n gen.var(valid, true); // TODO var\n validateProperties(pat);\n gen.if(valid);\n }\n }\n }\n function checkMatchingProperties(pat) {\n for (const prop in checkProperties) {\n if (new RegExp(pat).test(prop)) {\n (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n }\n }\n }\n function validateProperties(pat) {\n gen.forIn(\"key\", data, (key) => {\n gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n const alwaysValid = alwaysValidPatterns.includes(pat);\n if (!alwaysValid) {\n cxt.subschema({\n keyword: \"patternProperties\",\n schemaProp: pat,\n dataProp: key,\n dataPropType: util_2.Type.Str,\n }, valid);\n }\n if (it.opts.unevaluated && props !== true) {\n gen.assign((0, codegen_1._) `${props}[${key}]`, true);\n }\n else if (!alwaysValid && !it.allErrors) {\n // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)\n // or if all properties were evaluated (props === true)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=patternProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"not\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n code(cxt) {\n const { gen, schema, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n cxt.fail();\n return;\n }\n const valid = gen.name(\"valid\");\n cxt.subschema({\n keyword: \"not\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, valid);\n cxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n },\n error: { message: \"must NOT be valid\" },\n};\nexports.default = def;\n//# sourceMappingURL=not.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"anyOf\",\n schemaType: \"array\",\n trackErrors: true,\n code: code_1.validateUnion,\n error: { message: \"must match a schema in anyOf\" },\n};\nexports.default = def;\n//# sourceMappingURL=anyOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must match exactly one schema in oneOf\",\n params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,\n};\nconst def = {\n keyword: \"oneOf\",\n schemaType: \"array\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n if (it.opts.discriminator && parentSchema.discriminator)\n return;\n const schArr = schema;\n const valid = gen.let(\"valid\", false);\n const passing = gen.let(\"passing\", null);\n const schValid = gen.name(\"_valid\");\n cxt.setParams({ passing });\n // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas\n gen.block(validateOneOf);\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n function validateOneOf() {\n schArr.forEach((sch, i) => {\n let schCxt;\n if ((0, util_1.alwaysValidSchema)(it, sch)) {\n gen.var(schValid, true);\n }\n else {\n schCxt = cxt.subschema({\n keyword: \"oneOf\",\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n }\n if (i > 0) {\n gen\n .if((0, codegen_1._) `${schValid} && ${valid}`)\n .assign(valid, false)\n .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)\n .else();\n }\n gen.if(schValid, () => {\n gen.assign(valid, true);\n gen.assign(passing, i);\n if (schCxt)\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=oneOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"allOf\",\n schemaType: \"array\",\n code(cxt) {\n const { gen, schema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const valid = gen.name(\"valid\");\n schema.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n const schCxt = cxt.subschema({ keyword: \"allOf\", schemaProp: i }, valid);\n cxt.ok(valid);\n cxt.mergeEvaluated(schCxt);\n });\n },\n};\nexports.default = def;\n//# sourceMappingURL=allOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params }) => (0, codegen_1.str) `must match \"${params.ifClause}\" schema`,\n params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,\n};\nconst def = {\n keyword: \"if\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, parentSchema, it } = cxt;\n if (parentSchema.then === undefined && parentSchema.else === undefined) {\n (0, util_1.checkStrictMode)(it, '\"if\" without \"then\" and \"else\" is ignored');\n }\n const hasThen = hasSchema(it, \"then\");\n const hasElse = hasSchema(it, \"else\");\n if (!hasThen && !hasElse)\n return;\n const valid = gen.let(\"valid\", true);\n const schValid = gen.name(\"_valid\");\n validateIf();\n cxt.reset();\n if (hasThen && hasElse) {\n const ifClause = gen.let(\"ifClause\");\n cxt.setParams({ ifClause });\n gen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n }\n else if (hasThen) {\n gen.if(schValid, validateClause(\"then\"));\n }\n else {\n gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n }\n cxt.pass(valid, () => cxt.error(true));\n function validateIf() {\n const schCxt = cxt.subschema({\n keyword: \"if\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, schValid);\n cxt.mergeEvaluated(schCxt);\n }\n function validateClause(keyword, ifClause) {\n return () => {\n const schCxt = cxt.subschema({ keyword }, schValid);\n gen.assign(valid, schValid);\n cxt.mergeValidEvaluated(schCxt, valid);\n if (ifClause)\n gen.assign(ifClause, (0, codegen_1._) `${keyword}`);\n else\n cxt.setParams({ ifClause: keyword });\n };\n }\n },\n};\nfunction hasSchema(it, keyword) {\n const schema = it.schema[keyword];\n return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);\n}\nexports.default = def;\n//# sourceMappingURL=if.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: [\"then\", \"else\"],\n schemaType: [\"object\", \"boolean\"],\n code({ keyword, parentSchema, it }) {\n if (parentSchema.if === undefined)\n (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=thenElse.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst additionalItems_1 = require(\"./additionalItems\");\nconst prefixItems_1 = require(\"./prefixItems\");\nconst items_1 = require(\"./items\");\nconst items2020_1 = require(\"./items2020\");\nconst contains_1 = require(\"./contains\");\nconst dependencies_1 = require(\"./dependencies\");\nconst propertyNames_1 = require(\"./propertyNames\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst properties_1 = require(\"./properties\");\nconst patternProperties_1 = require(\"./patternProperties\");\nconst not_1 = require(\"./not\");\nconst anyOf_1 = require(\"./anyOf\");\nconst oneOf_1 = require(\"./oneOf\");\nconst allOf_1 = require(\"./allOf\");\nconst if_1 = require(\"./if\");\nconst thenElse_1 = require(\"./thenElse\");\nfunction getApplicator(draft2020 = false) {\n const applicator = [\n // any\n not_1.default,\n anyOf_1.default,\n oneOf_1.default,\n allOf_1.default,\n if_1.default,\n thenElse_1.default,\n // object\n propertyNames_1.default,\n additionalProperties_1.default,\n dependencies_1.default,\n properties_1.default,\n patternProperties_1.default,\n ];\n // array\n if (draft2020)\n applicator.push(prefixItems_1.default, items2020_1.default);\n else\n applicator.push(additionalItems_1.default, items_1.default);\n applicator.push(contains_1.default);\n return applicator;\n}\nexports.default = getApplicator;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match format \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"format\",\n type: [\"number\", \"string\"],\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt, ruleType) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const { opts, errSchemaPath, schemaEnv, self } = it;\n if (!opts.validateFormats)\n return;\n if ($data)\n validate$DataFormat();\n else\n validateFormat();\n function validate$DataFormat() {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n });\n const fDef = gen.const(\"fDef\", (0, codegen_1._) `${fmts}[${schemaCode}]`);\n const fType = gen.let(\"fType\");\n const format = gen.let(\"format\");\n // TODO simplify\n gen.if((0, codegen_1._) `typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || \"string\"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `\"string\"`).assign(format, fDef));\n cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n function unknownFmt() {\n if (opts.strictSchema === false)\n return codegen_1.nil;\n return (0, codegen_1._) `${schemaCode} && !${format}`;\n }\n function invalidFmt() {\n const callFormat = schemaEnv.$async\n ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`\n : (0, codegen_1._) `${format}(${data})`;\n const validData = (0, codegen_1._) `(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n }\n }\n function validateFormat() {\n const formatDef = self.formats[schema];\n if (!formatDef) {\n unknownFormat();\n return;\n }\n if (formatDef === true)\n return;\n const [fmtType, format, fmtRef] = getFormat(formatDef);\n if (fmtType === ruleType)\n cxt.pass(validCondition());\n function unknownFormat() {\n if (opts.strictSchema === false) {\n self.logger.warn(unknownMsg());\n return;\n }\n throw new Error(unknownMsg());\n function unknownMsg() {\n return `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n }\n }\n function getFormat(fmtDef) {\n const code = fmtDef instanceof RegExp\n ? (0, codegen_1.regexpCode)(fmtDef)\n : opts.code.formats\n ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`\n : undefined;\n const fmt = gen.scopeValue(\"formats\", { key: schema, ref: fmtDef, code });\n if (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) {\n return [fmtDef.type || \"string\", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];\n }\n return [\"string\", fmtDef, fmt];\n }\n function validCondition() {\n if (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n if (!schemaEnv.$async)\n throw new Error(\"async format in sync schema\");\n return (0, codegen_1._) `await ${fmtRef}(${data})`;\n }\n return typeof format == \"function\" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=format.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst format_1 = require(\"./format\");\nconst format = [format_1.default];\nexports.default = format;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.contentVocabulary = exports.metadataVocabulary = void 0;\nexports.metadataVocabulary = [\n \"title\",\n \"description\",\n \"default\",\n \"deprecated\",\n \"readOnly\",\n \"writeOnly\",\n \"examples\",\n];\nexports.contentVocabulary = [\n \"contentMediaType\",\n \"contentEncoding\",\n \"contentSchema\",\n];\n//# sourceMappingURL=metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"./core\");\nconst validation_1 = require(\"./validation\");\nconst applicator_1 = require(\"./applicator\");\nconst format_1 = require(\"./format\");\nconst metadata_1 = require(\"./metadata\");\nconst draft7Vocabularies = [\n core_1.default,\n validation_1.default,\n (0, applicator_1.default)(),\n format_1.default,\n metadata_1.metadataVocabulary,\n metadata_1.contentVocabulary,\n];\nexports.default = draft7Vocabularies;\n//# sourceMappingURL=draft7.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscrError = void 0;\nvar DiscrError;\n(function (DiscrError) {\n DiscrError[\"Tag\"] = \"tag\";\n DiscrError[\"Mapping\"] = \"mapping\";\n})(DiscrError || (exports.DiscrError = DiscrError = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst types_1 = require(\"../discriminator/types\");\nconst compile_1 = require(\"../../compile\");\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag\n ? `tag \"${tagName}\" must be string`\n : `value of tag \"${tagName}\" must be in oneOf`,\n params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,\n};\nconst def = {\n keyword: \"discriminator\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt) {\n const { gen, data, schema, parentSchema, it } = cxt;\n const { oneOf } = parentSchema;\n if (!it.opts.discriminator) {\n throw new Error(\"discriminator: requires discriminator option\");\n }\n const tagName = schema.propertyName;\n if (typeof tagName != \"string\")\n throw new Error(\"discriminator: requires propertyName\");\n if (schema.mapping)\n throw new Error(\"discriminator: mapping is not supported\");\n if (!oneOf)\n throw new Error(\"discriminator: requires oneOf keyword\");\n const valid = gen.let(\"valid\", false);\n const tag = gen.const(\"tag\", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);\n gen.if((0, codegen_1._) `typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));\n cxt.ok(valid);\n function validateMapping() {\n const mapping = getMapping();\n gen.if(false);\n for (const tagValue in mapping) {\n gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);\n gen.assign(valid, applyTagSchema(mapping[tagValue]));\n }\n gen.else();\n cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });\n gen.endIf();\n }\n function applyTagSchema(schemaProp) {\n const _valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({ keyword: \"oneOf\", schemaProp }, _valid);\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n return _valid;\n }\n function getMapping() {\n var _a;\n const oneOfMapping = {};\n const topRequired = hasRequired(parentSchema);\n let tagRequired = true;\n for (let i = 0; i < oneOf.length; i++) {\n let sch = oneOf[i];\n if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n const ref = sch.$ref;\n sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n if (sch instanceof compile_1.SchemaEnv)\n sch = sch.schema;\n if (sch === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n }\n const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n if (typeof propSch != \"object\") {\n throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n }\n tagRequired = tagRequired && (topRequired || hasRequired(sch));\n addMappings(propSch, i);\n }\n if (!tagRequired)\n throw new Error(`discriminator: \"${tagName}\" must be required`);\n return oneOfMapping;\n function hasRequired({ required }) {\n return Array.isArray(required) && required.includes(tagName);\n }\n function addMappings(sch, i) {\n if (sch.const) {\n addMapping(sch.const, i);\n }\n else if (sch.enum) {\n for (const tagValue of sch.enum) {\n addMapping(tagValue, i);\n }\n }\n else {\n throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n }\n }\n function addMapping(tagValue, i) {\n if (typeof tagValue != \"string\" || tagValue in oneOfMapping) {\n throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n }\n oneOfMapping[tagValue] = i;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=index.js.map","","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;\nconst core_1 = require(\"./core\");\nconst draft7_1 = require(\"./vocabularies/draft7\");\nconst discriminator_1 = require(\"./vocabularies/discriminator\");\nconst draft7MetaSchema = require(\"./refs/json-schema-draft-07.json\");\nconst META_SUPPORT_DATA = [\"/properties\"];\nconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\";\nclass Ajv extends core_1.default {\n _addVocabularies() {\n super._addVocabularies();\n draft7_1.default.forEach((v) => this.addVocabulary(v));\n if (this.opts.discriminator)\n this.addKeyword(discriminator_1.default);\n }\n _addDefaultMetaSchema() {\n super._addDefaultMetaSchema();\n if (!this.opts.meta)\n return;\n const metaSchema = this.opts.$data\n ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)\n : draft7MetaSchema;\n this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);\n this.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n }\n defaultMeta() {\n return (this.opts.defaultMeta =\n super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));\n }\n}\nexports.Ajv = Ajv;\nmodule.exports = exports = Ajv;\nmodule.exports.Ajv = Ajv;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Ajv;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nvar validation_error_1 = require(\"./runtime/validation_error\");\nObject.defineProperty(exports, \"ValidationError\", { enumerable: true, get: function () { return validation_error_1.default; } });\nvar ref_error_1 = require(\"./compile/ref_error\");\nObject.defineProperty(exports, \"MissingRefError\", { enumerable: true, get: function () { return ref_error_1.default; } });\n//# sourceMappingURL=ajv.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ajv_1 = require(\"ajv\");\nconst codegen_1 = require(\"ajv/dist/compile/codegen\");\nconst code_1 = require(\"ajv/dist/compile/codegen/code\");\nconst validate_1 = require(\"ajv/dist/compile/validate\");\nconst errors_1 = require(\"ajv/dist/compile/errors\");\nconst names_1 = require(\"ajv/dist/compile/names\");\nconst keyword = \"errorMessage\";\nconst used = new ajv_1.Name(\"emUsed\");\nconst KEYWORD_PROPERTY_PARAMS = {\n required: \"missingProperty\",\n dependencies: \"property\",\n dependentRequired: \"property\",\n};\nconst INTERPOLATION = /\\$\\{[^}]+\\}/;\nconst INTERPOLATION_REPLACE = /\\$\\{([^}]+)\\}/g;\nconst EMPTY_STR = /^\"\"\\s*\\+\\s*|\\s*\\+\\s*\"\"$/g;\nfunction errorMessage(options) {\n return {\n keyword,\n schemaType: [\"string\", \"object\"],\n post: true,\n code(cxt) {\n const { gen, data, schema, schemaValue, it } = cxt;\n if (it.createErrors === false)\n return;\n const sch = schema;\n const instancePath = codegen_1.strConcat(names_1.default.instancePath, it.errorPath);\n gen.if(ajv_1._ `${names_1.default.errors} > 0`, () => {\n if (typeof sch == \"object\") {\n const [kwdPropErrors, kwdErrors] = keywordErrorsConfig(sch);\n if (kwdErrors)\n processKeywordErrors(kwdErrors);\n if (kwdPropErrors)\n processKeywordPropErrors(kwdPropErrors);\n processChildErrors(childErrorsConfig(sch));\n }\n const schMessage = typeof sch == \"string\" ? sch : sch._;\n if (schMessage)\n processAllErrors(schMessage);\n if (!options.keepErrors)\n removeUsedErrors();\n });\n function childErrorsConfig({ properties, items }) {\n const errors = {};\n if (properties) {\n errors.props = {};\n for (const p in properties)\n errors.props[p] = [];\n }\n if (items) {\n errors.items = {};\n for (let i = 0; i < items.length; i++)\n errors.items[i] = [];\n }\n return errors;\n }\n function keywordErrorsConfig(emSchema) {\n let propErrors;\n let errors;\n for (const k in emSchema) {\n if (k === \"properties\" || k === \"items\")\n continue;\n const kwdSch = emSchema[k];\n if (typeof kwdSch == \"object\") {\n propErrors || (propErrors = {});\n const errMap = (propErrors[k] = {});\n for (const p in kwdSch)\n errMap[p] = [];\n }\n else {\n errors || (errors = {});\n errors[k] = [];\n }\n }\n return [propErrors, errors];\n }\n function processKeywordErrors(kwdErrors) {\n const kwdErrs = gen.const(\"emErrors\", ajv_1.stringify(kwdErrors));\n const templates = gen.const(\"templates\", getTemplatesCode(kwdErrors, schema));\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => gen.code(ajv_1._ `${kwdErrs}[${err}.keyword].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n const { singleError } = options;\n if (singleError) {\n const message = gen.let(\"message\", ajv_1._ `\"\"`);\n const paramsErrors = gen.let(\"paramsErrors\", ajv_1._ `[]`);\n loopErrors((key) => {\n gen.if(message, () => gen.code(ajv_1._ `${message} += ${typeof singleError == \"string\" ? singleError : \";\"}`));\n gen.code(ajv_1._ `${message} += ${errMessage(key)}`);\n gen.assign(paramsErrors, ajv_1._ `${paramsErrors}.concat(${kwdErrs}[${key}])`);\n });\n errors_1.reportError(cxt, { message, params: ajv_1._ `{errors: ${paramsErrors}}` });\n }\n else {\n loopErrors((key) => errors_1.reportError(cxt, {\n message: errMessage(key),\n params: ajv_1._ `{errors: ${kwdErrs}[${key}]}`,\n }));\n }\n function loopErrors(body) {\n gen.forIn(\"key\", kwdErrs, (key) => gen.if(ajv_1._ `${kwdErrs}[${key}].length`, () => body(key)));\n }\n function errMessage(key) {\n return ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}[${key}]`;\n }\n }\n function processKeywordPropErrors(kwdPropErrors) {\n const kwdErrs = gen.const(\"emErrors\", ajv_1.stringify(kwdPropErrors));\n const templatesCode = [];\n for (const k in kwdPropErrors) {\n templatesCode.push([\n k,\n getTemplatesCode(kwdPropErrors[k], schema[k]),\n ]);\n }\n const templates = gen.const(\"templates\", gen.object(...templatesCode));\n const kwdPropParams = gen.scopeValue(\"obj\", {\n ref: KEYWORD_PROPERTY_PARAMS,\n code: ajv_1.stringify(KEYWORD_PROPERTY_PARAMS),\n });\n const propParam = gen.let(\"emPropParams\");\n const paramsErrors = gen.let(\"emParamsErrors\");\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => {\n gen.assign(propParam, ajv_1._ `${kwdPropParams}[${err}.keyword]`);\n gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${err}.keyword][${err}.params[${propParam}]]`);\n gen.if(paramsErrors, () => gen.code(ajv_1._ `${paramsErrors}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true));\n }));\n gen.forIn(\"key\", kwdErrs, (key) => gen.forIn(\"keyProp\", ajv_1._ `${kwdErrs}[${key}]`, (keyProp) => {\n gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${key}][${keyProp}]`);\n gen.if(ajv_1._ `${paramsErrors}.length`, () => {\n const tmpl = gen.const(\"tmpl\", ajv_1._ `${templates}[${key}] && ${templates}[${key}][${keyProp}]`);\n errors_1.reportError(cxt, {\n message: ajv_1._ `${tmpl} ? ${tmpl}() : ${schemaValue}[${key}][${keyProp}]`,\n params: ajv_1._ `{errors: ${paramsErrors}}`,\n });\n });\n }));\n }\n function processChildErrors(childErrors) {\n const { props, items } = childErrors;\n if (!props && !items)\n return;\n const isObj = ajv_1._ `typeof ${data} == \"object\"`;\n const isArr = ajv_1._ `Array.isArray(${data})`;\n const childErrs = gen.let(\"emErrors\");\n let childKwd;\n let childProp;\n const templates = gen.let(\"templates\");\n if (props && items) {\n childKwd = gen.let(\"emChildKwd\");\n gen.if(isObj);\n gen.if(isArr, () => {\n init(items, schema.items);\n gen.assign(childKwd, ajv_1.str `items`);\n }, () => {\n init(props, schema.properties);\n gen.assign(childKwd, ajv_1.str `properties`);\n });\n childProp = ajv_1._ `[${childKwd}]`;\n }\n else if (items) {\n gen.if(isArr);\n init(items, schema.items);\n childProp = ajv_1._ `.items`;\n }\n else if (props) {\n gen.if(codegen_1.and(isObj, codegen_1.not(isArr)));\n init(props, schema.properties);\n childProp = ajv_1._ `.properties`;\n }\n gen.forOf(\"err\", names_1.default.vErrors, (err) => ifMatchesChildError(err, childErrs, (child) => gen.code(ajv_1._ `${childErrs}[${child}].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n gen.forIn(\"key\", childErrs, (key) => gen.if(ajv_1._ `${childErrs}[${key}].length`, () => {\n errors_1.reportError(cxt, {\n message: ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}${childProp}[${key}]`,\n params: ajv_1._ `{errors: ${childErrs}[${key}]}`,\n });\n gen.assign(ajv_1._ `${names_1.default.vErrors}[${names_1.default.errors}-1].instancePath`, ajv_1._ `${instancePath} + \"/\" + ${key}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`);\n }));\n gen.endIf();\n function init(children, msgs) {\n gen.assign(childErrs, ajv_1.stringify(children));\n gen.assign(templates, getTemplatesCode(children, msgs));\n }\n }\n function processAllErrors(schMessage) {\n const errs = gen.const(\"emErrs\", ajv_1._ `[]`);\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchAnyError(err), () => gen.code(ajv_1._ `${errs}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n gen.if(ajv_1._ `${errs}.length`, () => errors_1.reportError(cxt, {\n message: templateExpr(schMessage),\n params: ajv_1._ `{errors: ${errs}}`,\n }));\n }\n function removeUsedErrors() {\n const errs = gen.const(\"emErrs\", ajv_1._ `[]`);\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(ajv_1._ `!${err}.${used}`, () => gen.code(ajv_1._ `${errs}.push(${err})`)));\n gen.assign(names_1.default.vErrors, errs).assign(names_1.default.errors, ajv_1._ `${errs}.length`);\n }\n function matchKeywordError(err, kwdErrs) {\n return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath === ${instancePath}`, ajv_1._ `${err}.keyword in ${kwdErrs}`, \n // TODO match the end of the string?\n ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `/^\\\\/[^\\\\/]*$/.test(${err}.schemaPath.slice(${it.errSchemaPath.length}))`);\n }\n function ifMatchesChildError(err, childErrs, thenBody) {\n gen.if(codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`), () => {\n const childRegex = gen.scopeValue(\"pattern\", {\n ref: /^\\/([^/]*)(?:\\/|$)/,\n code: ajv_1._ `new RegExp(\"^\\\\\\/([^/]*)(?:\\\\\\/|$)\")`,\n });\n const matches = gen.const(\"emMatches\", ajv_1._ `${childRegex}.exec(${err}.instancePath.slice(${instancePath}.length))`);\n const child = gen.const(\"emChild\", ajv_1._ `${matches} && ${matches}[1].replace(/~1/g, \"/\").replace(/~0/g, \"~\")`);\n gen.if(ajv_1._ `${child} !== undefined && ${child} in ${childErrs}`, () => thenBody(child));\n });\n }\n function matchAnyError(err) {\n return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, codegen_1.or(ajv_1._ `${err}.instancePath === ${instancePath}`, codegen_1.and(ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`, ajv_1._ `${err}.instancePath[${instancePath}.length] === \"/\"`)), ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `${err}.schemaPath[${it.errSchemaPath}.length] === \"/\"`);\n }\n function getTemplatesCode(keys, msgs) {\n const templatesCode = [];\n for (const k in keys) {\n const msg = msgs[k];\n if (INTERPOLATION.test(msg))\n templatesCode.push([k, templateFunc(msg)]);\n }\n return gen.object(...templatesCode);\n }\n function templateExpr(msg) {\n if (!INTERPOLATION.test(msg))\n return ajv_1.stringify(msg);\n return new code_1._Code(code_1.safeStringify(msg)\n .replace(INTERPOLATION_REPLACE, (_s, ptr) => `\" + JSON.stringify(${validate_1.getData(ptr, it)}) + \"`)\n .replace(EMPTY_STR, \"\"));\n }\n function templateFunc(msg) {\n return ajv_1._ `function(){return ${templateExpr(msg)}}`;\n }\n },\n metaSchema: {\n anyOf: [\n { type: \"string\" },\n {\n type: \"object\",\n properties: {\n properties: { $ref: \"#/$defs/stringMap\" },\n items: { $ref: \"#/$defs/stringList\" },\n required: { $ref: \"#/$defs/stringOrMap\" },\n dependencies: { $ref: \"#/$defs/stringOrMap\" },\n },\n additionalProperties: { type: \"string\" },\n },\n ],\n $defs: {\n stringMap: {\n type: \"object\",\n additionalProperties: { type: \"string\" },\n },\n stringOrMap: {\n anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/stringMap\" }],\n },\n stringList: { type: \"array\", items: { type: \"string\" } },\n },\n },\n };\n}\nconst ajvErrors = (ajv, options = {}) => {\n if (!ajv.opts.allErrors)\n throw new Error(\"ajv-errors: Ajv option allErrors must be true\");\n if (ajv.opts.jsPropertySyntax) {\n throw new Error(\"ajv-errors: ajv option jsPropertySyntax is not supported\");\n }\n return ajv.addKeyword(errorMessage(options));\n};\nexports.default = ajvErrors;\nmodule.exports = ajvErrors;\nmodule.exports.default = ajvErrors;\n//# sourceMappingURL=index.js.map","// Ajv, ajv-errors, and their runtime dependency closure are bundled by tsdown.\n// eslint-disable-next-line import-x/no-extraneous-dependencies\nimport Ajv from 'ajv';\n// eslint-disable-next-line import-x/no-extraneous-dependencies\nimport ajvErrors from 'ajv-errors';\n\n/**\nLazily creates (and memoizes) the shared Ajv instance.\n\n@returns {Ajv} The shared Ajv instance.\n*/\nconst getAjv = ((): (() => Ajv) => {\n let ajvInstance: Ajv | undefined;\n\n return (): Ajv => {\n if (!ajvInstance) {\n ajvInstance = new Ajv({allErrors: true});\n ajvErrors(ajvInstance);\n }\n\n return ajvInstance;\n };\n})();\n\n/**\nFormats an array of schema validation errors.\n\n@param {Array} errors An array of error messages to format.\n@returns {String} Formatted error message\n*/\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst formatSchemaErrors = (errors) => errors.map((error) => `\\t- ${error.message}\\n`).join('');\n\nconst standardRuleSchema = {\n type: 'string',\n enum: ['off', 'warning', 'error'],\n errorMessage: {\n type: 'severity must be a string.',\n enum: 'severity must be either \"off\", \"warning\", or \"error\".',\n },\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst arrayRuleSchema = (minItems: any): any => ({\n type: 'array',\n items: [\n standardRuleSchema,\n {\n type: 'array',\n minItems,\n uniqueItems: true,\n errorMessage: {\n type: 'the second item in an array rule config must be an array.',\n minItems: 'the second item in an array rule config must have at least 1 item.',\n uniqueItems: 'the second item in an array rule config must have unique items.',\n },\n },\n ],\n minItems: 2,\n maxItems: 2,\n additionalItems: false,\n errorMessage: {\n type: 'rule config must be an array, e.g. [\"error\", [\"value1\", \"value2\"]].',\n minItems: 'array rules must have two items, severity and options array. e.g. [\"error\", [\"value1\", \"value2\"]].',\n maxItems: 'array rules must have two items, severity and options array. e.g. [\"error\", [\"value1\", \"value2\"]].',\n additionalItems:\n 'array rules are only allowed two items, severity and the list is values. e.g. [\"error\", [\"value1\", \"value2\"]].',\n },\n});\n\nconst objectRuleSchema = {\n type: 'array',\n items: [\n standardRuleSchema,\n {\n type: 'object',\n errorMessage: {\n type: 'the second item in an object rule config must be an object.',\n },\n },\n ],\n minItems: 2,\n maxItems: 2,\n additionalItems: false,\n errorMessage: {\n type: 'rule config must be an array, e.g. [\"error\", {}].',\n minItems: 'object rules must have two items, severity and options object. e.g. [\"error\", {}].',\n maxItems: 'object rules must have two items, severity and options object. e.g. [\"error\", {}].',\n additionalItems: 'object rules are only allowed two items, severity and options object. e.g. [\"error\", {}].',\n },\n};\n\nconst optionalObjExceptionsSchema = {\n type: 'array',\n items: [\n {\n type: 'string',\n errorMessage: {\n type: 'each exception must be a string.',\n },\n },\n ],\n uniqueItems: true,\n minItems: 1,\n errorMessage: {\n type: 'expections must be an array.',\n minItems: 'expections must have at least 1 item.',\n uniqueItems: 'expections must have unique items.',\n },\n};\n\nconst configurationSchema = {\n type: 'object',\n properties: {\n extends: {\n type: ['string', 'array'],\n items: {\n type: 'string',\n },\n minItems: 1,\n uniqueItems: true,\n errorMessage: {\n type: 'extends must be either a string or an array of strings.',\n minItems: 'extends must have at least one item if it is an array.',\n uniqueItems: 'extends must have unique items if it is an array.',\n },\n },\n rules: {\n type: 'object',\n errorMessage: {\n type: 'rules must be an object.',\n },\n },\n root: {\n type: 'boolean',\n errorMessage: {\n type: 'root must be a boolean.',\n },\n },\n },\n additionalProperties: false,\n errorMessage: {\n type: 'npm-package-json-lint config should be an object.',\n additionalProperties:\n 'npm-package-json-lint config has unexpected top-level property. Valid properties include: `extends`, `rules`, and `root`.',\n },\n};\n\n/**\nValidates standard rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isStandardRuleSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(standardRuleSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates array rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@param {number} minItems Min number of items in the array\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isArrayRuleSchemaValid = (ruleConfig: any, minItems: any): any => {\n const validate = getAjv().compile(arrayRuleSchema(minItems));\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates array rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isObjectRuleSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(objectRuleSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates optional object exceptions config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isOptionalObjExceptSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(optionalObjExceptionsSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates the top level properties of the config object.\n\n@param {Object} config The config object to validate.\n@param {string} source The name of the configuration source to report in any errors.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isConfigObjectSchemaValid = (config: any, source: any): any => {\n const validate = getAjv().compile(configurationSchema);\n const isValid = validate(config);\n\n if (!isValid) {\n throw new Error(`npm-package-json-lint configuration in ${source} is invalid:\\n${formatSchemaErrors(validate.errors)}`);\n }\n\n return true;\n};\n","import {RuleType} from '../types/rule-type';\nimport {\n isArrayRuleSchemaValid,\n isConfigObjectSchemaValid,\n isObjectRuleSchemaValid,\n isOptionalObjExceptSchemaValid,\n isStandardRuleSchemaValid,\n} from './ConfigSchema';\n\n/**\nValidates object rule config\n\n@param {Object} ruleConfig Object rule\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isObjectRuleConfigValid = (ruleConfig: any): any => {\n if (typeof ruleConfig === 'string' && ruleConfig === 'off') {\n return true;\n }\n\n if (typeof ruleConfig === 'string' && ruleConfig !== 'off') {\n throw new Error('\\t- is an object type rule. It must be set to \"off\" if an object is not supplied.');\n }\n\n return isObjectRuleSchemaValid(ruleConfig);\n};\n\n/**\nValidates optional object rule config\n\n@param {Object} ruleConfig Object rule\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isOptionalObjRuleConfigValid = (ruleConfig: any): any => {\n if (typeof ruleConfig === 'string') {\n return isStandardRuleSchemaValid(ruleConfig);\n }\n\n const object = 1;\n\n return isObjectRuleSchemaValid(ruleConfig) && ruleConfig[object].hasOwnProperty('exceptions')\n ? isOptionalObjExceptSchemaValid(ruleConfig[object].exceptions)\n : true;\n};\n\n/**\nValidates array rule config\n\n@param {Array} ruleConfig Array rule\n@param {number} minItems Min number of items in the array\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isArrayRuleConfigValid = (ruleConfig: any, minItems: any): any => {\n if (typeof ruleConfig === 'string' && ruleConfig === 'off') {\n return true;\n }\n\n if (typeof ruleConfig === 'string' && ruleConfig !== 'off') {\n throw new Error('\\t- is an array type rule. It must be set to \"off\" if an array is not supplied.');\n }\n\n return isArrayRuleSchemaValid(ruleConfig, minItems);\n};\n\n/**\nValidates standard rule config\n\n@param {Object} ruleConfig Value for standard rule config\n@return {Boolean} True if config is valid, error if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isStandardRuleConfigValid = (ruleConfig: any): any => isStandardRuleSchemaValid(ruleConfig);\n\n/**\nValidates configuration of a rule\n\n@param {Object} ruleModule The rule object.\n@param {string} ruleName The rule's unique name.\n@param {Array|String} userConfig The user's configuration for a rule.\n@param {String|null} source The name of the configuration source to report in any errors.\n@returns {undefined} No return\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst validateRule = (ruleModule: any, ruleName: any, userConfig: any, source: any): any => {\n if (ruleModule) {\n try {\n switch (ruleModule.ruleType) {\n case RuleType.Array: {\n isArrayRuleConfigValid(userConfig, ruleModule.minItems);\n\n break;\n }\n case RuleType.Object: {\n isObjectRuleConfigValid(userConfig);\n\n break;\n }\n case RuleType.OptionalObject: {\n isOptionalObjRuleConfigValid(userConfig);\n\n break;\n }\n default: {\n isStandardRuleConfigValid(userConfig);\n }\n }\n } catch (error_) {\n const modifiedErrorMessage = `Configuration for rule \"${ruleName}\" is invalid:\\n${error_.message}`;\n\n const error = new Error(typeof source === 'string' ? `${source}:\\n\\t${modifiedErrorMessage}` : modifiedErrorMessage);\n\n throw error;\n }\n }\n};\n\n/**\nValidates only the rules of a config object\n\n@param {Object} rulesConfig The rules config object to validate.\n@param {String} source The name of the configuration source to report in any errors.\n@param {Object} rules Rules object\n@returns {undefined} No return\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const validateRules = (rulesConfig: any, source: any, rules: any): any => {\n if (!rulesConfig) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n Object.keys(rulesConfig).forEach((ruleName) => {\n const ruleModule = rules.get(ruleName);\n\n validateRule(ruleModule, ruleName, rulesConfig[ruleName], source);\n });\n};\n\n/**\nValidates entire config object, including top-level properties.\n\n@param {Object} config The config object to validate.\n@param {String} source The name of the configuration source to report in any errors.\n@param {Object} rules Rules object\n@returns {undefined} No return\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const validate = (config: any, source: any, rules: any): any => {\n isConfigObjectSchemaValid(config, source);\n validateRules(config.rules, source, rules);\n};\n","import fs from 'node:fs';\nimport stripComments from 'strip-json-comments';\n\n/**\nRequire JavaScript file\n\n@param fileName String file path of file to load\n@internal\n*/\n// eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\nconst requireFile = (fileName: string): NodeRequire => require(fileName);\n\n/**\nSychronously reads file from file system\n\n@param fileName String file path of file to load\n@internal\n*/\nconst readFile = (fileName: string): string => fs.readFileSync(fileName, 'utf8').replace(/^\\u{FEFF}/u, '');\n\n/**\nHelper method for throwing errors when file fails to load.\n\n@param fileName Name of the file that failed to load.\n@param err Error object\n@throws {Error}\n@internal\n*/\nconst handleError = (fileName: string, err: Error): void => {\n throw new Error(`Failed to read config file: ${fileName}. \\nError: ${err.message}`);\n};\n\n// The parser and rules are bundled separately, so they must share the same metadata key.\nexport const sourceSymbol = Symbol.for('npm-package-json-lint:JSON-source');\n\n/**\nParse a JSON file\n\n@param fileName String file path of file to load\n@return Valid JSON\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const parseJsonFile = (fileName: string): Record<string, any> => {\n let json = {};\n let fileContents = '';\n\n try {\n fileContents = readFile(fileName);\n\n json = JSON.parse(stripComments(fileContents));\n } catch (error) {\n handleError(fileName, error);\n }\n\n Object.defineProperty(json, sourceSymbol, {\n value: fileContents,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n\n return json;\n};\n\n/**\nParse a JavaScript file\n\n@param fileName String file path of file to load\n@return Valid JavaScript object\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const parseJavaScriptFile = (fileName: string): Record<string, any> => {\n let obj = {};\n\n try {\n obj = requireFile(fileName);\n } catch (error) {\n handleError(fileName, error);\n }\n\n return obj;\n};\n","","/**\nBuilt-in default rule configuration.\n\nExtend it with `\"extends\": \"npm-package-json-lint:default\"` in a\n.npmpackagejsonlintrc.json file.\n*/\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nexport const defaultConfig = require('./default-rules.json');\n","import path from 'node:path';\nimport {parseJavaScriptFile, parseJsonFile} from '../file-parser';\nimport {defaultConfig} from './default';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:applyExtendsIfSpecified');\n\n/**\nBuilt-in configs that can be extended without installing a separate module.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst virtualConfigs = new Map<string, any>([['npm-package-json-lint:default', defaultConfig]]);\n\n/**\nApplies values from the 'extends' field in a configuration file.\n\n@param {Object} config The configuration information.\n@param {string} parentName Name of parent. For troubleshooting.\n@param {Object} originalFilePath Base config file the extends originated from\n@returns {Object} A new configuration object with all of the 'extends' fields loaded and merged.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst applyExtends = (config: any, parentName: any, originalFilePath: any): any => {\n const configExtends = Array.isArray(config.extends) ? config.extends : [config.extends];\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return configExtends.reduceRight((previousConfig, moduleName) => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const extendsConfig = loadFromModule(moduleName, originalFilePath);\n\n // Merge base object\n const mergedConfig = {...extendsConfig, ...previousConfig};\n\n // Merge rules\n const rules = {...extendsConfig.rules, ...previousConfig.rules};\n\n // Merge plugins, if exist\n const extendsConfigPlugins = Array.isArray(extendsConfig.plugins) ? extendsConfig.plugins : [];\n const previousConfigPlugins = Array.isArray(previousConfig.plugins) ? previousConfig.plugins : [];\n const plugins = [...extendsConfigPlugins, ...previousConfigPlugins];\n const uniquePlugins = [...new Set(plugins)];\n\n // Merge overrides, if exist\n const extendsConfigOverrides = Array.isArray(extendsConfig.overrides) ? extendsConfig.overrides : [];\n const previousConfigOverrides = Array.isArray(previousConfig.overrides) ? previousConfig.overrides : [];\n const overrides = [...extendsConfigOverrides, ...previousConfigOverrides];\n\n // Override merged rules\n mergedConfig.rules = rules;\n\n if (plugins.length > 0) {\n mergedConfig.plugins = uniquePlugins;\n }\n\n if (overrides.length > 0) {\n mergedConfig.overrides = overrides;\n }\n\n return mergedConfig;\n } catch (error) {\n error.message += `\\nReferenced from: ${parentName}`;\n throw error;\n }\n }, config);\n};\n\n/**\nGets configuration from a extends config module\n\n@param {String} moduleName Name of the configuration module\n@param {Object} originalFilePath Base config file the extends originated from\n@return {Object} Configuration object\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst loadFromModule = (moduleName: any, originalFilePath: any): any => {\n let config;\n let adjustedModuleName = moduleName;\n\n if (virtualConfigs.has(moduleName)) {\n debug(`${moduleName} is a built-in config, loading it directly.`);\n config = virtualConfigs.get(moduleName);\n } else if (moduleName.startsWith('./')) {\n adjustedModuleName = path.join(process.cwd(), moduleName);\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n config = loadConfigFile(adjustedModuleName);\n } else {\n const resolvedModule = require.resolve(adjustedModuleName, {paths: [path.dirname(originalFilePath)]});\n\n // eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\n config = require(resolvedModule);\n }\n\n if (Object.keys(config).length > 0 && config.extends) {\n config = applyExtends(config, adjustedModuleName, originalFilePath);\n }\n\n return config;\n};\n\n/**\nLoads a configuration file regardless of the source. Inspects the file path\nto determine the correctly way to load the config file.\n\n@param {Object} filePath The path to the configuration.\n@returns {Object} The configuration information.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst loadConfigFile = (filePath: any): any => {\n let config;\n\n switch (path.extname(filePath)) {\n case '.js': {\n config = parseJavaScriptFile(filePath);\n break;\n }\n\n case '.json': {\n config = parseJsonFile(filePath);\n break;\n }\n\n default: {\n throw new Error(`Unsupport config file extension. File path: ${filePath}`);\n }\n }\n\n return config;\n};\n\n/**\nLoads a configuration file from the given file path.\n\n@param {Object} npmPackageJsonLintConfig Parsed config from cosmicconfig\n@param {string} filepath the path to the config file\n@returns {Object} the parsed config object (empty object if there was a parse error)\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const applyExtendsIfSpecified = (npmPackageJsonLintConfig: any, filepath: any): any => {\n let config = {...npmPackageJsonLintConfig};\n\n debug('Loading extends, if applicable');\n if (config?.hasOwnProperty('extends') && config.extends) {\n debug('extends property present, applying.');\n config = applyExtends(config, filepath, filepath);\n }\n\n debug('Loading extends complete');\n\n return config;\n};\n","import path from 'node:path';\nimport {minimatch} from 'minimatch';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:applyOverrides');\n\n/**\nApplies values from the 'overrides' field in a configuration file.\n@param {string} cwd The current working directory.\n@param {string} filePath The file path of the file being linted.\n@param {Object} rules Rules object\n@param {Object} overrides Overrides object\n@returns {Object} A new configuration object with all of the 'overrides' applied.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const applyOverrides = (cwd: string, filePath: string, rules: any, overrides?: any[]): any => {\n let finalRules = {...rules};\n\n debug('overrides');\n debug(overrides);\n\n if (overrides) {\n // Compute the relative path once and reuse across all override checks.\n // Normalize to forward slashes so patterns work consistently across platforms.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n const relativeFilePath = path.relative(cwd, filePath).replace(/\\\\/g, '/');\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n overrides.forEach((override) => {\n const filteredPatterns = override.patterns.filter((pattern: string) => pattern.length);\n const transformedPatterns = filteredPatterns.map((pattern: string) =>\n pattern.endsWith(`/package.json`) ? pattern : `${pattern}/package.json`,\n );\n\n // Strip leading './' from patterns so they match the output of path.relative(),\n // which never includes a leading './'.\n const matches = transformedPatterns.some((pattern: string) =>\n minimatch(relativeFilePath, pattern.replace(/^\\.\\//, ''), {dot: true}),\n );\n\n debug('relativeFilePath: %s, patterns: %o, matches: %s', relativeFilePath, transformedPatterns, matches);\n\n if (matches) {\n finalRules = {...finalRules, ...override.rules};\n }\n });\n }\n\n debug('finalRules');\n debug(finalRules);\n\n return finalRules;\n};\n","import path from 'node:path';\nimport {applyExtendsIfSpecified} from './applyExtendsIfSpecified';\nimport {applyOverrides} from './applyOverrides';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:cosmicConfigTransformer');\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const transform = (cwd: any, configBaseDirectory: any, filePathBeingLinted: any): any => {\n debug(`cwd: ${cwd}`);\n debug(`configBaseDirectory`);\n debug(configBaseDirectory);\n\n return (cosmiconfigResult) => {\n debug(`cosmiconfigResult`);\n debug(cosmiconfigResult);\n\n if (!cosmiconfigResult) {\n return null;\n }\n\n const {config, filepath} = cosmiconfigResult;\n\n debug(`cosmiconfigResult.config`);\n debug(config);\n debug(`cosmiconfigResult.filepath`);\n debug(filepath);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const configDir = configBaseDirectory || path.dirname(filepath || '');\n const npmPackageJsonLintConfig = {...config};\n\n const configAfterExtends = applyExtendsIfSpecified(npmPackageJsonLintConfig, filePathBeingLinted);\n const configAfterOverrides = applyOverrides(\n cwd,\n filePathBeingLinted,\n configAfterExtends.rules,\n configAfterExtends.overrides,\n );\n\n return configAfterOverrides;\n };\n};\n","import {cosmiconfigSync} from 'cosmiconfig';\nimport {validateRules} from './config/ConfigValidator';\nimport {transform} from './config/cosmicConfigTransformer';\nimport {applyExtendsIfSpecified} from './config/applyExtendsIfSpecified';\nimport {applyOverrides} from './config/applyOverrides';\nimport {Rules} from './native-rules';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:Config');\n\nconst noRules = 0;\n\n/**\nConfig class\n@class\n*/\nexport class Config {\n /**\n The user passed config object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config: any;\n\n /**\n The current working directory.\n */\n cwd: string;\n\n /**\n The user passed configFile path.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configFile: any;\n\n /**\n The base directory that config should be pulled from.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configBaseDirectory: any;\n\n /**\n Rules object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rules: any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(cwd: string, config: any, configFile: any, configBaseDirectory: any, rules: Rules) {\n if (config) {\n this.config = applyExtendsIfSpecified(config, 'PassedConfig');\n }\n\n this.cwd = cwd;\n this.configFile = configFile;\n this.configBaseDirectory = configBaseDirectory;\n this.rules = rules;\n }\n\n /**\n Gets the config for a file.\n \n @param filePath File path of the file being linted.\n @returns {Object} A config object.\n @memberof Config\n */\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n getConfigForFile(filePath: string) {\n debug(`Getting config for ${filePath}`);\n const filePathToSearch = filePath;\n\n debug(`filePathToSearch: ${filePathToSearch}`);\n let config;\n\n // eslint-disable-next-line unicorn/no-typeof-undefined\n if (typeof this.config === 'undefined') {\n debug(`User passed config is undefined.`);\n if (this.configFile) {\n debug(`Config file specified, loading it.`);\n config = cosmiconfigSync('npmpackagejsonlint', {\n transform: transform(this.cwd, this.configBaseDirectory, filePath),\n }).load(this.configFile);\n } else {\n debug(`Config file wasn't specified, searching for config.`);\n config = cosmiconfigSync('npmpackagejsonlint', {\n transform: transform(this.cwd, this.configBaseDirectory, filePathToSearch),\n searchStrategy: 'global',\n }).search(filePathToSearch);\n }\n } else {\n debug(`User passed config is set, using it.`);\n const configBeforeOverrides = this.config;\n\n debug(`Applying overrides to config for ${filePath}`);\n config = applyOverrides(this.cwd, filePath, configBeforeOverrides.rules, configBeforeOverrides.overrides);\n\n debug(`Overrides applied for ${filePath}`);\n }\n\n if (!config) {\n throw new Error(`No npm-package-json-lint configuration found.\\n${filePathToSearch}`);\n }\n\n if (Object.keys(config).length === noRules) {\n throw new Error(`No rules specified in configuration.\\n${filePathToSearch}`);\n }\n\n debug(`Overrides applied for ${filePath}`);\n debug('Final Config');\n debug(config);\n\n validateRules(config, 'cli', this.rules);\n\n return config;\n }\n}\n","import chalk from 'chalk';\nimport {readdirSync} from 'node:fs';\nimport path from 'node:path';\nimport {LintFunction} from './types/lint-function';\nimport {RuleType} from './types/rule-type';\n\nexport interface Rule {\n lint: LintFunction;\n ruleType: RuleType;\n minItems?: number;\n}\n\nexport class Rules {\n rules: Record<string, string>;\n\n constructor() {\n this.rules = {};\n }\n\n /**\n Loads rules\n \n @return Set of rules\n */\n load(): Record<string, string> {\n const rulesDirectory = path.join(__dirname, 'rules');\n\n try {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n readdirSync(rulesDirectory).forEach((filePath) => {\n const beginIndex = 0;\n const endIndex = -3;\n // remove the file extension, e.g. `.js`\n const ruleId = filePath.slice(beginIndex, endIndex);\n const filePathToRuleModule = path.join(rulesDirectory, filePath);\n\n this.registerRule(ruleId, filePathToRuleModule);\n });\n\n return this.rules;\n } catch (error) {\n throw new Error(`Error while loading rules from rules directory - ${error.message}`, error);\n }\n }\n\n /**\n Loads a rule module\n \n @param ruleId Name of the rule\n @return Rule module\n */\n get(ruleId: string): Rule {\n const rule = this.rules[ruleId];\n\n // eslint-disable-next-line unicorn/no-typeof-undefined\n if (typeof rule === 'undefined') {\n const errorMsg = `Rule, ${ruleId}, is invalid. Please ensure it matches a valid option.`;\n\n throw new Error(chalk.bold.red(errorMsg));\n }\n\n // eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\n const ruleModule = require(this.rules[ruleId]);\n\n return ruleModule;\n }\n\n /**\n Gets entire rule set\n \n @returns Rule set\n */\n getRules(): Record<string, string> {\n return this.rules;\n }\n\n /**\n Registers a rule in the rules object\n \n @param ruleId Name of the rule\n @param filePathToRuleModule File path to rule\n */\n registerRule(ruleId: string, filePathToRuleModule: string): void {\n this.rules[ruleId] = filePathToRuleModule;\n }\n}\n","export enum Severity {\n Error = 'error',\n Warning = 'warning',\n Off = 'off',\n}\n","import {LintIssue} from '../lint-issue';\nimport {Severity} from '../types/severity';\nimport type {PackageJsonFileLintingResult} from '../types/package-json-linting-result';\n\n/**\nA result count object for a files.\n@typedef {Object} FileResultCounts\n@property {number} errorCount Number of errors for a file result.\n@property {number} warningCount Number of warnings for a file result.\n*/\n\nexport interface PackageJsonFileAggregatedResultCounts {\n errorCount: number;\n warningCount: number;\n}\n\n/**\nAggregates the count of errors and warning for a package.json file.\n\n@param issues Array of {@link LintIssue} objects from a package.json file.\n@returns Counts object {@link PackageJsonFileAggregatedResultCounts}.\n*/\nexport const aggregateCountsPerFile = (issues: LintIssue[]): PackageJsonFileAggregatedResultCounts => {\n const incrementOne = 1;\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return issues.reduce(\n (counts, issue) => {\n const isErrorSeverity = issue.severity === Severity.Error;\n const newErrorCount = isErrorSeverity ? counts.errorCount + incrementOne : counts.errorCount;\n const newWarningCount = isErrorSeverity ? counts.warningCount : counts.warningCount + incrementOne;\n\n return {\n errorCount: newErrorCount,\n warningCount: newWarningCount,\n };\n },\n {\n errorCount: 0,\n warningCount: 0,\n },\n );\n};\n\nexport interface OverallAggregatedResultCounts {\n /**\n Total number of ignored files.\n */\n ignoreCount: number;\n /**\n Total number of errors.\n */\n errorCount: number;\n /**\n Total number of warnings.\n */\n warningCount: number;\n}\n\n/**\nAggregates the count of errors and warnings for all package.json files.\n\n@param results Array of {@link PackageJsonFileLintingResult} objects from all package.json files.\n@returns Counts object {@link OverallAggregatedResultCounts}\n*/\nexport const aggregateOverallCounts = (results: PackageJsonFileLintingResult[]): OverallAggregatedResultCounts =>\n // eslint-disable-next-line unicorn/no-array-reduce\n results.reduce(\n (counts, result) => ({\n ignoreCount: result.ignored ? counts.ignoreCount + 1 : counts.ignoreCount,\n errorCount: counts.errorCount + result.errorCount,\n warningCount: counts.warningCount + result.warningCount,\n }),\n {\n ignoreCount: 0,\n errorCount: 0,\n warningCount: 0,\n },\n );\n","import path from 'node:path';\nimport type {PackageJson} from 'type-fest';\nimport {Ignore} from 'ignore';\nimport {Rules} from '../native-rules';\nimport {parseJsonFile} from '../file-parser';\nimport {LintIssue} from '../lint-issue';\nimport {RuleType} from '../types/rule-type';\nimport {Severity} from '../types/severity';\nimport {aggregateCountsPerFile, aggregateOverallCounts, OverallAggregatedResultCounts} from './results-helper';\nimport {Config} from '../configuration';\nimport type {PackageJsonFileLintingResult} from '../types/package-json-linting-result';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:linter');\n\nexport interface CreateResultObjectOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An optional string representing the package.json file.\n */\n fileName: string;\n /**\n A flag indicating that the file was skipped.\n */\n ignored: boolean;\n /**\n A list of issues.\n */\n issues: LintIssue[];\n /**\n Number of errors.\n */\n errorCount: number;\n /**\n Number of warnings.\n */\n warningCount: number;\n}\n\n/**\nCreates a results object.\n\n@param options A {@link CreateResultObjectOptions} object\n@returns The lint results {@link PackageJsonFileLintingResult} for the package.json file.\n@internal\n*/\nconst createResultObject = (options: CreateResultObjectOptions): PackageJsonFileLintingResult => {\n const {cwd, fileName, ignored, issues, errorCount, warningCount} = options;\n const relativeFilePath = path.relative(cwd, fileName);\n\n return {\n // Files outside cwd already start with `../`, so don't prefix them with `./`\n filePath: relativeFilePath.startsWith(`..${path.sep}`) ? relativeFilePath : `./${relativeFilePath}`,\n issues,\n ignored,\n errorCount,\n warningCount,\n };\n};\n\n/**\nRuns configured rules against the provided package.json object.\n\n@param packageJsonData Valid package.json data\n@param configObj Configuration object\n@param rules Object of rule definitions\n@return An array of {@link LintIssue} objects.\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst lint = (packageJsonData: any, configObj, rules: Rules): LintIssue[] => {\n const lintIssues = [];\n\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\n for (const rule in configObj) {\n const ruleModule = rules.get(rule);\n\n // eslint-disable-next-line no-useless-assignment\n let severity = Severity.Off;\n let ruleConfig;\n\n if (ruleModule.ruleType === RuleType.Array || ruleModule.ruleType === RuleType.Object) {\n severity = typeof configObj[rule] === 'string' && configObj[rule] === 'off' ? configObj[rule] : configObj[rule][0];\n ruleConfig = typeof configObj[rule] === 'string' ? {} : configObj[rule][1];\n } else if (ruleModule.ruleType === RuleType.OptionalObject) {\n if (typeof configObj[rule] === 'string') {\n severity = configObj[rule] as Severity;\n ruleConfig = {};\n } else {\n // eslint-disable-next-line prefer-destructuring\n severity = configObj[rule][0];\n // eslint-disable-next-line prefer-destructuring\n ruleConfig = configObj[rule][1];\n }\n } else {\n severity = configObj[rule];\n }\n\n if (severity === Severity.Off) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n const lintResult = ruleModule.lint(packageJsonData, severity, ruleConfig);\n\n if (lintResult !== null) {\n lintIssues.push(lintResult);\n }\n }\n\n return lintIssues;\n};\n\n/**\nProcesses package.json object\n\n@param cwd The current working directory.\n@param packageJsonObj An object representation of a package.json file.\n@param config A config object.\n@param fileName An optional string representing the package.json file.\n@param rules An instance of `Rules`.\n@returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file.\n@internal\n*/\nconst processPackageJsonObject = (\n cwd: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObj: PackageJson | any,\n config,\n fileName: string,\n rules: Rules,\n): PackageJsonFileLintingResult => {\n const lintIssues = lint(packageJsonObj, config, rules);\n const counts = aggregateCountsPerFile(lintIssues);\n const result = createResultObject({\n cwd,\n fileName,\n ignored: false,\n issues: lintIssues,\n errorCount: counts.errorCount,\n warningCount: counts.warningCount,\n });\n\n return result;\n};\n\n/**\nProcesses a package.json file.\n\n@param cwd The current working directory.\n@param fileName The filename of the file being linted.\n@param config A config object.\n@param rules An instance of `Rules`.\n@returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file.\n@internal\n*/\nconst processPackageJsonFile = (cwd: string, fileName: string, config, rules: Rules): PackageJsonFileLintingResult => {\n const packageJsonObj = parseJsonFile(path.resolve(fileName));\n\n return processPackageJsonObject(cwd, packageJsonObj, config, fileName, rules);\n};\n\nexport interface LinterResult {\n results: LintIssue[];\n ignoreCount: number;\n /**\n Number of errors for the package.json file.\n */\n errorCount: number;\n /**\n Number of warnings for the package.json file.\n */\n warningCount: number;\n}\n\nexport interface ExecuteOnPackageJsonObjectOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An object representation of a package.json file.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject: PackageJson | any;\n /**\n An optional string representing the texts filename.\n */\n filename?: string;\n /**\n An instance of the `ignore` module.\n */\n ignorer: Ignore;\n /**\n An instance of {@Config}.\n */\n configHelper: Config;\n /**\n An instance of {@link Rules}\n */\n rules: Rules;\n}\n\nexport interface OverallLintingResult extends OverallAggregatedResultCounts {\n results: PackageJsonFileLintingResult[];\n}\n\n/**\nExecutes linter on package.json object\n\n@param options A {@link ExecuteOnPackageJsonObjectOptions} object\n@returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n*/\nexport const executeOnPackageJsonObject = (options: ExecuteOnPackageJsonObjectOptions): OverallLintingResult => {\n const {cwd, packageJsonObject, filename = '', ignorer, configHelper, rules} = options;\n\n debug('executing on package.json object');\n const results = [];\n\n const resolvedFilename = path.isAbsolute(filename) ? filename : path.resolve(cwd, filename);\n const relativeFilePath = path.relative(cwd, resolvedFilename);\n\n let result;\n\n if (ignorer.ignores(relativeFilePath)) {\n debug(`Ignored: ${relativeFilePath}`);\n\n result = createResultObject({\n cwd,\n fileName: resolvedFilename,\n ignored: true,\n issues: [],\n errorCount: 0,\n warningCount: 0,\n });\n } else {\n debug(`Getting config for ${resolvedFilename}`);\n const config = configHelper.getConfigForFile(resolvedFilename);\n\n debug(`Config fetched for ${resolvedFilename}`);\n result = processPackageJsonObject(cwd, packageJsonObject, config, resolvedFilename, rules);\n }\n\n results.push(result);\n\n debug('Aggregating overall counts');\n const stats = aggregateOverallCounts(results);\n\n debug('stats');\n debug(stats);\n\n return {\n results,\n ignoreCount: stats.ignoreCount,\n errorCount: stats.errorCount,\n warningCount: stats.warningCount,\n };\n};\n\nexport interface ExecuteOnPackageJsonFilesOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An array of files and directory names.\n */\n fileList: string[];\n /**\n An instance of the `ignore` module.\n */\n ignorer: Ignore;\n /**\n An instance of {@Config}.\n */\n configHelper: Config;\n /**\n An instance of {@link Rules}\n */\n rules: Rules;\n}\n\n/**\nExecutes the current configuration on an array of file and directory names.\n@param options A {@link ExecuteOnPackageJsonFilesOptions} object\n@returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n*/\nexport const executeOnPackageJsonFiles = (options: ExecuteOnPackageJsonFilesOptions): OverallLintingResult => {\n const {cwd, fileList, ignorer, configHelper, rules} = options;\n\n debug('executing on package.json files');\n const results = fileList.map((filePath) => {\n const relativeFilePath = path.relative(cwd, filePath);\n\n if (ignorer.ignores(relativeFilePath)) {\n debug(`Ignored: ${relativeFilePath}`);\n\n return createResultObject({\n cwd,\n fileName: filePath,\n ignored: true,\n issues: [],\n errorCount: 0,\n warningCount: 0,\n });\n }\n\n debug(`Getting config for ${filePath}`);\n const config = configHelper.getConfigForFile(filePath);\n\n debug(`Config fetched for ${filePath}`);\n\n return processPackageJsonFile(cwd, filePath, config, rules);\n });\n\n debug('Aggregating overall counts');\n const stats = aggregateOverallCounts(results);\n\n debug('stats');\n debug(stats);\n\n return {\n results,\n ignoreCount: stats.ignoreCount,\n errorCount: stats.errorCount,\n warningCount: stats.warningCount,\n };\n};\n","import path from 'node:path';\nimport globby from 'globby';\nimport {slash} from './slash';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:getFileList');\n\nconst GLOB_CHARS = /[!()*+?@[\\]{}]/;\n\n/**\nSplits a glob pattern into its static base directory and the rest of the pattern.\n\n@param pattern A glob pattern with forward slashes\n@returns The static base and the pattern relative to it\n*/\nconst splitGlobBase = (pattern: string): {base: string; rest: string} => {\n const segments = pattern.split('/');\n const firstGlobIndex = segments.findIndex((segment) => GLOB_CHARS.test(segment));\n const baseSegments = segments.slice(0, firstGlobIndex === -1 ? -1 : firstGlobIndex);\n const restSegments = segments.slice(baseSegments.length);\n\n return {base: `${baseSegments.join('/')}/`, rest: restSegments.join('/')};\n};\n\n/**\nDetermines whether a pattern points outside of cwd (e.g. `../sibling`).\n\n@param pattern A glob pattern\n@param cwd The current working directory\n@returns True if the pattern resolves outside of cwd\n*/\nconst isOutsideCwd = (pattern: string, cwd: string): boolean => {\n const relative = path.relative(cwd, path.resolve(cwd, pattern));\n\n return relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative);\n};\n\n/**\nGlobs a pattern that points outside of cwd from its own static base directory.\nglobby's gitignore filter only accepts paths inside its cwd, so these can't share the main glob.\n\n@param pattern A glob pattern that resolves outside of cwd\n@param cwd The current working directory\n@returns Absolute paths of the matching files\n*/\nconst globOutsideCwd = (pattern: string, cwd: string): string[] => {\n const {base, rest} = splitGlobBase(slash(path.resolve(cwd, pattern)));\n\n return globby.sync([rest, '!**/node_modules/**'], {\n cwd: base,\n gitignore: true,\n absolute: true,\n });\n};\n\n/**\nGenerates a list of files to lint based on a list of provided patterns\n\n@param {Array<string>} patterns An array of patterns\n@param {string} cwd The current working directory.\n@returns {Array<string>} An array a files to lint.\n*/\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const getFileList = (patterns, cwd) => {\n debug('patterns');\n debug(patterns);\n\n // step 1 - filter out empty entries\n const filteredPatterns = patterns.filter((pattern) => pattern.length);\n\n debug('filteredPatterns');\n debug(filteredPatterns);\n\n // step 2 - convert directories to globs\n const globPatterns = filteredPatterns.map((pattern) =>\n pattern.endsWith(`/package.json`) ? pattern : `${pattern}/**/package.json`,\n );\n\n // step 3 - glob patterns outside of cwd (e.g. `../sibling`) separately, see `globOutsideCwd`\n const insidePatterns = globPatterns.filter((pattern) => pattern.startsWith('!') || !isOutsideCwd(pattern, cwd));\n const outsidePatterns = globPatterns.filter((pattern) => !pattern.startsWith('!') && isOutsideCwd(pattern, cwd));\n\n debug('insidePatterns');\n debug(insidePatterns);\n debug('outsidePatterns');\n debug(outsidePatterns);\n\n const hasInsidePatterns = insidePatterns.some((pattern) => !pattern.startsWith('!'));\n const globFiles = [\n ...(hasInsidePatterns\n ? globby.sync([...insidePatterns, '!**/node_modules/**'], {cwd, gitignore: true, absolute: true})\n : []),\n ...outsidePatterns.flatMap((pattern) => globOutsideCwd(pattern, cwd)),\n ];\n\n debug('globFiles');\n debug(globFiles);\n\n // step 4 - normalize and de-duplicate, keeping the first occurrence of each file\n const files = [...new Set(globFiles.map((globFile) => path.resolve(globFile)))];\n\n debug('Final file list from `getFileList`');\n debug(files);\n\n return files;\n};\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport ignore, {Ignore} from 'ignore';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:getIgnorer');\n\nconst DEFAULT_IGNORE_FILENAME = '.npmpackagejsonlintignore';\nconst FILE_NOT_FOUND_ERROR_CODE = 'ENOENT';\n\n/**\nGenerates ignorer based on ignore file content.\n\n@param cwd Current work directory.\n@param ignorePath Ignore path.\n@returns An instance of an Ignorer\n*/\nexport const getIgnorer = (cwd: string, ignorePath: string): Ignore => {\n const ignoreFilePath = ignorePath || DEFAULT_IGNORE_FILENAME;\n\n debug(`ignoreFilePath: ${ignoreFilePath}`);\n const absoluteIgnoreFilePath = path.isAbsolute(ignoreFilePath) ? ignoreFilePath : path.resolve(cwd, ignoreFilePath);\n\n debug(`absoluteIgnoreFilePath: ${absoluteIgnoreFilePath}`);\n let ignoreText = '';\n\n try {\n ignoreText = fs.readFileSync(absoluteIgnoreFilePath, 'utf8');\n } catch (readError) {\n if (readError.code !== FILE_NOT_FOUND_ERROR_CODE) {\n throw readError;\n }\n }\n\n debug('Ignore text added');\n\n // Files outside cwd (e.g. `npmPkgJsonLint ../sibling`) produce `../` relative paths.\n // `ignore` throws on those by default, so allow them. Patterns are relative to cwd, so they won't match.\n return ignore({allowRelativePaths: true}).add(ignoreText);\n};\n","","import type {PackageJson} from 'type-fest';\nimport {slash} from './utils/slash';\nimport {isPlainObj} from './utils/isPlainObj';\nimport {Config} from './configuration';\nimport {Rules} from './native-rules';\nimport {executeOnPackageJsonFiles, executeOnPackageJsonObject, OverallLintingResult} from './linter/linter';\nimport {getFileList} from './utils/getFileList';\nimport {getIgnorer} from './utils/getIgnorer';\nimport {Severity} from './types/severity';\nimport type {PackageJsonFileLintingResult} from './types/package-json-linting-result';\nimport {LintIssue} from './lint-issue';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:NpmPackageJsonLint');\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst pkg = require('../package.json');\n\nconst noIssues = 0;\n\n/**\nChecks if the given issue is an error issue.\n\n@param issue A {@link LintIssue} object\n@returns True if error, false if warning.\n@private\n*/\nconst isIssueAnError = (issue: LintIssue): boolean => issue.severity === Severity.Error;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isPackageJsonObjectValid = (packageJsonObject: PackageJson | any): boolean => isPlainObj(packageJsonObject);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRequiredOptionsValid = (packageJsonObject: PackageJson | any, patterns: string[]): boolean =>\n (!patterns && !isPackageJsonObjectValid(packageJsonObject)) ||\n (patterns && (packageJsonObject || isPackageJsonObjectValid(packageJsonObject)));\n\n/**\nFilters results to only include errors.\n\n@param results The results to filter.\n@returns The filtered results.\n*/\nconst getErrorResults = (results: PackageJsonFileLintingResult[]): PackageJsonFileLintingResult[] => {\n const filtered = [];\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n results.forEach((result) => {\n // eslint-disable-next-line unicorn/no-array-callback-reference\n const filteredIssues = result.issues.filter(isIssueAnError);\n\n if (filteredIssues.length <= noIssues) {\n return;\n }\n\n const filteredResult = {\n issues: filteredIssues,\n errorCount: filteredIssues.length,\n warningCount: 0,\n };\n\n filtered.push(Object.assign(result, filteredResult));\n });\n\n return filtered;\n};\n\nexport interface NpmPackageJsonLintOptions {\n cwd?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject?: any;\n packageJsonFilePath?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configFile?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configBaseDirectory?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patterns?: any;\n quiet?: boolean;\n ignorePath?: string;\n fix?: boolean;\n}\n\nexport class NpmPackageJsonLint {\n cwd: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject: any;\n\n packageJsonFilePath: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patterns: any;\n\n quiet: boolean;\n\n ignorePath: string;\n\n fix: boolean;\n\n version: string;\n\n rules: Rules;\n\n configHelper: Config;\n\n /**\n constructor\n @param options An instance of the {@link NpmPackageJsonLintOptions} options object.\n @constructor\n */\n constructor(options: NpmPackageJsonLintOptions) {\n const {\n cwd,\n packageJsonObject,\n packageJsonFilePath,\n config,\n configFile,\n configBaseDirectory,\n patterns,\n quiet = false,\n ignorePath = '',\n fix = false,\n } = options;\n\n this.cwd = slash(cwd || process.cwd());\n\n this.packageJsonObject = packageJsonObject;\n this.packageJsonFilePath = packageJsonFilePath ? slash(packageJsonFilePath) : packageJsonFilePath;\n this.patterns = patterns;\n this.quiet = quiet;\n this.ignorePath = ignorePath;\n this.fix = fix;\n\n this.version = pkg.version;\n\n this.rules = new Rules();\n this.rules.load();\n\n this.configHelper = new Config(this.cwd, config, configFile, configBaseDirectory, this.rules);\n }\n\n /**\n Runs the linter using the config specified in the constructor\n \n @returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n */\n // eslint-disable-next-line max-lines-per-function\n lint(): OverallLintingResult {\n debug('Starting lint');\n\n if (isRequiredOptionsValid(this.packageJsonObject, this.patterns)) {\n throw new Error(\n 'You must pass npm-package-json-lint a `patterns` glob or a `packageJsonObject` string, though not both.',\n );\n }\n\n const ignorer = getIgnorer(this.cwd, this.ignorePath);\n let linterOutput: OverallLintingResult;\n\n if (this.patterns) {\n debug('Linting using patterns');\n\n if (!Array.isArray(this.patterns)) {\n throw new TypeError('Patterns must be an array.');\n }\n\n const fileList = getFileList(this.patterns, this.cwd);\n\n linterOutput = executeOnPackageJsonFiles({\n cwd: this.cwd,\n fileList,\n ignorer,\n configHelper: this.configHelper,\n rules: this.rules,\n });\n } else {\n debug('Linting using passed object.');\n linterOutput = executeOnPackageJsonObject({\n cwd: this.cwd,\n packageJsonObject: this.packageJsonObject,\n ignorer,\n filename: this.packageJsonFilePath,\n configHelper: this.configHelper,\n rules: this.rules,\n });\n }\n\n if (this.quiet) {\n const errorsOnly = getErrorResults(linterOutput.results);\n\n return {\n results: errorsOnly,\n ignoreCount: linterOutput.ignoreCount,\n errorCount: linterOutput.errorCount,\n warningCount: linterOutput.warningCount,\n };\n }\n\n debug('lint complete');\n\n return linterOutput;\n }\n}\n","import chalk from 'chalk';\nimport {Severity} from './types/severity';\n\n/**\nA lint issue\n*/\nexport class LintIssue {\n /**\n Unique, lowercase, hyphen-separate name for the lint\n \n @type {string}\n @memberof LintIssue\n */\n lintId: string;\n\n /**\n 'error' or 'warning'\n \n @type {Severity}\n @memberof LintIssue\n */\n severity: Severity;\n\n /**\n Name of the node in the JSON the lint audits\n \n @type {string}\n @memberof LintIssue\n */\n node: string;\n\n /**\n Human-friendly message to users\n \n @type {string}\n @memberof LintIssue\n */\n lintMessage: string;\n\n /**\n Creates an instance of LintIssue.\n @param lintId Unique, lowercase, hyphen-separate name for the lint\n @param severity 'error' or 'warning'\n @param node Name of the node in the JSON the lint audits\n @param lintMessage Human-friendly message to users\n @memberof LintIssue\n */\n constructor(lintId: string, severity: Severity, node: string, lintMessage: string) {\n this.lintId = lintId;\n this.severity = severity;\n this.node = node;\n this.lintMessage = lintMessage;\n }\n\n /**\n Helper to convert the LintIssue to a printable string\n \n @returns {string} Human-friendly message about the lint issue\n */\n toString(): string {\n const formattedSeverity = chalk[this.severity === Severity.Error ? 'bgRedBright' : 'bgYellowBright'](\n this.severity.toUpperCase(),\n );\n const formattedLintId = chalk.cyan.bold(this.lintId);\n const formattedNode = chalk.magenta.bold(this.node);\n const formattedMessage =\n this.severity === Severity.Error ? chalk.red.bold(this.lintMessage) : chalk.yellow(this.lintMessage);\n\n return `${formattedSeverity} ${formattedLintId} - node: ${formattedNode} - ${formattedMessage}`;\n }\n}\n","/**\nPluralizes a word\n\n@param {string} singularWord Word in singular form\n@param {number} count Count to use to determine whether to return the pluralized word\n@returns {string} Pluralized word\n*/\nexport const plur = (singularWord: string, count: number): string =>\n count === 0 || count > 1 ? `${singularWord}s` : singularWord;\n","import chalk from 'chalk';\nimport {plur} from './utils/plur';\nimport {LintIssue} from './lint-issue';\n\nconst zeroIssues = 0;\nconst oneFile = 1;\n\n/**\nPrints issues to console\n\n@param issues An array of LintIssues\n@internal\n*/\nconst printResultSetIssues = (issues: LintIssue[]): void => {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n issues.forEach((issue) => {\n console.log(issue.toString());\n });\n};\n\n/**\nPrint results for an individual package.json file linting\n\n@param resultSet Result object from a given file's lint result\n@param isQuiet True suppress warnings, false show warnings\n@internal\n*/\nconst printIndividualResultSet = (resultSet, isQuiet: boolean): void => {\n const {filePath, issues, ignored, errorCount, warningCount} = resultSet;\n\n if (ignored) {\n console.log('');\n\n console.log(`${chalk.yellow.underline(filePath)} - ignored`);\n } else if (errorCount > zeroIssues || (!isQuiet && warningCount > zeroIssues)) {\n console.log('');\n\n console.log(chalk.underline(filePath));\n\n printResultSetIssues(issues);\n\n const errorCountMessage = `${errorCount} ${plur('error', errorCount)}`;\n const warningCountMessage = `${warningCount} ${plur('warning', warningCount)}`;\n\n console.log(chalk.red.bold(errorCountMessage));\n\n if (!isQuiet) {\n console.log(chalk.yellow.bold(warningCountMessage));\n }\n }\n};\n\n/**\nPrints the overall total counts section\n\n@param linterOutput Full results from linting. Includes an array of results and overall counts\n@param isQuiet True suppress warnings, false show warnings\n@internal\n*/\nconst printTotals = (linterOutput, isQuiet: boolean): void => {\n const {errorCount, warningCount, ignoreCount} = linterOutput;\n\n if (errorCount <= zeroIssues && warningCount <= zeroIssues) {\n return;\n }\n\n const errorCountMessage = `${errorCount} ${plur('error', errorCount)}`;\n const warningCountMessage = `${warningCount} ${plur('warning', warningCount)}`;\n const ignoreCountMessage = `${ignoreCount} ${plur('file', ignoreCount)} ignored`;\n\n console.log('');\n console.log(chalk.underline('Totals'));\n console.log(chalk.red.bold(errorCountMessage));\n\n if (isQuiet) {\n return;\n }\n\n console.log(chalk.yellow.bold(warningCountMessage));\n console.log(chalk.yellow.bold(ignoreCountMessage));\n};\n\n/**\nPrint results to console\n\n@param linterOutput An array of LintIssues\n@param isQuiet Flag indicating whether to print warnings.\n@internal\n*/\nexport const write = (linterOutput, isQuiet: boolean): void => {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n linterOutput.results.forEach((result) => {\n printIndividualResultSet(result, isQuiet);\n });\n\n if (linterOutput.results.length > oneFile) {\n printTotals(linterOutput, isQuiet);\n }\n};\n"],"ignoreList":[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],"mappings":"A,83BAAA,MAAaiD,EAAS,GACSC,EAAK,WAAW,SAEnB,EAAIA,EAAOA,EAAK,WAAW,KAAM,GAAG,ECHnDC,EAAc,GAA4B,CACrD,GAAI,OAAOC,GAAU,WAAYA,EAC/B,MAAO,GAGT,IAAMC,EAAY,OAAO,eAAeD,CAAK,EAI7C,OACGC,IAAc,MAAQA,IAAc,OAAO,WAAa,OAAO,eAAeA,CAAS,IAAM,OAE9F,EAAE,OAAO,eAAeD,IAExB,EAAE,OAAO,YAAYA,EAEzB,E,6BCfA,OAAO,eAAeG,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,EAAQ,WAAa,EAAQ,iBAAmB,EAAQ,YAAc,EAAQ,cAAgB,EAAQ,UAAY,EAAQ,UAAY,EAAQ,WAAa,EAAQ,IAAM,EAAQ,EAAI,EAAQ,IAAM,EAAQ,MAAQ,EAAQ,KAAO,EAAQ,WAAa,EAAQ,YAAc,IAAK,GAElR,IAAMC,EAAN,KAAkB,CAClB,EACA,EAAQ,YAAcA,EACtB,EAAQ,WAAa,wBACrB,IAAMC,EAAN,cAAmBD,CAAY,CAC3B,YAAY,EAAG,CAEX,GADA,MAAM,EACF,CAACD,EAAQ,WAAW,KAAKG,CAAC,EAC1B,MAAU,MAAM,0CAA0C,EAC9D,KAAK,IAAMA,CACf,CACA,UAAW,CACP,OAAO,KAAK,GAChB,CACA,UAAW,CACP,MAAO,EACX,CACA,IAAI,OAAQ,CACR,MAAO,EAAG,K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sqC,CAAQ,CAAC,EAErC2I,GAAqB5G,CAAM,EAE3B,IAAMmH,EAAoB,GAAGH,EAAW,GAAGN,EAAK,QAASM,CAAU,IAC7DI,EAAsB,GAAGF,EAAa,GAAGR,EAAK,UAAWQ,CAAY,IAE3E,QAAQ,IAAIvzC,EAAA,QAAM,IAAI,KAAKwzC,CAAiB,CAAC,EAExCF,GACH,QAAQ,IAAItzC,EAAA,QAAM,OAAO,KAAKyzC,CAAmB,CAAC,CAEtD,CACF,EASMC,IAAe,EAAc,IAA2B,CAC5D,GAAM,CAAC,aAAY,eAAc,eAAef,EAEhD,GAAIU,GAAc,GAAcE,GAAgB,EAC9C,OAGF,IAAMC,EAAoB,GAAGH,EAAW,GAAGN,EAAK,QAASM,CAAU,IAC7DI,EAAsB,GAAGF,EAAa,GAAGR,EAAK,UAAWQ,CAAY,IACrEI,EAAqB,GAAGC,EAAY,GAAGb,EAAK,OAAQa,CAAW,EAAE,UAEvE,QAAQ,IAAI,EAAE,EACd,QAAQ,IAAI5zC,EAAA,QAAM,UAAU,QAAQ,CAAC,EACrC,QAAQ,IAAIA,EAAA,QAAM,IAAI,KAAKwzC,CAAiB,CAAC,EAEzCF,IAIJ,QAAQ,IAAItzC,EAAA,QAAM,OAAO,KAAKyzC,CAAmB,CAAC,EAClD,QAAQ,IAAIzzC,EAAA,QAAM,OAAO,KAAK2zC,CAAkB,CAAC,EACnD,EASaE,IAAS,EAAc,IAA2B,CAE7DlB,EAAa,QAAQ,QAAS,GAAW,CACvCO,GAAyBt8B,EAAQ08B,CAAO,CAC1C,CAAC,EAEGX,EAAa,QAAQ,OAAS,GAChCe,GAAYf,EAAcW,CAAO,CAErC,E"}
1
+ {"version":3,"file":"api.js","names":["Ajv","fs","stripComments","debug","path","debug","path","debug","path","debug","cosmiconfigSync","path","debug","path","debug","path","debug","path","fs","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__commonJSMin","mod","cb","__copyProps","from","keys","i","n","key","to","except","k","desc","__toESM","isNodeMode","target","cosmiconfig","node_path","node_fs","strip_json_comments","minimatch","chalk","globby","ignore","slash","path","isPlainObj","value","prototype","require_code$1","exports","_CodeOrName","Name","s","_Code","code","item","c","names","_","args","strs","addCodeArg","plus","str","expr","safeStringify","optimize","arg","interpolate","res","mergeExprItems","b","a","strConcat","c2","c1","x","stringify","getProperty","getEsmExportName","regexpCode","rx","require_scope","code_1","ValueError","name","UsedValueState","\"Started\"","\"Completed\"","Scope","prefixes","parent","nameOrPrefix","prefix","ng","ValueScopeName","nameStr","property","itemIndex","line","opts","valueKey","vs","_name","keyOrRef","values","scopeName","usedValues","getCode","nameSet","valueCode","def","require_codegen","scope_1","code_2","scope_2","Node","Def","varKind","rhs","es5","_n","optimizeExpr","constants","Assign","lhs","sideEffects","addExprNames","AssignOp","op","Label","label","Break","Throw","error","AnyCode","ParentNode","nodes","subtractNames","addNames","BlockNode","Root","Else","If","condition","cond","e","ns","not","For","ForLoop","iteration","ForRange","ForIter","loop","iterable","Func","async","Return","Try","_a","_b","Catch","Finally","extScope","prefixOrName","constant","_constant","keyValues","thenBody","elseBody","node","forBody","arr","obj","catchCode","finallyCode","tryBody","body","nodeCount","len","toClose","funcBody","N1","N2","replaceName","canOptimize","items","par","andCode","mappend","and","orCode","or","y","require_util","codegen_1","toHash","hash","alwaysValidSchema","schema","checkUnknownRules","it","schemaHasRules","rules","self","checkStrictMode","schemaHasRulesButRef","RULES","schemaRefOrVal","$data","topSchemaRef","schemaPath","keyword","unescapeFragment","unescapeJsonPointer","escapeFragment","escapeJsonPointer","eachItem","xs","f","makeMergeEvaluated","mergeNames","gen","mergeToName","mergeValues","toName","resultToName","setEvaluated","evaluatedPropsToName","ps","props","p","snippets","useFunc","Type","\"Num\"","\"Str\"","getErrorPath","dataProp","isNumber","dataPropType","jsPropertySyntax","mode","msg","require_names","require_errors","util_1","names_1","schemaType","reportError","cxt","errObj","errorObjectCode","errorPaths","overrideAllErrors","compositeRule","allErrors","addError","returnErrors","reportExtraError","resetErrorsCount","errsCount","extendErrors","err","schemaValue","data","schemaEnv","errs","validateName","E","createErrors","errorObject","errorInstancePath","errorSchemaPath","extraErrorProps","instPath","instancePath","errorPath","schPath","parentSchema","errSchemaPath","params","message","propertyName","require_boolSchema","errors_1","boolError","topBoolOrEmptySchema","falseSchemaError","boolOrEmptySchema","valid","require_rules","jsonTypes","isJSONType","getRules","groups","require_applicability","schemaHasRulesForType","group","type","shouldUseGroup","shouldUseRule","rule","kwd","require_dataType","rules_1","applicability_1","DataType","\"Correct\"","\"Wrong\"","getSchemaTypes","types","getJSONTypes","ts","coerceAndCheckDataType","coerceTo","coerceToTypes","checkTypes","wrongType","checkDataTypes","coerceData","reportTypeError","COERCIBLE","coerceTypes","t","dataType","coerced","coerceSpecificType","assignParentData","parentData","parentDataProperty","checkDataType","EQ","correct","numCond","_cond","strictNums","dataTypes","notObj","typeError","getTypeErrorContext","schemaCode","require_defaults","assignDefaults","ty","properties","assignDefault","sch","defaultValue","childData","prop","require_code","util_2","checkReportMissingProp","noPropertyInData","checkMissingProp","missing","reportMissingProp","hasPropFunc","isOwnProperty","propertyInData","ownProperties","allSchemaProperties","schemaMap","schemaProperties","callValidateCode","dataAndSchema","passSchema","valCxt","context","func","newRegExp","usePattern","u","regExp","pattern","validateArray","validArr","validateItems","notValid","validateUnion","schValid","schCxt","require_keyword","macroKeywordCode","macroSchema","schemaRef","useKeyword","funcKeywordCode","checkAsyncKeyword","validateRef","validateKeyword","assignValid","modifyData","reportErrs","ruleErrs","validateAsync","validateSync","addErrs","validateErrs","passCxt","_await","errors","result","validSchemaType","st","allowUndefined","validateKeywordUsage","deps","require_subschema","getSubschema","schemaProp","extendSubschemaData","dpType","dataContextProps","dataPathArr","subschema","_nextData","extendSubschemaMode","jtdDiscriminator","jtdMetadata","require_fast_deep_equal","equal","length","require_json_schema_traverse","traverse","pre","post","_traverse","jsonPtr","rootSchema","parentJsonPtr","parentKeyword","keyIndex","escapeJsonPtr","require_resolve","SIMPLE_INLINED","inlineRef","limit","hasRef","countKeys","REF_KEYWORDS","count","getFullPath","normalize","normalizeId","id","_getFullPath","resolver","TRAILING_SLASH_HASH","resolveUrl","baseId","ANCHOR","getSchemaRefs","schId","schemaId","baseIds","pathPrefix","uriResolver","localRefs","schemaRefs","fullPath","innerBaseId","addRef","addAnchor","_resolve","ref","ambiguos","schOrRef","checkAmbiguosRef","anchor","sch2","sch1","require_validate","boolSchema_1","dataType_1","dataType_2","defaults_1","keyword_1","subschema_1","resolve_1","validateFunctionCode","isSchemaObj","checkKeywords","schemaCxtHasRules","topSchemaObjCode","validateFunction","funcSourceUrl","destructureValCxtES5","destructureValCxt","commentKeyword","checkNoDefault","resetEvaluated","typeAndKeywords","returnResults","subschemaCode","subSchemaObjCode","updateContext","checkAsyncSchema","checkRefsAndKeywords","schemaKeywords","rootName","ValidationError","assignEvaluated","evaluated","keywordCode","checkStrictTypes","groupKeywords","iterateKeywords","typeErrors","useDefaults","checkContextTypes","checkMultipleTypes","checkKeywordTypes","includesType","strictTypesError","narrowSchemaTypes","hasApplicableType","schTs","kwdT","withTypes","KeywordCxt","getData","successAction","failAction","errorParams","append","assign","$dataValid","codeBlock","wrong$DataType","invalid$DataSchema","validateSchemaRef","appl","nextContext","schemaCxt","ruleType","JSON_POINTER","RELATIVE_JSON_POINTER","jsonPointer","matches","up","dataLevel","errorMsg","dataNames","segments","segment","pointerType","require_validation_error","require_ref_error","require_compile","validation_error_1","validate_1","SchemaEnv","env","compileSchema","_sch","getCompilingSchema","rootId","_ValidationError","sourceCode","validateCode","validate","resolveRef","schOrFunc","root","resolve","inlineOrCompile","sameSchemaEnv","schEnv","s1","s2","resolveSchema","refPath","getJsonPointer","PREVENT_SCOPE_CHANGE","parsedRef","part","partSchema","$ref","require_data","\"$id\"","\"description\"","\"type\"","\"required\"","\"properties\"","\"$data\"","\"anyOf\"","\"format\"","\"additionalProperties\"","require_utils","isUUID","isIPv4","isPort","isHexPair","isUnreserved","isPathCharacter","isQueryFragmentCharacter","isUserinfoCharacter","BYTE_HEX","HEX_DIGITS","percentEncodeNonAscii","cp","stringArrayToHexStripped","acc","input","isHextet","isIPvFuture","isZoneCharacter","nonSimpleDomain","isZoneIdentifier","zone","compressIPv6ZeroRun","bestStart","bestLength","runStart","runLength","hextets","head","tail","normalizeIPv6Address","compression","left","right","parts","hextetCount","expanded","normalizeIPv6","bracketed","host","findToken","zoneIdentifier","zoneSeparator","separatorLength","address","ind","token","removeDotSegments","output","nextSlash","removeDotSegmentsRelative","last","trailingDirectory","HOST_DELIMS","HOST_DELIM_RE","HOST_DELIM_NO_COLON_RE","reescapeHostDelimiters","re","isIP","ch","normalizePercentEncoding","hex","normalizedHex","decoded","decodeUnreserved","normalizePathEncoding","isEscapeSafe","low","serializePathEncoding","firstSegment","pathNoScheme","encodeComponent","isAllowed","encodeUserinfo","encodeQuery","encodeFragment","normalizeQueryFragmentEncoding","escapePreservingEscapes","recomposeAuthority","uriTokens","component","ipV6res","port","require_schemes","URN_REG","supportedSchemeNames","isValidSchemeName","wsIsSecure","wsComponent","httpParse","httpSerialize","secure","wsParse","wsSerialize","queryIndex","urnParse","urnComponent","scheme","options","schemeHandler","getSchemeHandler","urnSerialize","nid","uriComponent","nss","urnuuidParse","uuidComponent","urnuuidSerialize","http","https","ws","SCHEMES","require_fast_uri","VALID_SCHEME","MALFORMED_SCHEME_ERROR","MALFORMED_HOST_ERROR","FORBIDDEN_DOMAIN_HOST_CHARACTER","validateScheme","stringScheme","uri","normalizeString","parse","serialize","schemelessOptions","baseParsed","baseMalformed","baseMalformedPercentEncoding","baseMalformedSchemeSpecific","baseMalformedHost","baseMalformedScheme","parseWithStatus","baseURI","relativeParsed","relativeMalformed","relativeMalformedPercentEncoding","relativeMalformedSchemeSpecific","relativeMalformedHost","relativeMalformedScheme","relativeURI","resolved","resolveComponent","resolvedSchemeHandler","resolvedHost","resolvedHostIsIP","hasForbiddenDomainHost","canonicalizeHost","encodedASCIIHost","skipNormalization","base","relative","baseHasAuthority","normalizedA","normalizeComparableURI","uriA","normalizedB","uriB","cmpts","hasAuthority","schemelessReference","authority","URI_PARSE","AUTHORITY_PREFIX","AUTHORITY_INTRODUCER_REGION","getParseError","parsed","hasMalformedPercentEncoding","percent","isIPLiteral","hasMalformedComponentPercentEncoding","url","isHostOnlyURL","malformedAuthorityOrPort","malformedPercentEncoding","malformedSchemeSpecific","malformedHost","malformedIPLiteral","malformedScheme","authorityMatch","introducerMatch","region","normalizedRegion","parseError","bracketedIPLiteral","hasIPLiteralBracket","ipv6result","normalizeStringWithStatus","normalized","fastUri","require_uri","require_core$1","ref_error_1","compile_1","codegen_2","$dataRefSchema","uri_1","defaultRegExp","flags","META_IGNORE_OPTIONS","EXT_SCOPE_NAMES","removedOptions","deprecatedOptions","requiredOptions","o","_optz","Ajv","getLogger","formatOpt","checkOptions","getMetaSchemaOptions","addInitialFormats","addInitialKeywords","addInitialSchemas","_dataRefSchema","meta","v","schemaKeyRef","_meta","runCompileAsync","loadMetaSchema","_schema","_compileAsync","checkLoaded","loadMissingSchema","missingRef","_loadSchema","loadSchema","_validateSchema","$schema","throwOrLogError","getSchEnv","keyRef","cacheKey","definitions","kwdOrDef","checkKeyword","addRule","keywordMetaschema","definition","format","dataVar","text","separator","metaSchema","keywordsJsonPointers","keywords","seg","schemaOrData","schemas","regex","addSchema","validateSchema","currentOpts","checkOpts","opt","log","optsSchemas","defs","metaOpts","noLogs","logger","KEYWORD_NAME","ruleGroup","addBeforeRule","_rule","before","$dataRef","require_id","require_ref","callRootRef","schOrEnv","callValidate","inlineRefSchema","callRef","getValidate","schName","$async","callAsyncRef","callSyncRef","addEvaluatedFrom","addErrorsFrom","source","schEvaluated","require_core","id_1","ref_1","require_limitNumber","ops","KWDs","require_multipleOf","prec","invalid","require_ucs2length","ucs2length","pos","require_limitLength","ucs2length_1","comp","require_pattern","regExpCode","require_limitProperties","require_required","missingProperty","useLoop","allErrorsMode","exitOnErrorMode","requiredKey","definedProperties","loopAllRequired","loopUntilMissing","require_limitItems","require_equal","require_uniqueItems","equal_1","j","itemTypes","validateUniqueItems","loopN","loopN2","indices","eql","outer","require_const","require_enum","getEql","loopEnum","vSchema","equalCode","require_validation","limitNumber_1","multipleOf_1","limitLength_1","pattern_1","limitProperties_1","required_1","limitItems_1","uniqueItems_1","const_1","enum_1","require_additionalItems","validateAdditionalItems","require_items","validateTuple","checkStrictTuple","schArr","l","fullTuple","extraItems","require_prefixItems","items_1","require_items2020","additionalItems_1","prefixItems","require_contains","max","min","minContains","maxContains","validateItemsWithCount","checkLimits","_valid","block","require_dependencies","property_ies","depsCount","propDeps","schDeps","splitDependencies","validatePropertyDeps","validateSchemaDeps","propertyDeps","schemaDeps","hasProperty","depProp","require_propertyNames","require_additionalProperties","patProps","checkAdditionalProperties","additionalPropertyCode","isAdditional","definedProp","propsSchema","deleteAdditional","applyAdditionalSchema","require_properties","additionalProperties_1","allProps","hasDefault","applyPropertySchema","require_patternProperties","patterns","alwaysValidPatterns","checkProperties","validatePatternProperties","pat","checkMatchingProperties","validateProperties","alwaysValid","require_not","require_anyOf","require_oneOf","passing","validateOneOf","require_allOf","require_if","hasThen","hasSchema","hasElse","validateIf","ifClause","validateClause","require_thenElse","require_applicator","prefixItems_1","items2020_1","contains_1","dependencies_1","propertyNames_1","properties_1","patternProperties_1","not_1","anyOf_1","oneOf_1","allOf_1","if_1","thenElse_1","getApplicator","applicator","draft2020","require_format$1","validate$DataFormat","validateFormat","fmts","fDef","fType","unknownFmt","invalidFmt","callFormat","validData","formatDef","unknownFormat","fmtType","fmtRef","getFormat","validCondition","unknownMsg","fmtDef","fmt","require_format","require_metadata","require_draft7","core_1","validation_1","applicator_1","format_1","metadata_1","require_types","DiscrError","\"Tag\"","\"Mapping\"","require_discriminator","types_1","discrError","tagName","tag","oneOf","validateMapping","mapping","getMapping","tagValue","applyTagSchema","oneOfMapping","topRequired","hasRequired","tagRequired","propSch","addMappings","required","addMapping","require_json_schema_draft_07","\"$schema\"","\"title\"","\"definitions\"","\"schemaArray\"","\"minItems\"","\"items\"","\"$ref\"","\"nonNegativeInteger\"","\"minimum\"","\"nonNegativeIntegerDefault0\"","\"allOf\"","\"default\"","\"simpleTypes\"","\"enum\"","\"stringArray\"","\"uniqueItems\"","\"$comment\"","\"readOnly\"","\"examples\"","\"multipleOf\"","\"exclusiveMinimum\"","\"maximum\"","\"exclusiveMaximum\"","\"maxLength\"","\"minLength\"","\"pattern\"","\"additionalItems\"","\"maxItems\"","\"contains\"","\"maxProperties\"","\"minProperties\"","\"patternProperties\"","\"propertyNames\"","\"dependencies\"","\"const\"","\"contentMediaType\"","\"contentEncoding\"","\"if\"","\"then\"","\"else\"","\"oneOf\"","\"not\"","require_ajv","draft7_1","discriminator_1","draft7MetaSchema","META_SUPPORT_DATA","META_SCHEMA_ID","require_dist","ajv_1","used","KEYWORD_PROPERTY_PARAMS","INTERPOLATION","INTERPOLATION_REPLACE","EMPTY_STR","errorMessage","kwdPropErrors","kwdErrors","keywordErrorsConfig","processKeywordErrors","processKeywordPropErrors","processChildErrors","childErrorsConfig","schMessage","processAllErrors","removeUsedErrors","propErrors","emSchema","kwdSch","errMap","kwdErrs","templates","getTemplatesCode","matchKeywordError","singleError","paramsErrors","loopErrors","errMessage","templatesCode","kwdPropParams","propParam","keyProp","tmpl","childErrors","isObj","isArr","childErrs","childKwd","childProp","init","ifMatchesChildError","child","children","msgs","matchAnyError","templateExpr","childRegex","templateFunc","ptr","ajvErrors","ajv","import_ajv","import_dist","getAjv","ajvInstance","formatSchemaErrors","standardRuleSchema","arrayRuleSchema","objectRuleSchema","optionalObjExceptionsSchema","isStandardRuleSchemaValid","ruleConfig","isArrayRuleSchemaValid","minItems","isObjectRuleSchemaValid","isOptionalObjExceptSchemaValid","isObjectRuleConfigValid","isOptionalObjRuleConfigValid","isArrayRuleConfigValid","isStandardRuleConfigValid","validateRule","ruleModule","userConfig","error_","modifiedErrorMessage","ruleName","validateRules","rulesConfig","requireFile","fileName","readFile","handleError","sourceSymbol","parseJsonFile","json","fileContents","parseJavaScriptFile","defaultConfig","\"rules\"","debug$7","virtualConfigs","applyExtends","config","extendsConfig","loadFromModule","moduleName","originalFilePath","mergedConfig","previousConfig","extendsConfigPlugins","previousConfigPlugins","plugins","uniquePlugins","extendsConfigOverrides","previousConfigOverrides","overrides","parentName","adjustedModuleName","loadConfigFile","resolvedModule","filePath","applyExtendsIfSpecified","npmPackageJsonLintConfig","filepath","debug$6","applyOverrides","finalRules","relativeFilePath","cwd","transformedPatterns","override","debug$5","transform","configBaseDirectory","cosmiconfigResult","configAfterExtends","filePathBeingLinted","debug$4","Config","configFile","filePathToSearch","configBeforeOverrides","Rules","rulesDirectory","ruleId","filePathToRuleModule","Severity","\"Error\"","\"Warning\"","\"Off\"","aggregateCountsPerFile","issues","isErrorSeverity","issue","counts","aggregateOverallCounts","results","debug$3","createResultObject","lint","lintIssues","configObj","severity","lintResult","packageJsonData","processPackageJsonObject","packageJsonObj","processPackageJsonFile","executeOnPackageJsonObject","resolvedFilename","filename","ignorer","configHelper","packageJsonObject","stats","executeOnPackageJsonFiles","fileList","debug$2","GLOB_CHARS","splitGlobBase","firstGlobIndex","baseSegments","restSegments","isOutsideCwd","globOutsideCwd","rest","getFileList","filteredPatterns","globPatterns","insidePatterns","outsidePatterns","globFiles","files","globFile","debug$1","getIgnorer","ignoreFilePath","ignorePath","absoluteIgnoreFilePath","ignoreText","readError","require_package","\"name\"","\"version\"","\"keywords\"","\"homepage\"","\"bugs\"","\"url\"","\"author\"","\"repository\"","\"bin\"","\"npmPkgJsonLint\"","\"files\"","\"main\"","\"types\"","\"scripts\"","\"build\"","\"eslint\"","\"npmpackagejsonlint\"","\"lint\"","\"test\"","\"chalk\"","\"cosmiconfig\"","\"debug\"","\"globby\"","\"ignore\"","\"meow\"","\"minimatch\"","\"semver\"","\"devDependencies\"","\"ajv\"","\"globals\"","\"jest\"","\"prettier\"","\"tsdown\"","\"typescript\"","\"engines\"","\"node\"","\"npm\"","\"license\"","debug","pkg","isIssueAnError","isPackageJsonObjectValid","isRequiredOptionsValid","getErrorResults","filtered","filteredIssues","filteredResult","NpmPackageJsonLint","packageJsonFilePath","quiet","fix","linterOutput","LintIssue","lintId","lintMessage","plur","singularWord","printResultSetIssues","printIndividualResultSet","resultSet","ignored","errorCount","isQuiet","warningCount","errorCountMessage","warningCountMessage","printTotals","ignoreCountMessage","ignoreCount","write"],"sources":["../src/utils/slash.ts","../src/utils/isPlainObj.ts","../node_modules/ajv/dist/compile/codegen/code.js","../node_modules/ajv/dist/compile/codegen/scope.js","../node_modules/ajv/dist/compile/codegen/index.js","../node_modules/ajv/dist/compile/util.js","../node_modules/ajv/dist/compile/names.js","../node_modules/ajv/dist/compile/errors.js","../node_modules/ajv/dist/compile/validate/boolSchema.js","../node_modules/ajv/dist/compile/rules.js","../node_modules/ajv/dist/compile/validate/applicability.js","../node_modules/ajv/dist/compile/validate/dataType.js","../node_modules/ajv/dist/compile/validate/defaults.js","../node_modules/ajv/dist/vocabularies/code.js","../node_modules/ajv/dist/compile/validate/keyword.js","../node_modules/ajv/dist/compile/validate/subschema.js","../node_modules/fast-deep-equal/index.js","../node_modules/json-schema-traverse/index.js","../node_modules/ajv/dist/compile/resolve.js","../node_modules/ajv/dist/compile/validate/index.js","../node_modules/ajv/dist/runtime/validation_error.js","../node_modules/ajv/dist/compile/ref_error.js","../node_modules/ajv/dist/compile/index.js","../node_modules/ajv/dist/refs/data.json","../node_modules/fast-uri/lib/utils.js","../node_modules/fast-uri/lib/schemes.js","../node_modules/fast-uri/index.js","../node_modules/ajv/dist/runtime/uri.js","../node_modules/ajv/dist/core.js","../node_modules/ajv/dist/vocabularies/core/id.js","../node_modules/ajv/dist/vocabularies/core/ref.js","../node_modules/ajv/dist/vocabularies/core/index.js","../node_modules/ajv/dist/vocabularies/validation/limitNumber.js","../node_modules/ajv/dist/vocabularies/validation/multipleOf.js","../node_modules/ajv/dist/runtime/ucs2length.js","../node_modules/ajv/dist/vocabularies/validation/limitLength.js","../node_modules/ajv/dist/vocabularies/validation/pattern.js","../node_modules/ajv/dist/vocabularies/validation/limitProperties.js","../node_modules/ajv/dist/vocabularies/validation/required.js","../node_modules/ajv/dist/vocabularies/validation/limitItems.js","../node_modules/ajv/dist/runtime/equal.js","../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js","../node_modules/ajv/dist/vocabularies/validation/const.js","../node_modules/ajv/dist/vocabularies/validation/enum.js","../node_modules/ajv/dist/vocabularies/validation/index.js","../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js","../node_modules/ajv/dist/vocabularies/applicator/items.js","../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js","../node_modules/ajv/dist/vocabularies/applicator/items2020.js","../node_modules/ajv/dist/vocabularies/applicator/contains.js","../node_modules/ajv/dist/vocabularies/applicator/dependencies.js","../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js","../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js","../node_modules/ajv/dist/vocabularies/applicator/properties.js","../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js","../node_modules/ajv/dist/vocabularies/applicator/not.js","../node_modules/ajv/dist/vocabularies/applicator/anyOf.js","../node_modules/ajv/dist/vocabularies/applicator/oneOf.js","../node_modules/ajv/dist/vocabularies/applicator/allOf.js","../node_modules/ajv/dist/vocabularies/applicator/if.js","../node_modules/ajv/dist/vocabularies/applicator/thenElse.js","../node_modules/ajv/dist/vocabularies/applicator/index.js","../node_modules/ajv/dist/vocabularies/format/format.js","../node_modules/ajv/dist/vocabularies/format/index.js","../node_modules/ajv/dist/vocabularies/metadata.js","../node_modules/ajv/dist/vocabularies/draft7.js","../node_modules/ajv/dist/vocabularies/discriminator/types.js","../node_modules/ajv/dist/vocabularies/discriminator/index.js","../node_modules/ajv/dist/refs/json-schema-draft-07.json","../node_modules/ajv/dist/ajv.js","../node_modules/ajv-errors/dist/index.js","../src/config/ConfigSchema.ts","../src/config/ConfigValidator.ts","../src/file-parser.ts","../src/config/default-rules.json","../src/config/default.ts","../src/config/applyExtendsIfSpecified.ts","../src/config/applyOverrides.ts","../src/config/cosmicConfigTransformer.ts","../src/configuration.ts","../src/native-rules.ts","../src/types/severity.ts","../src/linter/results-helper.ts","../src/linter/linter.ts","../src/utils/getFileList.ts","../src/utils/getIgnorer.ts","../package.json","../src/npm-package-json-lint.ts","../src/lint-issue.ts","../src/utils/plur.ts","../src/console-reporter.ts"],"sourcesContent":["export const slash = (path: string): string => {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n return isExtendedLengthPath ? path : path.replaceAll('\\\\', '/');\n};\n","export const isPlainObj = (value: unknown): boolean => {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n // These `in` checks must traverse the prototype chain (e.g. to detect Map/Set), so Object.hasOwn()\n // (own-properties-only) would be a behavior regression here.\n return (\n (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) &&\n // eslint-disable-next-line unicorn/no-computed-property-existence-check\n !(Symbol.toStringTag in value) &&\n // eslint-disable-next-line unicorn/no-computed-property-existence-check\n !(Symbol.iterator in value)\n );\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nclass _CodeOrName {\n}\nexports._CodeOrName = _CodeOrName;\nexports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nclass Name extends _CodeOrName {\n constructor(s) {\n super();\n if (!exports.IDENTIFIER.test(s))\n throw new Error(\"CodeGen: name must be a valid identifier\");\n this.str = s;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n return false;\n }\n get names() {\n return { [this.str]: 1 };\n }\n}\nexports.Name = Name;\nclass _Code extends _CodeOrName {\n constructor(code) {\n super();\n this._items = typeof code === \"string\" ? [code] : code;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n if (this._items.length > 1)\n return false;\n const item = this._items[0];\n return item === \"\" || item === '\"\"';\n }\n get str() {\n var _a;\n return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, \"\")));\n }\n get names() {\n var _a;\n return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {\n if (c instanceof Name)\n names[c.str] = (names[c.str] || 0) + 1;\n return names;\n }, {})));\n }\n}\nexports._Code = _Code;\nexports.nil = new _Code(\"\");\nfunction _(strs, ...args) {\n const code = [strs[0]];\n let i = 0;\n while (i < args.length) {\n addCodeArg(code, args[i]);\n code.push(strs[++i]);\n }\n return new _Code(code);\n}\nexports._ = _;\nconst plus = new _Code(\"+\");\nfunction str(strs, ...args) {\n const expr = [safeStringify(strs[0])];\n let i = 0;\n while (i < args.length) {\n expr.push(plus);\n addCodeArg(expr, args[i]);\n expr.push(plus, safeStringify(strs[++i]));\n }\n optimize(expr);\n return new _Code(expr);\n}\nexports.str = str;\nfunction addCodeArg(code, arg) {\n if (arg instanceof _Code)\n code.push(...arg._items);\n else if (arg instanceof Name)\n code.push(arg);\n else\n code.push(interpolate(arg));\n}\nexports.addCodeArg = addCodeArg;\nfunction optimize(expr) {\n let i = 1;\n while (i < expr.length - 1) {\n if (expr[i] === plus) {\n const res = mergeExprItems(expr[i - 1], expr[i + 1]);\n if (res !== undefined) {\n expr.splice(i - 1, 3, res);\n continue;\n }\n expr[i++] = \"+\";\n }\n i++;\n }\n}\nfunction mergeExprItems(a, b) {\n if (b === '\"\"')\n return a;\n if (a === '\"\"')\n return b;\n if (typeof a == \"string\") {\n if (b instanceof Name || a[a.length - 1] !== '\"')\n return;\n if (typeof b != \"string\")\n return `${a.slice(0, -1)}${b}\"`;\n if (b[0] === '\"')\n return a.slice(0, -1) + b.slice(1);\n return;\n }\n if (typeof b == \"string\" && b[0] === '\"' && !(a instanceof Name))\n return `\"${a}${b.slice(1)}`;\n return;\n}\nfunction strConcat(c1, c2) {\n return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;\n}\nexports.strConcat = strConcat;\n// TODO do not allow arrays here\nfunction interpolate(x) {\n return typeof x == \"number\" || typeof x == \"boolean\" || x === null\n ? x\n : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n}\nfunction stringify(x) {\n return new _Code(safeStringify(x));\n}\nexports.stringify = stringify;\nfunction safeStringify(x) {\n return JSON.stringify(x)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\nexports.safeStringify = safeStringify;\nfunction getProperty(key) {\n return typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;\n}\nexports.getProperty = getProperty;\n//Does best effort to format the name properly\nfunction getEsmExportName(key) {\n if (typeof key == \"string\" && exports.IDENTIFIER.test(key)) {\n return new _Code(`${key}`);\n }\n throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n}\nexports.getEsmExportName = getEsmExportName;\nfunction regexpCode(rx) {\n return new _Code(rx.toString());\n}\nexports.regexpCode = regexpCode;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\nconst code_1 = require(\"./code\");\nclass ValueError extends Error {\n constructor(name) {\n super(`CodeGen: \"code\" for ${name} not defined`);\n this.value = name.value;\n }\n}\nvar UsedValueState;\n(function (UsedValueState) {\n UsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n UsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\nexports.varKinds = {\n const: new code_1.Name(\"const\"),\n let: new code_1.Name(\"let\"),\n var: new code_1.Name(\"var\"),\n};\nclass Scope {\n constructor({ prefixes, parent } = {}) {\n this._names = {};\n this._prefixes = prefixes;\n this._parent = parent;\n }\n toName(nameOrPrefix) {\n return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n }\n name(prefix) {\n return new code_1.Name(this._newName(prefix));\n }\n _newName(prefix) {\n const ng = this._names[prefix] || this._nameGroup(prefix);\n return `${prefix}${ng.index++}`;\n }\n _nameGroup(prefix) {\n var _a, _b;\n if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {\n throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n }\n return (this._names[prefix] = { prefix, index: 0 });\n }\n}\nexports.Scope = Scope;\nclass ValueScopeName extends code_1.Name {\n constructor(prefix, nameStr) {\n super(nameStr);\n this.prefix = prefix;\n }\n setValue(value, { property, itemIndex }) {\n this.value = value;\n this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;\n }\n}\nexports.ValueScopeName = ValueScopeName;\nconst line = (0, code_1._) `\\n`;\nclass ValueScope extends Scope {\n constructor(opts) {\n super(opts);\n this._values = {};\n this._scope = opts.scope;\n this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };\n }\n get() {\n return this._scope;\n }\n name(prefix) {\n return new ValueScopeName(prefix, this._newName(prefix));\n }\n value(nameOrPrefix, value) {\n var _a;\n if (value.ref === undefined)\n throw new Error(\"CodeGen: ref must be passed in value\");\n const name = this.toName(nameOrPrefix);\n const { prefix } = name;\n const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n let vs = this._values[prefix];\n if (vs) {\n const _name = vs.get(valueKey);\n if (_name)\n return _name;\n }\n else {\n vs = this._values[prefix] = new Map();\n }\n vs.set(valueKey, name);\n const s = this._scope[prefix] || (this._scope[prefix] = []);\n const itemIndex = s.length;\n s[itemIndex] = value.ref;\n name.setValue(value, { property: prefix, itemIndex });\n return name;\n }\n getValue(prefix, keyOrRef) {\n const vs = this._values[prefix];\n if (!vs)\n return;\n return vs.get(keyOrRef);\n }\n scopeRefs(scopeName, values = this._values) {\n return this._reduceValues(values, (name) => {\n if (name.scopePath === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return (0, code_1._) `${scopeName}${name.scopePath}`;\n });\n }\n scopeCode(values = this._values, usedValues, getCode) {\n return this._reduceValues(values, (name) => {\n if (name.value === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return name.value.code;\n }, usedValues, getCode);\n }\n _reduceValues(values, valueCode, usedValues = {}, getCode) {\n let code = code_1.nil;\n for (const prefix in values) {\n const vs = values[prefix];\n if (!vs)\n continue;\n const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());\n vs.forEach((name) => {\n if (nameSet.has(name))\n return;\n nameSet.set(name, UsedValueState.Started);\n let c = valueCode(name);\n if (c) {\n const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;\n }\n else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {\n code = (0, code_1._) `${code}${c}${this.opts._n}`;\n }\n else {\n throw new ValueError(name);\n }\n nameSet.set(name, UsedValueState.Completed);\n });\n }\n return code;\n }\n}\nexports.ValueScope = ValueScope;\n//# sourceMappingURL=scope.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\nconst code_1 = require(\"./code\");\nconst scope_1 = require(\"./scope\");\nvar code_2 = require(\"./code\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return code_2._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return code_2.str; } });\nObject.defineProperty(exports, \"strConcat\", { enumerable: true, get: function () { return code_2.strConcat; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return code_2.nil; } });\nObject.defineProperty(exports, \"getProperty\", { enumerable: true, get: function () { return code_2.getProperty; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return code_2.stringify; } });\nObject.defineProperty(exports, \"regexpCode\", { enumerable: true, get: function () { return code_2.regexpCode; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return code_2.Name; } });\nvar scope_2 = require(\"./scope\");\nObject.defineProperty(exports, \"Scope\", { enumerable: true, get: function () { return scope_2.Scope; } });\nObject.defineProperty(exports, \"ValueScope\", { enumerable: true, get: function () { return scope_2.ValueScope; } });\nObject.defineProperty(exports, \"ValueScopeName\", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });\nObject.defineProperty(exports, \"varKinds\", { enumerable: true, get: function () { return scope_2.varKinds; } });\nexports.operators = {\n GT: new code_1._Code(\">\"),\n GTE: new code_1._Code(\">=\"),\n LT: new code_1._Code(\"<\"),\n LTE: new code_1._Code(\"<=\"),\n EQ: new code_1._Code(\"===\"),\n NEQ: new code_1._Code(\"!==\"),\n NOT: new code_1._Code(\"!\"),\n OR: new code_1._Code(\"||\"),\n AND: new code_1._Code(\"&&\"),\n ADD: new code_1._Code(\"+\"),\n};\nclass Node {\n optimizeNodes() {\n return this;\n }\n optimizeNames(_names, _constants) {\n return this;\n }\n}\nclass Def extends Node {\n constructor(varKind, name, rhs) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.rhs = rhs;\n }\n render({ es5, _n }) {\n const varKind = es5 ? scope_1.varKinds.var : this.varKind;\n const rhs = this.rhs === undefined ? \"\" : ` = ${this.rhs}`;\n return `${varKind} ${this.name}${rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (!names[this.name.str])\n return;\n if (this.rhs)\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n }\n}\nclass Assign extends Node {\n constructor(lhs, rhs, sideEffects) {\n super();\n this.lhs = lhs;\n this.rhs = rhs;\n this.sideEffects = sideEffects;\n }\n render({ _n }) {\n return `${this.lhs} = ${this.rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)\n return;\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };\n return addExprNames(names, this.rhs);\n }\n}\nclass AssignOp extends Assign {\n constructor(lhs, op, rhs, sideEffects) {\n super(lhs, rhs, sideEffects);\n this.op = op;\n }\n render({ _n }) {\n return `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n }\n}\nclass Label extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n return `${this.label}:` + _n;\n }\n}\nclass Break extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n const label = this.label ? ` ${this.label}` : \"\";\n return `break${label};` + _n;\n }\n}\nclass Throw extends Node {\n constructor(error) {\n super();\n this.error = error;\n }\n render({ _n }) {\n return `throw ${this.error};` + _n;\n }\n get names() {\n return this.error.names;\n }\n}\nclass AnyCode extends Node {\n constructor(code) {\n super();\n this.code = code;\n }\n render({ _n }) {\n return `${this.code};` + _n;\n }\n optimizeNodes() {\n return `${this.code}` ? this : undefined;\n }\n optimizeNames(names, constants) {\n this.code = optimizeExpr(this.code, names, constants);\n return this;\n }\n get names() {\n return this.code instanceof code_1._CodeOrName ? this.code.names : {};\n }\n}\nclass ParentNode extends Node {\n constructor(nodes = []) {\n super();\n this.nodes = nodes;\n }\n render(opts) {\n return this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n }\n optimizeNodes() {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n const n = nodes[i].optimizeNodes();\n if (Array.isArray(n))\n nodes.splice(i, 1, ...n);\n else if (n)\n nodes[i] = n;\n else\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n optimizeNames(names, constants) {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n // iterating backwards improves 1-pass optimization\n const n = nodes[i];\n if (n.optimizeNames(names, constants))\n continue;\n subtractNames(names, n.names);\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n get names() {\n return this.nodes.reduce((names, n) => addNames(names, n.names), {});\n }\n}\nclass BlockNode extends ParentNode {\n render(opts) {\n return \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n }\n}\nclass Root extends ParentNode {\n}\nclass Else extends BlockNode {\n}\nElse.kind = \"else\";\nclass If extends BlockNode {\n constructor(condition, nodes) {\n super(nodes);\n this.condition = condition;\n }\n render(opts) {\n let code = `if(${this.condition})` + super.render(opts);\n if (this.else)\n code += \"else \" + this.else.render(opts);\n return code;\n }\n optimizeNodes() {\n super.optimizeNodes();\n const cond = this.condition;\n if (cond === true)\n return this.nodes; // else is ignored here\n let e = this.else;\n if (e) {\n const ns = e.optimizeNodes();\n e = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n }\n if (e) {\n if (cond === false)\n return e instanceof If ? e : e.nodes;\n if (this.nodes.length)\n return this;\n return new If(not(cond), e instanceof If ? [e] : e.nodes);\n }\n if (cond === false || !this.nodes.length)\n return undefined;\n return this;\n }\n optimizeNames(names, constants) {\n var _a;\n this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n if (!(super.optimizeNames(names, constants) || this.else))\n return;\n this.condition = optimizeExpr(this.condition, names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n addExprNames(names, this.condition);\n if (this.else)\n addNames(names, this.else.names);\n return names;\n }\n}\nIf.kind = \"if\";\nclass For extends BlockNode {\n}\nFor.kind = \"for\";\nclass ForLoop extends For {\n constructor(iteration) {\n super();\n this.iteration = iteration;\n }\n render(opts) {\n return `for(${this.iteration})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iteration = optimizeExpr(this.iteration, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iteration.names);\n }\n}\nclass ForRange extends For {\n constructor(varKind, name, from, to) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.from = from;\n this.to = to;\n }\n render(opts) {\n const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n const { name, from, to } = this;\n return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n }\n get names() {\n const names = addExprNames(super.names, this.from);\n return addExprNames(names, this.to);\n }\n}\nclass ForIter extends For {\n constructor(loop, varKind, name, iterable) {\n super();\n this.loop = loop;\n this.varKind = varKind;\n this.name = name;\n this.iterable = iterable;\n }\n render(opts) {\n return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iterable = optimizeExpr(this.iterable, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iterable.names);\n }\n}\nclass Func extends BlockNode {\n constructor(name, args, async) {\n super();\n this.name = name;\n this.args = args;\n this.async = async;\n }\n render(opts) {\n const _async = this.async ? \"async \" : \"\";\n return `${_async}function ${this.name}(${this.args})` + super.render(opts);\n }\n}\nFunc.kind = \"func\";\nclass Return extends ParentNode {\n render(opts) {\n return \"return \" + super.render(opts);\n }\n}\nReturn.kind = \"return\";\nclass Try extends BlockNode {\n render(opts) {\n let code = \"try\" + super.render(opts);\n if (this.catch)\n code += this.catch.render(opts);\n if (this.finally)\n code += this.finally.render(opts);\n return code;\n }\n optimizeNodes() {\n var _a, _b;\n super.optimizeNodes();\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();\n return this;\n }\n optimizeNames(names, constants) {\n var _a, _b;\n super.optimizeNames(names, constants);\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n if (this.catch)\n addNames(names, this.catch.names);\n if (this.finally)\n addNames(names, this.finally.names);\n return names;\n }\n}\nclass Catch extends BlockNode {\n constructor(error) {\n super();\n this.error = error;\n }\n render(opts) {\n return `catch(${this.error})` + super.render(opts);\n }\n}\nCatch.kind = \"catch\";\nclass Finally extends BlockNode {\n render(opts) {\n return \"finally\" + super.render(opts);\n }\n}\nFinally.kind = \"finally\";\nclass CodeGen {\n constructor(extScope, opts = {}) {\n this._values = {};\n this._blockStarts = [];\n this._constants = {};\n this.opts = { ...opts, _n: opts.lines ? \"\\n\" : \"\" };\n this._extScope = extScope;\n this._scope = new scope_1.Scope({ parent: extScope });\n this._nodes = [new Root()];\n }\n toString() {\n return this._root.render(this.opts);\n }\n // returns unique name in the internal scope\n name(prefix) {\n return this._scope.name(prefix);\n }\n // reserves unique name in the external scope\n scopeName(prefix) {\n return this._extScope.name(prefix);\n }\n // reserves unique name in the external scope and assigns value to it\n scopeValue(prefixOrName, value) {\n const name = this._extScope.value(prefixOrName, value);\n const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());\n vs.add(name);\n return name;\n }\n getScopeValue(prefix, keyOrRef) {\n return this._extScope.getValue(prefix, keyOrRef);\n }\n // return code that assigns values in the external scope to the names that are used internally\n // (same names that were returned by gen.scopeName or gen.scopeValue)\n scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }\n scopeCode() {\n return this._extScope.scopeCode(this._values);\n }\n _def(varKind, nameOrPrefix, rhs, constant) {\n const name = this._scope.toName(nameOrPrefix);\n if (rhs !== undefined && constant)\n this._constants[name.str] = rhs;\n this._leafNode(new Def(varKind, name, rhs));\n return name;\n }\n // `const` declaration (`var` in es5 mode)\n const(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n }\n // `let` declaration with optional assignment (`var` in es5 mode)\n let(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n }\n // `var` declaration with optional assignment\n var(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n }\n // assignment code\n assign(lhs, rhs, sideEffects) {\n return this._leafNode(new Assign(lhs, rhs, sideEffects));\n }\n // `+=` code\n add(lhs, rhs) {\n return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n }\n // appends passed SafeExpr to code or executes Block\n code(c) {\n if (typeof c == \"function\")\n c();\n else if (c !== code_1.nil)\n this._leafNode(new AnyCode(c));\n return this;\n }\n // returns code for object literal for the passed argument list of key-value pairs\n object(...keyValues) {\n const code = [\"{\"];\n for (const [key, value] of keyValues) {\n if (code.length > 1)\n code.push(\",\");\n code.push(key);\n if (key !== value || this.opts.es5) {\n code.push(\":\");\n (0, code_1.addCodeArg)(code, value);\n }\n }\n code.push(\"}\");\n return new code_1._Code(code);\n }\n // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)\n if(condition, thenBody, elseBody) {\n this._blockNode(new If(condition));\n if (thenBody && elseBody) {\n this.code(thenBody).else().code(elseBody).endIf();\n }\n else if (thenBody) {\n this.code(thenBody).endIf();\n }\n else if (elseBody) {\n throw new Error('CodeGen: \"else\" body without \"then\" body');\n }\n return this;\n }\n // `else if` clause - invalid without `if` or after `else` clauses\n elseIf(condition) {\n return this._elseNode(new If(condition));\n }\n // `else` clause - only valid after `if` or `else if` clauses\n else() {\n return this._elseNode(new Else());\n }\n // end `if` statement (needed if gen.if was used only with condition)\n endIf() {\n return this._endBlockNode(If, Else);\n }\n _for(node, forBody) {\n this._blockNode(node);\n if (forBody)\n this.code(forBody).endFor();\n return this;\n }\n // a generic `for` clause (or statement if `forBody` is passed)\n for(iteration, forBody) {\n return this._for(new ForLoop(iteration), forBody);\n }\n // `for` statement for a range of values\n forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }\n // `for-of` statement (in es5 mode replace with a normal for loop)\n forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n const name = this._scope.toName(nameOrPrefix);\n if (this.opts.es5) {\n const arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n return this.forRange(\"_i\", 0, (0, code_1._) `${arr}.length`, (i) => {\n this.var(name, (0, code_1._) `${arr}[${i}]`);\n forBody(name);\n });\n }\n return this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n }\n // `for-in` statement.\n // With option `ownProperties` replaced with a `for-of` loop for object keys\n forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n if (this.opts.ownProperties) {\n return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);\n }\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n }\n // end `for` loop\n endFor() {\n return this._endBlockNode(For);\n }\n // `label` statement\n label(label) {\n return this._leafNode(new Label(label));\n }\n // `break` statement\n break(label) {\n return this._leafNode(new Break(label));\n }\n // `return` statement\n return(value) {\n const node = new Return();\n this._blockNode(node);\n this.code(value);\n if (node.nodes.length !== 1)\n throw new Error('CodeGen: \"return\" should have one node');\n return this._endBlockNode(Return);\n }\n // `try` statement\n try(tryBody, catchCode, finallyCode) {\n if (!catchCode && !finallyCode)\n throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');\n const node = new Try();\n this._blockNode(node);\n this.code(tryBody);\n if (catchCode) {\n const error = this.name(\"e\");\n this._currNode = node.catch = new Catch(error);\n catchCode(error);\n }\n if (finallyCode) {\n this._currNode = node.finally = new Finally();\n this.code(finallyCode);\n }\n return this._endBlockNode(Catch, Finally);\n }\n // `throw` statement\n throw(error) {\n return this._leafNode(new Throw(error));\n }\n // start self-balancing block\n block(body, nodeCount) {\n this._blockStarts.push(this._nodes.length);\n if (body)\n this.code(body).endBlock(nodeCount);\n return this;\n }\n // end the current self-balancing block\n endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }\n // `function` heading (or definition if funcBody is passed)\n func(name, args = code_1.nil, async, funcBody) {\n this._blockNode(new Func(name, args, async));\n if (funcBody)\n this.code(funcBody).endFunc();\n return this;\n }\n // end function definition\n endFunc() {\n return this._endBlockNode(Func);\n }\n optimize(n = 1) {\n while (n-- > 0) {\n this._root.optimizeNodes();\n this._root.optimizeNames(this._root.names, this._constants);\n }\n }\n _leafNode(node) {\n this._currNode.nodes.push(node);\n return this;\n }\n _blockNode(node) {\n this._currNode.nodes.push(node);\n this._nodes.push(node);\n }\n _endBlockNode(N1, N2) {\n const n = this._currNode;\n if (n instanceof N1 || (N2 && n instanceof N2)) {\n this._nodes.pop();\n return this;\n }\n throw new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n }\n _elseNode(node) {\n const n = this._currNode;\n if (!(n instanceof If)) {\n throw new Error('CodeGen: \"else\" without \"if\"');\n }\n this._currNode = n.else = node;\n return this;\n }\n get _root() {\n return this._nodes[0];\n }\n get _currNode() {\n const ns = this._nodes;\n return ns[ns.length - 1];\n }\n set _currNode(node) {\n const ns = this._nodes;\n ns[ns.length - 1] = node;\n }\n}\nexports.CodeGen = CodeGen;\nfunction addNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) + (from[n] || 0);\n return names;\n}\nfunction addExprNames(names, from) {\n return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n}\nfunction optimizeExpr(expr, names, constants) {\n if (expr instanceof code_1.Name)\n return replaceName(expr);\n if (!canOptimize(expr))\n return expr;\n return new code_1._Code(expr._items.reduce((items, c) => {\n if (c instanceof code_1.Name)\n c = replaceName(c);\n if (c instanceof code_1._Code)\n items.push(...c._items);\n else\n items.push(c);\n return items;\n }, []));\n function replaceName(n) {\n const c = constants[n.str];\n if (c === undefined || names[n.str] !== 1)\n return n;\n delete names[n.str];\n return c;\n }\n function canOptimize(e) {\n return (e instanceof code_1._Code &&\n e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));\n }\n}\nfunction subtractNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) - (from[n] || 0);\n}\nfunction not(x) {\n return typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._) `!${par(x)}`;\n}\nexports.not = not;\nconst andCode = mappend(exports.operators.AND);\n// boolean AND (&&) expression with the passed arguments\nfunction and(...args) {\n return args.reduce(andCode);\n}\nexports.and = and;\nconst orCode = mappend(exports.operators.OR);\n// boolean OR (||) expression with the passed arguments\nfunction or(...args) {\n return args.reduce(orCode);\n}\nexports.or = or;\nfunction mappend(op) {\n return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);\n}\nfunction par(x) {\n return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst code_1 = require(\"./codegen/code\");\n// TODO refactor to use Set\nfunction toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}\nexports.toHash = toHash;\nfunction alwaysValidSchema(it, schema) {\n if (typeof schema == \"boolean\")\n return schema;\n if (Object.keys(schema).length === 0)\n return true;\n checkUnknownRules(it, schema);\n return !schemaHasRules(schema, it.self.RULES.all);\n}\nexports.alwaysValidSchema = alwaysValidSchema;\nfunction checkUnknownRules(it, schema = it.schema) {\n const { opts, self } = it;\n if (!opts.strictSchema)\n return;\n if (typeof schema === \"boolean\")\n return;\n const rules = self.RULES.keywords;\n for (const key in schema) {\n if (!rules[key])\n checkStrictMode(it, `unknown keyword: \"${key}\"`);\n }\n}\nexports.checkUnknownRules = checkUnknownRules;\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (rules[key])\n return true;\n return false;\n}\nexports.schemaHasRules = schemaHasRules;\nfunction schemaHasRulesButRef(schema, RULES) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (key !== \"$ref\" && RULES.all[key])\n return true;\n return false;\n}\nexports.schemaHasRulesButRef = schemaHasRulesButRef;\nfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n if (!$data) {\n if (typeof schema == \"number\" || typeof schema == \"boolean\")\n return schema;\n if (typeof schema == \"string\")\n return (0, codegen_1._) `${schema}`;\n }\n return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n}\nexports.schemaRefOrVal = schemaRefOrVal;\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\nexports.unescapeFragment = unescapeFragment;\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\nexports.escapeFragment = escapeFragment;\nfunction escapeJsonPointer(str) {\n if (typeof str == \"number\")\n return `${str}`;\n return str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexports.escapeJsonPointer = escapeJsonPointer;\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}\nexports.unescapeJsonPointer = unescapeJsonPointer;\nfunction eachItem(xs, f) {\n if (Array.isArray(xs)) {\n for (const x of xs)\n f(x);\n }\n else {\n f(xs);\n }\n}\nexports.eachItem = eachItem;\nfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {\n return (gen, from, to, toName) => {\n const res = to === undefined\n ? from\n : to instanceof codegen_1.Name\n ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)\n : from instanceof codegen_1.Name\n ? (mergeToName(gen, to, from), from)\n : mergeValues(from, to);\n return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n };\n}\nexports.mergeEvaluated = {\n props: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {\n gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));\n }),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {\n if (from === true) {\n gen.assign(to, true);\n }\n else {\n gen.assign(to, (0, codegen_1._) `${to} || {}`);\n setEvaluated(gen, to, from);\n }\n }),\n mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),\n resultToName: evaluatedPropsToName,\n }),\n items: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),\n mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),\n resultToName: (gen, items) => gen.var(\"items\", items),\n }),\n};\nfunction evaluatedPropsToName(gen, ps) {\n if (ps === true)\n return gen.var(\"props\", true);\n const props = gen.var(\"props\", (0, codegen_1._) `{}`);\n if (ps !== undefined)\n setEvaluated(gen, props, ps);\n return props;\n}\nexports.evaluatedPropsToName = evaluatedPropsToName;\nfunction setEvaluated(gen, props, ps) {\n Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));\n}\nexports.setEvaluated = setEvaluated;\nconst snippets = {};\nfunction useFunc(gen, f) {\n return gen.scopeValue(\"func\", {\n ref: f,\n code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),\n });\n}\nexports.useFunc = useFunc;\nvar Type;\n(function (Type) {\n Type[Type[\"Num\"] = 0] = \"Num\";\n Type[Type[\"Str\"] = 1] = \"Str\";\n})(Type || (exports.Type = Type = {}));\nfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n // let path\n if (dataProp instanceof codegen_1.Name) {\n const isNumber = dataPropType === Type.Num;\n return jsPropertySyntax\n ? isNumber\n ? (0, codegen_1._) `\"[\" + ${dataProp} + \"]\"`\n : (0, codegen_1._) `\"['\" + ${dataProp} + \"']\"`\n : isNumber\n ? (0, codegen_1._) `\"/\" + ${dataProp}`\n : (0, codegen_1._) `\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`; // TODO maybe use global escapePointer\n }\n return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n}\nexports.getErrorPath = getErrorPath;\nfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n if (!mode)\n return;\n msg = `strict mode: ${msg}`;\n if (mode === true)\n throw new Error(msg);\n it.self.logger.warn(msg);\n}\nexports.checkStrictMode = checkStrictMode;\n//# sourceMappingURL=util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"./codegen\");\nconst names = {\n // validation function arguments\n data: new codegen_1.Name(\"data\"), // data passed to validation function\n // args passed from referencing schema\n valCxt: new codegen_1.Name(\"valCxt\"), // validation/data context - should not be used directly, it is destructured to the names below\n instancePath: new codegen_1.Name(\"instancePath\"),\n parentData: new codegen_1.Name(\"parentData\"),\n parentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n rootData: new codegen_1.Name(\"rootData\"), // root data - same as the data passed to the first/top validation function\n dynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"), // used to support recursiveRef and dynamicRef\n // function scoped variables\n vErrors: new codegen_1.Name(\"vErrors\"), // null or array of validation errors\n errors: new codegen_1.Name(\"errors\"), // counter of validation errors\n this: new codegen_1.Name(\"this\"),\n // \"globals\"\n self: new codegen_1.Name(\"self\"),\n scope: new codegen_1.Name(\"scope\"),\n // JTD serialize/parse name for JSON string and position\n json: new codegen_1.Name(\"json\"),\n jsonPos: new codegen_1.Name(\"jsonPos\"),\n jsonLen: new codegen_1.Name(\"jsonLen\"),\n jsonPart: new codegen_1.Name(\"jsonPart\"),\n};\nexports.default = names;\n//# sourceMappingURL=names.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst util_1 = require(\"./util\");\nconst names_1 = require(\"./names\");\nexports.keywordError = {\n message: ({ keyword }) => (0, codegen_1.str) `must pass \"${keyword}\" keyword validation`,\n};\nexports.keyword$DataError = {\n message: ({ keyword, schemaType }) => schemaType\n ? (0, codegen_1.str) `\"${keyword}\" keyword must be ${schemaType} ($data)`\n : (0, codegen_1.str) `\"${keyword}\" keyword is invalid ($data)`,\n};\nfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {\n addError(gen, errObj);\n }\n else {\n returnErrors(it, (0, codegen_1._) `[${errObj}]`);\n }\n}\nexports.reportError = reportError;\nfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n addError(gen, errObj);\n if (!(compositeRule || allErrors)) {\n returnErrors(it, names_1.default.vErrors);\n }\n}\nexports.reportExtraError = reportExtraError;\nfunction resetErrorsCount(gen, errsCount) {\n gen.assign(names_1.default.errors, errsCount);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n}\nexports.resetErrorsCount = resetErrorsCount;\nfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {\n /* istanbul ignore if */\n if (errsCount === undefined)\n throw new Error(\"ajv implementation error\");\n const err = gen.name(\"err\");\n gen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);\n gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);\n if (it.opts.verbose) {\n gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);\n gen.assign((0, codegen_1._) `${err}.data`, data);\n }\n });\n}\nexports.extendErrors = extendErrors;\nfunction addError(gen, errObj) {\n const err = gen.const(\"err\", errObj);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);\n gen.code((0, codegen_1._) `${names_1.default.errors}++`);\n}\nfunction returnErrors(it, errs) {\n const { gen, validateName, schemaEnv } = it;\n if (schemaEnv.$async) {\n gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, errs);\n gen.return(false);\n }\n}\nconst E = {\n keyword: new codegen_1.Name(\"keyword\"),\n schemaPath: new codegen_1.Name(\"schemaPath\"), // also used in JTD errors\n params: new codegen_1.Name(\"params\"),\n propertyName: new codegen_1.Name(\"propertyName\"),\n message: new codegen_1.Name(\"message\"),\n schema: new codegen_1.Name(\"schema\"),\n parentSchema: new codegen_1.Name(\"parentSchema\"),\n};\nfunction errorObjectCode(cxt, error, errorPaths) {\n const { createErrors } = cxt.it;\n if (createErrors === false)\n return (0, codegen_1._) `{}`;\n return errorObject(cxt, error, errorPaths);\n}\nfunction errorObject(cxt, error, errorPaths = {}) {\n const { gen, it } = cxt;\n const keyValues = [\n errorInstancePath(it, errorPaths),\n errorSchemaPath(cxt, errorPaths),\n ];\n extraErrorProps(cxt, error, keyValues);\n return gen.object(...keyValues);\n}\nfunction errorInstancePath({ errorPath }, { instancePath }) {\n const instPath = instancePath\n ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`\n : errorPath;\n return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n}\nfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;\n if (schemaPath) {\n schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n }\n return [E.schemaPath, schPath];\n}\nfunction extraErrorProps(cxt, { params, message }, keyValues) {\n const { keyword, data, schemaValue, it } = cxt;\n const { opts, propertyName, topSchemaRef, schemaPath } = it;\n keyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._) `{}`]);\n if (opts.messages) {\n keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n }\n if (opts.verbose) {\n keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n }\n if (propertyName)\n keyValues.push([E.propertyName, propertyName]);\n}\n//# sourceMappingURL=errors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst boolError = {\n message: \"boolean schema is false\",\n};\nfunction topBoolOrEmptySchema(it) {\n const { gen, schema, validateName } = it;\n if (schema === false) {\n falseSchemaError(it, false);\n }\n else if (typeof schema == \"object\" && schema.$async === true) {\n gen.return(names_1.default.data);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, null);\n gen.return(true);\n }\n}\nexports.topBoolOrEmptySchema = topBoolOrEmptySchema;\nfunction boolOrEmptySchema(it, valid) {\n const { gen, schema } = it;\n if (schema === false) {\n gen.var(valid, false); // TODO var\n falseSchemaError(it);\n }\n else {\n gen.var(valid, true); // TODO var\n }\n}\nexports.boolOrEmptySchema = boolOrEmptySchema;\nfunction falseSchemaError(it, overrideAllErrors) {\n const { gen, data } = it;\n // TODO maybe some other interface should be used for non-keyword validation errors...\n const cxt = {\n gen,\n keyword: \"false schema\",\n data,\n schema: false,\n schemaCode: false,\n schemaValue: false,\n params: {},\n it,\n };\n (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);\n}\n//# sourceMappingURL=boolSchema.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRules = exports.isJSONType = void 0;\nconst _jsonTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"null\", \"object\", \"array\"];\nconst jsonTypes = new Set(_jsonTypes);\nfunction isJSONType(x) {\n return typeof x == \"string\" && jsonTypes.has(x);\n}\nexports.isJSONType = isJSONType;\nfunction getRules() {\n const groups = {\n number: { type: \"number\", rules: [] },\n string: { type: \"string\", rules: [] },\n array: { type: \"array\", rules: [] },\n object: { type: \"object\", rules: [] },\n };\n return {\n types: { ...groups, integer: true, boolean: true, null: true },\n rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],\n post: { rules: [] },\n all: {},\n keywords: {},\n };\n}\nexports.getRules = getRules;\n//# sourceMappingURL=rules.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\nfunction schemaHasRulesForType({ schema, self }, type) {\n const group = self.RULES.types[type];\n return group && group !== true && shouldUseGroup(schema, group);\n}\nexports.schemaHasRulesForType = schemaHasRulesForType;\nfunction shouldUseGroup(schema, group) {\n return group.rules.some((rule) => shouldUseRule(schema, rule));\n}\nexports.shouldUseGroup = shouldUseGroup;\nfunction shouldUseRule(schema, rule) {\n var _a;\n return (schema[rule.keyword] !== undefined ||\n ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));\n}\nexports.shouldUseRule = shouldUseRule;\n//# sourceMappingURL=applicability.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\nconst rules_1 = require(\"../rules\");\nconst applicability_1 = require(\"./applicability\");\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nvar DataType;\n(function (DataType) {\n DataType[DataType[\"Correct\"] = 0] = \"Correct\";\n DataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n})(DataType || (exports.DataType = DataType = {}));\nfunction getSchemaTypes(schema) {\n const types = getJSONTypes(schema.type);\n const hasNull = types.includes(\"null\");\n if (hasNull) {\n if (schema.nullable === false)\n throw new Error(\"type: null contradicts nullable: false\");\n }\n else {\n if (!types.length && schema.nullable !== undefined) {\n throw new Error('\"nullable\" cannot be used without \"type\"');\n }\n if (schema.nullable === true)\n types.push(\"null\");\n }\n return types;\n}\nexports.getSchemaTypes = getSchemaTypes;\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction getJSONTypes(ts) {\n const types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n if (types.every(rules_1.isJSONType))\n return types;\n throw new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n}\nexports.getJSONTypes = getJSONTypes;\nfunction coerceAndCheckDataType(it, types) {\n const { gen, data, opts } = it;\n const coerceTo = coerceToTypes(types, opts.coerceTypes);\n const checkTypes = types.length > 0 &&\n !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n if (checkTypes) {\n const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n gen.if(wrongType, () => {\n if (coerceTo.length)\n coerceData(it, types, coerceTo);\n else\n reportTypeError(it);\n });\n }\n return checkTypes;\n}\nexports.coerceAndCheckDataType = coerceAndCheckDataType;\nconst COERCIBLE = new Set([\"string\", \"number\", \"integer\", \"boolean\", \"null\"]);\nfunction coerceToTypes(types, coerceTypes) {\n return coerceTypes\n ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === \"array\" && t === \"array\"))\n : [];\n}\nfunction coerceData(it, types, coerceTo) {\n const { gen, data, opts } = it;\n const dataType = gen.let(\"dataType\", (0, codegen_1._) `typeof ${data}`);\n const coerced = gen.let(\"coerced\", (0, codegen_1._) `undefined`);\n if (opts.coerceTypes === \"array\") {\n gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen\n .assign(data, (0, codegen_1._) `${data}[0]`)\n .assign(dataType, (0, codegen_1._) `typeof ${data}`)\n .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n }\n gen.if((0, codegen_1._) `${coerced} !== undefined`);\n for (const t of coerceTo) {\n if (COERCIBLE.has(t) || (t === \"array\" && opts.coerceTypes === \"array\")) {\n coerceSpecificType(t);\n }\n }\n gen.else();\n reportTypeError(it);\n gen.endIf();\n gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {\n gen.assign(data, coerced);\n assignParentData(it, coerced);\n });\n function coerceSpecificType(t) {\n switch (t) {\n case \"string\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"number\" || ${dataType} == \"boolean\"`)\n .assign(coerced, (0, codegen_1._) `\"\" + ${data}`)\n .elseIf((0, codegen_1._) `${data} === null`)\n .assign(coerced, (0, codegen_1._) `\"\"`);\n return;\n case \"number\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"integer\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"boolean\":\n gen\n .elseIf((0, codegen_1._) `${data} === \"false\" || ${data} === 0 || ${data} === null`)\n .assign(coerced, false)\n .elseIf((0, codegen_1._) `${data} === \"true\" || ${data} === 1`)\n .assign(coerced, true);\n return;\n case \"null\":\n gen.elseIf((0, codegen_1._) `${data} === \"\" || ${data} === 0 || ${data} === false`);\n gen.assign(coerced, null);\n return;\n case \"array\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`)\n .assign(coerced, (0, codegen_1._) `[${data}]`);\n }\n }\n}\nfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n // TODO use gen.property\n gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));\n}\nfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n let cond;\n switch (dataType) {\n case \"null\":\n return (0, codegen_1._) `${data} ${EQ} null`;\n case \"array\":\n cond = (0, codegen_1._) `Array.isArray(${data})`;\n break;\n case \"object\":\n cond = (0, codegen_1._) `${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n break;\n case \"integer\":\n cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);\n break;\n case \"number\":\n cond = numCond();\n break;\n default:\n return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;\n }\n return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n function numCond(_cond = codegen_1.nil) {\n return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);\n }\n}\nexports.checkDataType = checkDataType;\nfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n if (dataTypes.length === 1) {\n return checkDataType(dataTypes[0], data, strictNums, correct);\n }\n let cond;\n const types = (0, util_1.toHash)(dataTypes);\n if (types.array && types.object) {\n const notObj = (0, codegen_1._) `typeof ${data} != \"object\"`;\n cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;\n delete types.null;\n delete types.array;\n delete types.object;\n }\n else {\n cond = codegen_1.nil;\n }\n if (types.number)\n delete types.integer;\n for (const t in types)\n cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n return cond;\n}\nexports.checkDataTypes = checkDataTypes;\nconst typeError = {\n message: ({ schema }) => `must be ${schema}`,\n params: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,\n};\nfunction reportTypeError(it) {\n const cxt = getTypeErrorContext(it);\n (0, errors_1.reportError)(cxt, typeError);\n}\nexports.reportTypeError = reportTypeError;\nfunction getTypeErrorContext(it) {\n const { gen, data, schema } = it;\n const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n return {\n gen,\n keyword: \"type\",\n data,\n schema: schema.type,\n schemaCode,\n schemaValue: schemaCode,\n parentSchema: schema,\n params: {},\n it,\n };\n}\n//# sourceMappingURL=dataType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assignDefaults = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction assignDefaults(it, ty) {\n const { properties, items } = it.schema;\n if (ty === \"object\" && properties) {\n for (const key in properties) {\n assignDefault(it, key, properties[key].default);\n }\n }\n else if (ty === \"array\" && Array.isArray(items)) {\n items.forEach((sch, i) => assignDefault(it, i, sch.default));\n }\n}\nexports.assignDefaults = assignDefaults;\nfunction assignDefault(it, prop, defaultValue) {\n const { gen, compositeRule, data, opts } = it;\n if (defaultValue === undefined)\n return;\n const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;\n if (compositeRule) {\n (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n return;\n }\n let condition = (0, codegen_1._) `${childData} === undefined`;\n if (opts.useDefaults === \"empty\") {\n condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === \"\"`;\n }\n // `${childData} === undefined` +\n // (opts.useDefaults === \"empty\" ? ` || ${childData} === null || ${childData} === \"\"` : \"\")\n gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n}\n//# sourceMappingURL=defaults.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\nconst codegen_1 = require(\"../compile/codegen\");\nconst util_1 = require(\"../compile/util\");\nconst names_1 = require(\"../compile/names\");\nconst util_2 = require(\"../compile/util\");\nfunction checkReportMissingProp(cxt, prop) {\n const { gen, data, it } = cxt;\n gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);\n cxt.error();\n });\n}\nexports.checkReportMissingProp = checkReportMissingProp;\nfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));\n}\nexports.checkMissingProp = checkMissingProp;\nfunction reportMissingProp(cxt, missing) {\n cxt.setParams({ missingProperty: missing }, true);\n cxt.error();\n}\nexports.reportMissingProp = reportMissingProp;\nfunction hasPropFunc(gen) {\n return gen.scopeValue(\"func\", {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ref: Object.prototype.hasOwnProperty,\n code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,\n });\n}\nexports.hasPropFunc = hasPropFunc;\nfunction isOwnProperty(gen, data, property) {\n return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;\n}\nexports.isOwnProperty = isOwnProperty;\nfunction propertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n}\nexports.propertyInData = propertyInData;\nfunction noPropertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n}\nexports.noPropertyInData = noPropertyInData;\nfunction allSchemaProperties(schemaMap) {\n return schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n}\nexports.allSchemaProperties = allSchemaProperties;\nfunction schemaProperties(it, schemaMap) {\n return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n}\nexports.schemaProperties = schemaProperties;\nfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n const valCxt = [\n [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n [names_1.default.parentData, it.parentData],\n [names_1.default.parentDataProperty, it.parentDataProperty],\n [names_1.default.rootData, names_1.default.rootData],\n ];\n if (it.opts.dynamicRef)\n valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;\n return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;\n}\nexports.callValidateCode = callValidateCode;\nconst newRegExp = (0, codegen_1._) `new RegExp`;\nfunction usePattern({ gen, it: { opts } }, pattern) {\n const u = opts.unicodeRegExp ? \"u\" : \"\";\n const { regExp } = opts.code;\n const rx = regExp(pattern, u);\n return gen.scopeValue(\"pattern\", {\n key: rx.toString(),\n ref: rx,\n code: (0, codegen_1._) `${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,\n });\n}\nexports.usePattern = usePattern;\nfunction validateArray(cxt) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n if (it.allErrors) {\n const validArr = gen.let(\"valid\", true);\n validateItems(() => gen.assign(validArr, false));\n return validArr;\n }\n gen.var(valid, true);\n validateItems(() => gen.break());\n return valid;\n function validateItems(notValid) {\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword,\n dataProp: i,\n dataPropType: util_1.Type.Num,\n }, valid);\n gen.if((0, codegen_1.not)(valid), notValid);\n });\n }\n}\nexports.validateArray = validateArray;\nfunction validateUnion(cxt) {\n const { gen, schema, keyword, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));\n if (alwaysValid && !it.opts.unevaluated)\n return;\n const valid = gen.let(\"valid\", false);\n const schValid = gen.name(\"_valid\");\n gen.block(() => schema.forEach((_sch, i) => {\n const schCxt = cxt.subschema({\n keyword,\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);\n const merged = cxt.mergeValidEvaluated(schCxt, schValid);\n // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)\n // or if all properties and items were evaluated (it.props === true && it.items === true)\n if (!merged)\n gen.if((0, codegen_1.not)(valid));\n }));\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n}\nexports.validateUnion = validateUnion;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst code_1 = require(\"../../vocabularies/code\");\nconst errors_1 = require(\"../errors\");\nfunction macroKeywordCode(cxt, def) {\n const { gen, keyword, schema, parentSchema, it } = cxt;\n const macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n const schemaRef = useKeyword(gen, keyword, macroSchema);\n if (it.opts.validateSchema !== false)\n it.self.validateSchema(macroSchema, true);\n const valid = gen.name(\"valid\");\n cxt.subschema({\n schema: macroSchema,\n schemaPath: codegen_1.nil,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n topSchemaRef: schemaRef,\n compositeRule: true,\n }, valid);\n cxt.pass(valid, () => cxt.error(true));\n}\nexports.macroKeywordCode = macroKeywordCode;\nfunction funcKeywordCode(cxt, def) {\n var _a;\n const { gen, keyword, schema, parentSchema, $data, it } = cxt;\n checkAsyncKeyword(it, def);\n const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;\n const validateRef = useKeyword(gen, keyword, validate);\n const valid = gen.let(\"valid\");\n cxt.block$data(valid, validateKeyword);\n cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n function validateKeyword() {\n if (def.errors === false) {\n assignValid();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => cxt.error());\n }\n else {\n const ruleErrs = def.async ? validateAsync() : validateSync();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => addErrs(cxt, ruleErrs));\n }\n }\n function validateAsync() {\n const ruleErrs = gen.let(\"ruleErrs\", null);\n gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));\n return ruleErrs;\n }\n function validateSync() {\n const validateErrs = (0, codegen_1._) `${validateRef}.errors`;\n gen.assign(validateErrs, null);\n assignValid(codegen_1.nil);\n return validateErrs;\n }\n function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {\n const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n const passSchema = !((\"compile\" in def && !$data) || def.schema === false);\n gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n }\n function reportErrs(errors) {\n var _a;\n gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);\n }\n}\nexports.funcKeywordCode = funcKeywordCode;\nfunction modifyData(cxt) {\n const { gen, data, it } = cxt;\n gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));\n}\nfunction addErrs(cxt, errs) {\n const { gen } = cxt;\n gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {\n gen\n .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)\n .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n (0, errors_1.extendErrors)(cxt);\n }, () => cxt.error());\n}\nfunction checkAsyncKeyword({ schemaEnv }, def) {\n if (def.async && !schemaEnv.$async)\n throw new Error(\"async keyword in sync schema\");\n}\nfunction useKeyword(gen, keyword, result) {\n if (result === undefined)\n throw new Error(`keyword \"${keyword}\" failed to compile`);\n return gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });\n}\nfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n // TODO add tests\n return (!schemaType.length ||\n schemaType.some((st) => st === \"array\"\n ? Array.isArray(schema)\n : st === \"object\"\n ? schema && typeof schema == \"object\" && !Array.isArray(schema)\n : typeof schema == st || (allowUndefined && typeof schema == \"undefined\")));\n}\nexports.validSchemaType = validSchemaType;\nfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n /* istanbul ignore if */\n if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {\n throw new Error(\"ajv implementation error\");\n }\n const deps = def.dependencies;\n if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {\n throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n }\n if (def.validateSchema) {\n const valid = def.validateSchema(schema[keyword]);\n if (!valid) {\n const msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` +\n self.errorsText(def.validateSchema.errors);\n if (opts.validateSchema === \"log\")\n self.logger.error(msg);\n else\n throw new Error(msg);\n }\n }\n}\nexports.validateKeywordUsage = validateKeywordUsage;\n//# sourceMappingURL=keyword.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n if (keyword !== undefined && schema !== undefined) {\n throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');\n }\n if (keyword !== undefined) {\n const sch = it.schema[keyword];\n return schemaProp === undefined\n ? {\n schema: sch,\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n }\n : {\n schema: sch[schemaProp],\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,\n };\n }\n if (schema !== undefined) {\n if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {\n throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');\n }\n return {\n schema,\n schemaPath,\n topSchemaRef,\n errSchemaPath,\n };\n }\n throw new Error('either \"keyword\" or \"schema\" must be passed');\n}\nexports.getSubschema = getSubschema;\nfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n if (data !== undefined && dataProp !== undefined) {\n throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');\n }\n const { gen } = it;\n if (dataProp !== undefined) {\n const { errorPath, dataPathArr, opts } = it;\n const nextData = gen.let(\"data\", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);\n dataContextProps(nextData);\n subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;\n subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n }\n if (data !== undefined) {\n const nextData = data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true); // replaceable if used once?\n dataContextProps(nextData);\n if (propertyName !== undefined)\n subschema.propertyName = propertyName;\n // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr\n }\n if (dataTypes)\n subschema.dataTypes = dataTypes;\n function dataContextProps(_nextData) {\n subschema.data = _nextData;\n subschema.dataLevel = it.dataLevel + 1;\n subschema.dataTypes = [];\n it.definedProperties = new Set();\n subschema.parentData = it.data;\n subschema.dataNames = [...it.dataNames, _nextData];\n }\n}\nexports.extendSubschemaData = extendSubschemaData;\nfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n if (compositeRule !== undefined)\n subschema.compositeRule = compositeRule;\n if (createErrors !== undefined)\n subschema.createErrors = createErrors;\n if (allErrors !== undefined)\n subschema.allErrors = allErrors;\n subschema.jtdDiscriminator = jtdDiscriminator; // not inherited\n subschema.jtdMetadata = jtdMetadata; // not inherited\n}\nexports.extendSubschemaMode = extendSubschemaMode;\n//# sourceMappingURL=subschema.js.map","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\nconst util_1 = require(\"./util\");\nconst equal = require(\"fast-deep-equal\");\nconst traverse = require(\"json-schema-traverse\");\n// TODO refactor to use keyword definitions\nconst SIMPLE_INLINED = new Set([\n \"type\",\n \"format\",\n \"pattern\",\n \"maxLength\",\n \"minLength\",\n \"maxProperties\",\n \"minProperties\",\n \"maxItems\",\n \"minItems\",\n \"maximum\",\n \"minimum\",\n \"uniqueItems\",\n \"multipleOf\",\n \"required\",\n \"enum\",\n \"const\",\n]);\nfunction inlineRef(schema, limit = true) {\n if (typeof schema == \"boolean\")\n return true;\n if (limit === true)\n return !hasRef(schema);\n if (!limit)\n return false;\n return countKeys(schema) <= limit;\n}\nexports.inlineRef = inlineRef;\nconst REF_KEYWORDS = new Set([\n \"$ref\",\n \"$recursiveRef\",\n \"$recursiveAnchor\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n]);\nfunction hasRef(schema) {\n for (const key in schema) {\n if (REF_KEYWORDS.has(key))\n return true;\n const sch = schema[key];\n if (Array.isArray(sch) && sch.some(hasRef))\n return true;\n if (typeof sch == \"object\" && hasRef(sch))\n return true;\n }\n return false;\n}\nfunction countKeys(schema) {\n let count = 0;\n for (const key in schema) {\n if (key === \"$ref\")\n return Infinity;\n count++;\n if (SIMPLE_INLINED.has(key))\n continue;\n if (typeof schema[key] == \"object\") {\n (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));\n }\n if (count === Infinity)\n return Infinity;\n }\n return count;\n}\nfunction getFullPath(resolver, id = \"\", normalize) {\n if (normalize !== false)\n id = normalizeId(id);\n const p = resolver.parse(id);\n return _getFullPath(resolver, p);\n}\nexports.getFullPath = getFullPath;\nfunction _getFullPath(resolver, p) {\n const serialized = resolver.serialize(p);\n return serialized.split(\"#\")[0] + \"#\";\n}\nexports._getFullPath = _getFullPath;\nconst TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n}\nexports.normalizeId = normalizeId;\nfunction resolveUrl(resolver, baseId, id) {\n id = normalizeId(id);\n return resolver.resolve(baseId, id);\n}\nexports.resolveUrl = resolveUrl;\nconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\nfunction getSchemaRefs(schema, baseId) {\n if (typeof schema == \"boolean\")\n return {};\n const { schemaId, uriResolver } = this.opts;\n const schId = normalizeId(schema[schemaId] || baseId);\n const baseIds = { \"\": schId };\n const pathPrefix = getFullPath(uriResolver, schId, false);\n const localRefs = {};\n const schemaRefs = new Set();\n traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n if (parentJsonPtr === undefined)\n return;\n const fullPath = pathPrefix + jsonPtr;\n let innerBaseId = baseIds[parentJsonPtr];\n if (typeof sch[schemaId] == \"string\")\n innerBaseId = addRef.call(this, sch[schemaId]);\n addAnchor.call(this, sch.$anchor);\n addAnchor.call(this, sch.$dynamicAnchor);\n baseIds[jsonPtr] = innerBaseId;\n function addRef(ref) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _resolve = this.opts.uriResolver.resolve;\n ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n if (schemaRefs.has(ref))\n throw ambiguos(ref);\n schemaRefs.add(ref);\n let schOrRef = this.refs[ref];\n if (typeof schOrRef == \"string\")\n schOrRef = this.refs[schOrRef];\n if (typeof schOrRef == \"object\") {\n checkAmbiguosRef(sch, schOrRef.schema, ref);\n }\n else if (ref !== normalizeId(fullPath)) {\n if (ref[0] === \"#\") {\n checkAmbiguosRef(sch, localRefs[ref], ref);\n localRefs[ref] = sch;\n }\n else {\n this.refs[ref] = fullPath;\n }\n }\n return ref;\n }\n function addAnchor(anchor) {\n if (typeof anchor == \"string\") {\n if (!ANCHOR.test(anchor))\n throw new Error(`invalid anchor \"${anchor}\"`);\n addRef.call(this, `#${anchor}`);\n }\n }\n });\n return localRefs;\n function checkAmbiguosRef(sch1, sch2, ref) {\n if (sch2 !== undefined && !equal(sch1, sch2))\n throw ambiguos(ref);\n }\n function ambiguos(ref) {\n return new Error(`reference \"${ref}\" resolves to more than one schema`);\n }\n}\nexports.getSchemaRefs = getSchemaRefs;\n//# sourceMappingURL=resolve.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\nconst boolSchema_1 = require(\"./boolSchema\");\nconst dataType_1 = require(\"./dataType\");\nconst applicability_1 = require(\"./applicability\");\nconst dataType_2 = require(\"./dataType\");\nconst defaults_1 = require(\"./defaults\");\nconst keyword_1 = require(\"./keyword\");\nconst subschema_1 = require(\"./subschema\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst resolve_1 = require(\"../resolve\");\nconst util_1 = require(\"../util\");\nconst errors_1 = require(\"../errors\");\n// schema compilation - generates validation function, subschemaCode (below) is used for subschemas\nfunction validateFunctionCode(it) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n topSchemaObjCode(it);\n return;\n }\n }\n validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n}\nexports.validateFunctionCode = validateFunctionCode;\nfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n if (opts.code.es5) {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n gen.code((0, codegen_1._) `\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n destructureValCxtES5(gen, opts);\n gen.code(body);\n });\n }\n else {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n }\n}\nfunction destructureValCxt(opts) {\n return (0, codegen_1._) `{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n}\nfunction destructureValCxtES5(gen, opts) {\n gen.if(names_1.default.valCxt, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n }, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `\"\"`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.rootData, names_1.default.data);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);\n });\n}\nfunction topSchemaObjCode(it) {\n const { schema, opts, gen } = it;\n validateFunction(it, () => {\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n checkNoDefault(it);\n gen.let(names_1.default.vErrors, null);\n gen.let(names_1.default.errors, 0);\n if (opts.unevaluated)\n resetEvaluated(it);\n typeAndKeywords(it);\n returnResults(it);\n });\n return;\n}\nfunction resetEvaluated(it) {\n // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated\n const { gen, validateName } = it;\n it.evaluated = gen.const(\"evaluated\", (0, codegen_1._) `${validateName}.evaluated`);\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));\n}\nfunction funcSourceUrl(schema, opts) {\n const schId = typeof schema == \"object\" && schema[opts.schemaId];\n return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;\n}\n// schema compilation - this function is used recursively to generate code for sub-schemas\nfunction subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}\nfunction schemaCxtHasRules({ schema, self }) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (self.RULES.all[key])\n return true;\n return false;\n}\nfunction isSchemaObj(it) {\n return typeof it.schema != \"boolean\";\n}\nfunction subSchemaObjCode(it, valid) {\n const { schema, gen, opts } = it;\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n updateContext(it);\n checkAsyncSchema(it);\n const errsCount = gen.const(\"_errs\", names_1.default.errors);\n typeAndKeywords(it, errsCount);\n // TODO var\n gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n}\nfunction checkKeywords(it) {\n (0, util_1.checkUnknownRules)(it);\n checkRefsAndKeywords(it);\n}\nfunction typeAndKeywords(it, errsCount) {\n if (it.opts.jtd)\n return schemaKeywords(it, [], false, errsCount);\n const types = (0, dataType_1.getSchemaTypes)(it.schema);\n const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);\n schemaKeywords(it, types, !checkedTypes, errsCount);\n}\nfunction checkRefsAndKeywords(it) {\n const { schema, errSchemaPath, opts, self } = it;\n if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {\n self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n }\n}\nfunction checkNoDefault(it) {\n const { schema, opts } = it;\n if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {\n (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n }\n}\nfunction updateContext(it) {\n const schId = it.schema[it.opts.schemaId];\n if (schId)\n it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n}\nfunction checkAsyncSchema(it) {\n if (it.schema.$async && !it.schemaEnv.$async)\n throw new Error(\"async schema in sync schema\");\n}\nfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n const msg = schema.$comment;\n if (opts.$comment === true) {\n gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);\n }\n else if (typeof opts.$comment == \"function\") {\n const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;\n const rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n }\n}\nfunction returnResults(it) {\n const { gen, schemaEnv, validateName, ValidationError, opts } = it;\n if (schemaEnv.$async) {\n // TODO assign unevaluated\n gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);\n if (opts.unevaluated)\n assignEvaluated(it);\n gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);\n }\n}\nfunction assignEvaluated({ gen, evaluated, props, items }) {\n if (props instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.props`, props);\n if (items instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.items`, items);\n}\nfunction schemaKeywords(it, types, typeErrors, errsCount) {\n const { gen, schema, data, allErrors, opts, self } = it;\n const { RULES } = self;\n if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n gen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition)); // TODO typecast\n return;\n }\n if (!opts.jtd)\n checkStrictTypes(it, types);\n gen.block(() => {\n for (const group of RULES.rules)\n groupKeywords(group);\n groupKeywords(RULES.post);\n });\n function groupKeywords(group) {\n if (!(0, applicability_1.shouldUseGroup)(schema, group))\n return;\n if (group.type) {\n gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n iterateKeywords(it, group);\n if (types.length === 1 && types[0] === group.type && typeErrors) {\n gen.else();\n (0, dataType_2.reportTypeError)(it);\n }\n gen.endIf();\n }\n else {\n iterateKeywords(it, group);\n }\n // TODO make it \"ok\" call?\n if (!allErrors)\n gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);\n }\n}\nfunction iterateKeywords(it, group) {\n const { gen, schema, opts: { useDefaults }, } = it;\n if (useDefaults)\n (0, defaults_1.assignDefaults)(it, group.type);\n gen.block(() => {\n for (const rule of group.rules) {\n if ((0, applicability_1.shouldUseRule)(schema, rule)) {\n keywordCode(it, rule.keyword, rule.definition, group.type);\n }\n }\n });\n}\nfunction checkStrictTypes(it, types) {\n if (it.schemaEnv.meta || !it.opts.strictTypes)\n return;\n checkContextTypes(it, types);\n if (!it.opts.allowUnionTypes)\n checkMultipleTypes(it, types);\n checkKeywordTypes(it, it.dataTypes);\n}\nfunction checkContextTypes(it, types) {\n if (!types.length)\n return;\n if (!it.dataTypes.length) {\n it.dataTypes = types;\n return;\n }\n types.forEach((t) => {\n if (!includesType(it.dataTypes, t)) {\n strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n }\n });\n narrowSchemaTypes(it, types);\n}\nfunction checkMultipleTypes(it, ts) {\n if (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) {\n strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n }\n}\nfunction checkKeywordTypes(it, ts) {\n const rules = it.self.RULES.all;\n for (const keyword in rules) {\n const rule = rules[keyword];\n if (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n const { type } = rule.definition;\n if (type.length && !type.some((t) => hasApplicableType(ts, t))) {\n strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n }\n }\n }\n}\nfunction hasApplicableType(schTs, kwdT) {\n return schTs.includes(kwdT) || (kwdT === \"number\" && schTs.includes(\"integer\"));\n}\nfunction includesType(ts, t) {\n return ts.includes(t) || (t === \"integer\" && ts.includes(\"number\"));\n}\nfunction narrowSchemaTypes(it, withTypes) {\n const ts = [];\n for (const t of it.dataTypes) {\n if (includesType(withTypes, t))\n ts.push(t);\n else if (withTypes.includes(\"integer\") && t === \"number\")\n ts.push(\"integer\");\n }\n it.dataTypes = ts;\n}\nfunction strictTypesError(it, msg) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n msg += ` at \"${schemaPath}\" (strictTypes)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n}\nclass KeywordCxt {\n constructor(it, def, keyword) {\n (0, keyword_1.validateKeywordUsage)(it, def, keyword);\n this.gen = it.gen;\n this.allErrors = it.allErrors;\n this.keyword = keyword;\n this.data = it.data;\n this.schema = it.schema[keyword];\n this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n this.schemaType = def.schemaType;\n this.parentSchema = it.schema;\n this.params = {};\n this.it = it;\n this.def = def;\n if (this.$data) {\n this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n }\n else {\n this.schemaCode = this.schemaValue;\n if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {\n throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n }\n }\n if (\"code\" in def ? def.trackErrors : def.errors !== false) {\n this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n }\n }\n result(condition, successAction, failAction) {\n this.failResult((0, codegen_1.not)(condition), successAction, failAction);\n }\n failResult(condition, successAction, failAction) {\n this.gen.if(condition);\n if (failAction)\n failAction();\n else\n this.error();\n if (successAction) {\n this.gen.else();\n successAction();\n if (this.allErrors)\n this.gen.endIf();\n }\n else {\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n }\n pass(condition, failAction) {\n this.failResult((0, codegen_1.not)(condition), undefined, failAction);\n }\n fail(condition) {\n if (condition === undefined) {\n this.error();\n if (!this.allErrors)\n this.gen.if(false); // this branch will be removed by gen.optimize\n return;\n }\n this.gen.if(condition);\n this.error();\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n fail$data(condition) {\n if (!this.$data)\n return this.fail(condition);\n const { schemaCode } = this;\n this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n }\n error(append, errorParams, errorPaths) {\n if (errorParams) {\n this.setParams(errorParams);\n this._error(append, errorPaths);\n this.setParams({});\n return;\n }\n this._error(append, errorPaths);\n }\n _error(append, errorPaths) {\n ;\n (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n }\n $dataError() {\n (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n }\n reset() {\n if (this.errsCount === undefined)\n throw new Error('add \"trackErrors\" to keyword definition');\n (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n }\n ok(cond) {\n if (!this.allErrors)\n this.gen.if(cond);\n }\n setParams(obj, assign) {\n if (assign)\n Object.assign(this.params, obj);\n else\n this.params = obj;\n }\n block$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n this.gen.block(() => {\n this.check$data(valid, $dataValid);\n codeBlock();\n });\n }\n check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n if (!this.$data)\n return;\n const { gen, schemaCode, schemaType, def } = this;\n gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));\n if (valid !== codegen_1.nil)\n gen.assign(valid, true);\n if (schemaType.length || def.validateSchema) {\n gen.elseIf(this.invalid$data());\n this.$dataError();\n if (valid !== codegen_1.nil)\n gen.assign(valid, false);\n }\n gen.else();\n }\n invalid$data() {\n const { gen, schemaCode, schemaType, def, it } = this;\n return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n function wrong$DataType() {\n if (schemaType.length) {\n /* istanbul ignore if */\n if (!(schemaCode instanceof codegen_1.Name))\n throw new Error(\"ajv implementation error\");\n const st = Array.isArray(schemaType) ? schemaType : [schemaType];\n return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n }\n return codegen_1.nil;\n }\n function invalid$DataSchema() {\n if (def.validateSchema) {\n const validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema }); // TODO value.code for standalone\n return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;\n }\n return codegen_1.nil;\n }\n }\n subschema(appl, valid) {\n const subschema = (0, subschema_1.getSubschema)(this.it, appl);\n (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n (0, subschema_1.extendSubschemaMode)(subschema, appl);\n const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };\n subschemaCode(nextContext, valid);\n return nextContext;\n }\n mergeEvaluated(schemaCxt, toName) {\n const { it, gen } = this;\n if (!it.opts.unevaluated)\n return;\n if (it.props !== true && schemaCxt.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n }\n if (it.items !== true && schemaCxt.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n }\n }\n mergeValidEvaluated(schemaCxt, valid) {\n const { it, gen } = this;\n if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n return true;\n }\n }\n}\nexports.KeywordCxt = KeywordCxt;\nfunction keywordCode(it, keyword, def, ruleType) {\n const cxt = new KeywordCxt(it, def, keyword);\n if (\"code\" in def) {\n def.code(cxt, ruleType);\n }\n else if (cxt.$data && def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n else if (\"macro\" in def) {\n (0, keyword_1.macroKeywordCode)(cxt, def);\n }\n else if (def.compile || def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n}\nconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n let jsonPointer;\n let data;\n if ($data === \"\")\n return names_1.default.rootData;\n if ($data[0] === \"/\") {\n if (!JSON_POINTER.test($data))\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n jsonPointer = $data;\n data = names_1.default.rootData;\n }\n else {\n const matches = RELATIVE_JSON_POINTER.exec($data);\n if (!matches)\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n const up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer === \"#\") {\n if (up >= dataLevel)\n throw new Error(errorMsg(\"property/index\", up));\n return dataPathArr[dataLevel - up];\n }\n if (up > dataLevel)\n throw new Error(errorMsg(\"data\", up));\n data = dataNames[dataLevel - up];\n if (!jsonPointer)\n return data;\n }\n let expr = data;\n const segments = jsonPointer.split(\"/\");\n for (const segment of segments) {\n if (segment) {\n data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n expr = (0, codegen_1._) `${expr} && ${data}`;\n }\n }\n return expr;\n function errorMsg(pointerType, up) {\n return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n }\n}\nexports.getData = getData;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ValidationError extends Error {\n constructor(errors) {\n super(\"validation failed\");\n this.errors = errors;\n this.ajv = this.validation = true;\n }\n}\nexports.default = ValidationError;\n//# sourceMappingURL=validation_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst resolve_1 = require(\"./resolve\");\nclass MissingRefError extends Error {\n constructor(resolver, baseId, ref, msg) {\n super(msg || `can't resolve reference ${ref} from id ${baseId}`);\n this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n }\n}\nexports.default = MissingRefError;\n//# sourceMappingURL=ref_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst validation_error_1 = require(\"../runtime/validation_error\");\nconst names_1 = require(\"./names\");\nconst resolve_1 = require(\"./resolve\");\nconst util_1 = require(\"./util\");\nconst validate_1 = require(\"./validate\");\nclass SchemaEnv {\n constructor(env) {\n var _a;\n this.refs = {};\n this.dynamicAnchors = {};\n let schema;\n if (typeof env.schema == \"object\")\n schema = env.schema;\n this.schema = env.schema;\n this.schemaId = env.schemaId;\n this.root = env.root || this;\n this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n this.schemaPath = env.schemaPath;\n this.localRefs = env.localRefs;\n this.meta = env.meta;\n this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n this.refs = {};\n }\n}\nexports.SchemaEnv = SchemaEnv;\n// let codeSize = 0\n// let nodeCount = 0\n// Compiles schema in SchemaEnv\nfunction compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: (0, codegen_1._) `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: (0, codegen_1._) `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n (0, validate_1.validateFunctionCode)(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}\nexports.compileSchema = compileSchema;\nfunction resolveRef(root, baseId, ref) {\n var _a;\n ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n const schOrFunc = root.refs[ref];\n if (schOrFunc)\n return schOrFunc;\n let _sch = resolve.call(this, root, ref);\n if (_sch === undefined) {\n const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv\n const { schemaId } = this.opts;\n if (schema)\n _sch = new SchemaEnv({ schema, schemaId, root, baseId });\n }\n if (_sch === undefined)\n return;\n return (root.refs[ref] = inlineOrCompile.call(this, _sch));\n}\nexports.resolveRef = resolveRef;\nfunction inlineOrCompile(sch) {\n if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))\n return sch.schema;\n return sch.validate ? sch : compileSchema.call(this, sch);\n}\n// Index of schema compilation in the currently compiled list\nfunction getCompilingSchema(schEnv) {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv))\n return sch;\n }\n}\nexports.getCompilingSchema = getCompilingSchema;\nfunction sameSchemaEnv(s1, s2) {\n return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n}\n// resolve and compile the references ($ref)\n// TODO returns AnySchemaObject (if the schema can be inlined) or validation function\nfunction resolve(root, // information about the root schema for the current schema\nref // reference to resolve\n) {\n let sch;\n while (typeof (sch = this.refs[ref]) == \"string\")\n ref = sch;\n return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n}\n// Resolve schema, its root and baseId\nfunction resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = this.opts.uriResolver.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}\nexports.resolveSchema = resolveSchema;\nconst PREVENT_SCOPE_CHANGE = new Set([\n \"properties\",\n \"patternProperties\",\n \"enum\",\n \"dependencies\",\n \"definitions\",\n]);\nfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n var _a;\n if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\")\n return;\n for (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n if (typeof schema === \"boolean\")\n return;\n const partSchema = schema[(0, util_1.unescapeFragment)(part)];\n if (partSchema === undefined)\n return;\n schema = partSchema;\n // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?\n const schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n }\n }\n let env;\n if (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n env = resolveSchema.call(this, root, $ref);\n }\n // even though resolution failed we need to return SchemaEnv to throw exception\n // so that compileAsync loads missing schema.\n const { schemaId } = this.opts;\n env = env || new SchemaEnv({ schema, schemaId, root, baseId });\n if (env.schema !== env.root.schema)\n return env;\n return undefined;\n}\n//# sourceMappingURL=index.js.map","","'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isPort = RegExp.prototype.test.bind(/^\\d*$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]$/u)\n\n/** @type {(value: string) => boolean} */\nconst isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\\-._~!$&'()*+,;=:]$/u)\n\nconst BYTE_HEX = new Array(256)\n{\n const HEX_DIGITS = '0123456789ABCDEF'\n for (let i = 0; i < 256; i++) {\n BYTE_HEX[i] = '%' + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 0xF]\n }\n}\nfunction percentEncodeNonAscii (cp) {\n if (cp < 0x800) {\n return BYTE_HEX[0xC0 | (cp >> 6)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n if (cp < 0x10000) {\n return BYTE_HEX[0xE0 | (cp >> 12)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n return BYTE_HEX[0xF0 | (cp >> 18)] +\n BYTE_HEX[0x80 | ((cp >> 12) & 0x3F)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n}\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/** @type {(value: string) => boolean} */\nconst isHextet = RegExp.prototype.test.bind(/^[\\dA-Fa-f]{1,4}$/)\n\n/** @type {(value: string) => boolean} */\nconst isIPvFuture = RegExp.prototype.test.bind(/^[vV][\\dA-Fa-f]+\\.[A-Za-z\\d\\-._~!$&'()*+,;=:]+$/)\n\n/** @type {(value: string) => boolean} */\nconst isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\\d\\-._~]$/)\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {string} zone\n * @returns {boolean}\n */\nfunction isZoneIdentifier (zone) {\n if (zone.length === 0) return false\n\n for (let i = 0; i < zone.length; i++) {\n if (isZoneCharacter(zone[i])) continue\n if (zone[i] === '%' && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {\n i += 2\n continue\n }\n return false\n }\n\n return true\n}\n\n/**\n * Compresses the longest run of zero hextets to \"::\" per RFC 5952. A run of a\n * single zero hextet is left uncompressed. On ties the leftmost run wins.\n *\n * @param {string[]} hextets\n * @returns {string}\n */\nfunction compressIPv6ZeroRun (hextets) {\n let bestStart = -1\n let bestLength = 0\n let runStart = -1\n let runLength = 0\n for (let i = 0; i < hextets.length; i++) {\n if (hextets[i] === '0') {\n if (runStart === -1) runStart = i\n runLength++\n if (runLength > bestLength) {\n bestLength = runLength\n bestStart = runStart\n }\n } else {\n runStart = -1\n runLength = 0\n }\n }\n\n if (bestLength < 2) return hextets.join(':')\n\n const head = hextets.slice(0, bestStart).join(':')\n const tail = hextets.slice(bestStart + bestLength).join(':')\n return head + '::' + tail\n}\n\n/**\n * Validates an IPv6 address against the alternatives in RFC 3986 section\n * 3.2.2 and returns the same address with leading hextet zeroes removed.\n * An embedded IPv4 address counts as two hextets and is only valid at the end.\n *\n * @param {string} input\n * @returns {string|undefined}\n */\nfunction normalizeIPv6Address (input) {\n const compression = input.indexOf('::')\n if (compression !== -1 && input.indexOf('::', compression + 1) !== -1) return undefined\n\n const left = compression === -1 ? input.split(':') : input.slice(0, compression).split(':')\n const right = compression === -1 ? [] : input.slice(compression + 2).split(':')\n if (compression !== -1) {\n if (left.length === 1 && left[0] === '') left.length = 0\n if (right.length === 1 && right[0] === '') right.length = 0\n }\n\n const parts = left.concat(right)\n let hextetCount = 0\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n if (part === '') return undefined\n\n if (part.indexOf('.') !== -1) {\n if (i !== parts.length - 1 || (compression !== -1 && right.length === 0) || !isIPv4(part)) return undefined\n hextetCount += 2\n continue\n }\n\n if (!isHextet(part)) return undefined\n parts[i] = parseInt(part, 16).toString(16)\n hextetCount++\n }\n\n if (compression === -1) {\n if (hextetCount !== 8) return undefined\n return compressIPv6ZeroRun(parts)\n }\n if (hextetCount >= 8) return undefined\n\n // expand \"::\" then re-compress the longest run for a canonical result\n const expanded = parts.slice(0, left.length)\n for (let i = hextetCount; i < 8; i++) expanded.push('0')\n for (let i = left.length; i < parts.length; i++) expanded.push(parts[i])\n return compressIPv6ZeroRun(expanded)\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n * @property {boolean} [isIPVFuture] - Indicates if the host is an IPvFuture literal.\n * @property {boolean} [error] - Indicates if a bracketed IP literal is malformed.\n */\n\n/**\n * Validates and normalizes a bracketed IP literal. Raw zone separators remain\n * accepted for backwards compatibility, while encoded separators and zone\n * contents follow RFC 6874.\n *\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n const bracketed = host[0] === '[' && host[host.length - 1] === ']'\n const hasBracket = host[0] === '[' || host[host.length - 1] === ']'\n if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }\n\n let input = bracketed ? host.slice(1, -1) : host\n if (bracketed && isIPvFuture(input)) {\n input = input.toLowerCase()\n return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }\n }\n\n if (findToken(input, ':') < 2) {\n return { host, isIPV6: false, error: bracketed }\n }\n\n let zoneIdentifier = ''\n const zoneSeparator = input.indexOf('%')\n if (zoneSeparator !== -1) {\n const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === '%25' ? 3 : 1\n zoneIdentifier = input.slice(zoneSeparator + separatorLength)\n if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }\n input = input.slice(0, zoneSeparator)\n }\n\n const address = normalizeIPv6Address(input)\n if (address === undefined) return { host, isIPV6: false, error: true }\n\n return {\n host: address + (zoneIdentifier ? '%' + zoneIdentifier : ''),\n escapedHost: address + (zoneIdentifier ? '%25' + zoneIdentifier : ''),\n isIPV6: true\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.' || input[1] === '/') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Removes dot segments from the path of a relative reference (a path that does\n * not start with \"/\") without changing what it resolves to against any base.\n * Unlike `removeDotSegments`, leading \"..\" segments that cannot be collapsed\n * are kept, the result never becomes root-relative, and a result that would be\n * empty or start with an empty segment is prefixed with \".\" (an empty path\n * means \"same document\" and a leading \"//\" would introduce an authority).\n *\n * @param {string} path\n * @returns {string}\n */\nfunction removeDotSegmentsRelative (path) {\n if (path === '' || path[0] === '/') {\n return removeDotSegments(path)\n }\n\n const segments = path.split('/')\n const last = segments.length - 1\n /** @type {string[]} */\n const output = []\n let trailingDirectory = false\n\n for (let i = 0; i <= last; i++) {\n const segment = segments[i]\n if (segment === '.' || segment === '..') {\n if (segment === '..') {\n if (output.length !== 0 && output[output.length - 1] !== '..') {\n output.pop()\n } else {\n output.push('..')\n }\n }\n trailingDirectory = i === last\n } else {\n output.push(segment)\n }\n }\n\n if (trailingDirectory && output[output.length - 1] !== '..') {\n output.push('')\n }\n if (output.length === 0 || output[0] === '' || output[0].includes(':')) {\n // An empty path, a leading empty segment (\"//\"), or a first segment\n // containing \":\" (which would be mistaken for a scheme, RFC 3986 section\n // 4.2) must stay behind a \".\" segment so the reference keeps its meaning.\n output.unshift('.')\n }\n\n return output.join('/')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` stay escaped; `%2E` is unreserved.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Serializes a path without rewriting reserved data. Raw RFC 3986 path\n * characters remain literal, valid escapes are preserved and uppercased, and\n * everything else is UTF-8 percent-encoded. In a path-noscheme, a colon in the\n * first segment must be escaped so the result cannot be parsed as a scheme.\n *\n * @param {string} input\n * @param {boolean} [pathNoScheme=false]\n * @returns {string}\n */\nfunction serializePathEncoding (input, pathNoScheme = false) {\n let output = ''\n let firstSegment = pathNoScheme && input[0] !== '/'\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (ch === '/') {\n firstSegment = false\n }\n\n if (isPathCharacter(ch) && (ch !== ':' || !firstSegment)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Percent-encodes a URI component using its RFC 3986 literal character set.\n * Existing valid escapes are preserved and normalized to uppercase hex.\n *\n * @param {string} input\n * @param {(value: string) => boolean} isAllowed\n * @returns {string}\n */\nfunction encodeComponent (input, isAllowed) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n if (isAllowed(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Encodes userinfo while preserving its RFC 3986 §3.2.1 literal characters.\n * In particular, authority delimiters such as `@`, `/`, `?`, and `#` are data.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeUserinfo (input) {\n return encodeComponent(input, isUserinfoCharacter)\n}\n\n/**\n * Encodes query data using the RFC 3986 §3.4 grammar. A literal `#` must be\n * escaped because it would otherwise begin the fragment component.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeQuery (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\n/**\n * Encodes fragment data using the RFC 3986 §3.5 grammar.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction encodeFragment (input) {\n return encodeComponent(input, isQueryFragmentCharacter)\n}\n\nfunction isEscapeSafe (cp) {\n return (\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5A) ||\n (cp >= 0x61 && cp <= 0x7A) ||\n cp === 0x2A || cp === 0x2B || cp === 0x2D || cp === 0x2E ||\n cp === 0x2F || cp === 0x40 || cp === 0x5F\n )\n}\n\n/**\n * Normalizes the percent-encoding of a query or fragment component.\n *\n * Like `normalizePathEncoding`, but uses the query/fragment character set\n * (which additionally allows `?`) and decodes `.` since it has no dot-segment\n * meaning outside of a path.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeQueryFragmentEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isQueryFragmentCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n output += escape(input[i])\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(encodeUserinfo(component.userinfo))\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = component.host\n if (!isIPv4(host)) {\n let ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {\n // Decode only unreserved bytes, once. In particular, keep %25 encoded\n // so it cannot introduce a second escape during recomposition.\n host = normalizePercentEncoding(host, true)\n ipV6res = normalizeIPv6(host)\n }\n if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n const port = String(component.port)\n if (!isPort(port)) {\n throw new TypeError('URI port is malformed.')\n }\n uriTokens.push(':')\n uriTokens.push(port)\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n serializePathEncoding,\n normalizeQueryFragmentEncoding,\n encodeUserinfo,\n encodeQuery,\n encodeFragment,\n escapePreservingEscapes,\n removeDotSegments,\n removeDotSegmentsRelative,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n","'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /^([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-./:;=@]|%[\\da-f]{2})+)$/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const queryIndex = wsComponent.resourceName.indexOf('?')\n const path = queryIndex === -1\n ? wsComponent.resourceName\n : wsComponent.resourceName.slice(0, queryIndex)\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = queryIndex === -1\n ? undefined\n : wsComponent.resourceName.slice(queryIndex + 1)\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches && matches[0] === urnComponent.path) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n","'use strict'\n\nconst { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\nconst VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u\nconst MALFORMED_SCHEME_ERROR = 'URI scheme is malformed.'\nconst MALFORMED_HOST_ERROR = 'URI host is malformed.'\n// ASCII characters outside the RFC 3986 reg-name set (unreserved, sub-delims\n// and \"%\" for pct-encoded): C0 controls, space, DEL, and \"#/:<>?@[\\]^`{|}.\nconst FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\\0-\\x20\"#/:<>?@[\\\\\\]^`{|}\\x7F]/u\n\n/**\n * RFC 3986 section 3.1 does not allow percent-encoding in a scheme, so the\n * scheme is validated as-is and never decoded. Decoding would let inert input\n * such as `%6Aavascript:` become a live `javascript:` scheme.\n *\n * @param {string} scheme\n * @returns {string}\n */\nfunction validateScheme (scheme) {\n const stringScheme = String(scheme)\n if (!VALID_SCHEME.test(stringScheme)) {\n throw new TypeError(MALFORMED_SCHEME_ERROR)\n }\n return stringScheme\n}\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const {\n parsed: baseParsed,\n malformedAuthorityOrPort: baseMalformed,\n malformedPercentEncoding: baseMalformedPercentEncoding,\n malformedSchemeSpecific: baseMalformedSchemeSpecific,\n malformedHost: baseMalformedHost,\n malformedScheme: baseMalformedScheme\n } = parseWithStatus(baseURI, schemelessOptions)\n const {\n parsed: relativeParsed,\n malformedAuthorityOrPort: relativeMalformed,\n malformedPercentEncoding: relativeMalformedPercentEncoding,\n malformedSchemeSpecific: relativeMalformedSchemeSpecific,\n malformedHost: relativeMalformedHost,\n malformedScheme: relativeMalformedScheme\n } = parseWithStatus(relativeURI, schemelessOptions)\n if (\n baseMalformed ||\n relativeMalformed ||\n baseMalformedPercentEncoding ||\n relativeMalformedPercentEncoding ||\n baseMalformedSchemeSpecific ||\n relativeMalformedSchemeSpecific ||\n baseMalformedHost ||\n relativeMalformedHost ||\n baseMalformedScheme ||\n relativeMalformedScheme\n ) {\n throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.')\n }\n const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true)\n const resolvedSchemeHandler = getSchemeHandler((options && options.scheme) || resolved.scheme)\n const resolvedHost = resolved.host\n const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== '' &&\n (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6)\n // Inputs are parsed scheme-neutrally, so delimiters and controls in a domain\n // host are only detected here, once the final scheme is known. They always\n // fail closed, including in percent-encoded hosts.\n if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {\n throw new Error(MALFORMED_HOST_ERROR)\n }\n canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)\n // Percent escapes in an ASCII reg-name are encoded data. The WHATWG hostname\n // parser can reject them even though fast-uri preserves them safely as RFC\n // 3986 data. A raw non-ASCII host must still fail closed if conversion fails.\n const encodedASCIIHost = resolvedHost && resolvedHost.indexOf('%') !== -1 &&\n !/\\P{ASCII}/u.test(resolvedHost)\n if (resolved.error && !encodedASCIIHost) {\n throw new Error(resolved.error)\n }\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined\n if (baseHasAuthority && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== '/'\n ? removeDotSegmentsRelative(target.path)\n : removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n if (component.scheme) {\n component.scheme = validateScheme(component.scheme)\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined\n // A reference with no emitted scheme is path-noscheme: a bare ':' in its\n // first path segment would reparse as a scheme (RFC 3986 3.3/4.2). Enforced\n // under skipEscape too (resolve()), so the reapply below gates on this flag.\n const schemelessReference = (component.scheme === undefined || options.reference === 'suffix') && !hasAuthority\n const pathNoScheme = !options.skipEscape && schemelessReference\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = serializePathEncoding(component.path, pathNoScheme)\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n // Scheme handlers may replace the scheme during serialization.\n component.scheme = validateScheme(component.scheme)\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n // A relative-path reference keeps its unresolvable leading \"..\" segments\n // and must never become root-relative (RFC 3986 section 5.2.4 applies to\n // merged target paths, not to the reference itself).\n s = schemelessReference && s[0] !== '/'\n ? removeDotSegmentsRelative(s)\n : removeDotSegments(s)\n }\n\n // Dot-segment removal can expose a colon that was not originally in the\n // first segment (for example, \"./a:b\"). Reapply path-noscheme encoding so\n // the serialized relative reference cannot be reparsed as a URI scheme.\n if (schemelessReference) {\n s = serializePathEncoding(s, true)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', encodeQuery(component.query))\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', encodeFragment(component.fragment))\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n// Captures the authority component (between \"//\" and the next \"/\", \"?\" or \"#\"),\n// with or without a scheme prefix, for the literal-backslash rejection below.\nconst AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\\/\\/([^/?#]*)/\n\n// Captures the leading authority-introducer region after an optional scheme: a\n// run of forward slashes, backslashes, and the characters the WHATWG URL parser\n// removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer\n// is exactly \"//\". Node treats \"\\\" as \"/\" on special schemes and strips those\n// characters first, so forms like \"\\\\\", \"/\\\", \"\\/\", \"/<TAB>/\", or a leading\n// \"<TAB>//\" reach an authority in Node while fast-uri's URI_PARSE folds them into\n// the path group (host confusion / SSRF / redirect bypass).\nconst AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\\\\t\\n\\r]*)/\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * Checks percent syntax without decoding the represented octets. RFC 3986\n * percent-encoding is byte-oriented, so sequences such as `%FF` are valid even\n * though they are not independently valid UTF-8.\n *\n * @param {string|undefined} component\n * @returns {boolean}\n */\nfunction hasMalformedPercentEncoding (component) {\n if (component === undefined) return false\n\n let percent = component.indexOf('%')\n while (percent !== -1) {\n if (percent + 2 >= component.length || !/^[\\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {\n return true\n }\n percent = component.indexOf('%', percent + 3)\n }\n\n return false\n}\n\n/**\n * Whether the host is a bracketed IP literal (RFC 3986 `IP-literal`).\n * An unterminated `[` is not a literal, so it must still be validated as a\n * reg-name instead of being waved through as an IP.\n *\n * @param {string} host\n * @returns {boolean}\n */\nfunction isIPLiteral (host) {\n return host[0] === '[' && host[host.length - 1] === ']'\n}\n\n/**\n * @param {RegExpMatchArray} matches\n * @returns {boolean}\n */\nfunction hasMalformedComponentPercentEncoding (matches) {\n // Bracketed IP literals use a raw \"%\" as the zone separator for historical\n // compatibility. Their parsing is intentionally left to normalizeIPv6.\n const host = matches[4]\n return hasMalformedPercentEncoding(matches[3]) ||\n (host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host)) ||\n hasMalformedPercentEncoding(matches[6]) ||\n hasMalformedPercentEncoding(matches[7]) ||\n hasMalformedPercentEncoding(matches[8])\n}\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {import('./types/index').Options} options\n * @param {{ domainHost?: boolean, unicodeSupport?: boolean }|undefined} schemeHandler\n * @param {boolean} isIP\n * @returns {boolean} whether host conversion failed\n */\nfunction canonicalizeHost (parsed, options, schemeHandler, isIP) {\n if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n return true\n }\n\n if (\n !options.unicodeSupport &&\n (!schemeHandler || !schemeHandler.unicodeSupport) &&\n parsed.host &&\n !isIPLiteral(parsed.host) &&\n (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&\n isIP === false &&\n nonSimpleDomain(parsed.host)\n ) {\n let url\n try {\n url = new URL('http://' + parsed.host)\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n return true\n }\n // The WHATWG parser must have read the whole input as a host. Anything\n // else means it found a delimiter fast-uri did not, so its hostname would\n // describe a different authority.\n if (!isHostOnlyURL(url)) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n return true\n }\n parsed.host = url.hostname\n }\n return false\n}\n\n/**\n * Whether a domain host contains an ASCII character that RFC 3986 does not\n * allow in a reg-name (unreserved, sub-delims, or pct-encoded). Such a host is\n * rejected instead of being handed to the WHATWG URL parser, which would treat\n * \"@\" as a userinfo delimiter (silently dropping the data before it) and strip\n * TAB, LF, and CR. Non-ASCII characters remain allowed for IDNs.\n *\n * @param {import('./types/index').URIComponent} parsed\n * @param {import('./types/index').Options} options\n * @param {{ domainHost?: boolean }|undefined} schemeHandler\n * @param {boolean} isIP\n * @returns {boolean}\n */\nfunction hasForbiddenDomainHost (parsed, options, schemeHandler, isIP) {\n return Boolean(\n parsed.host &&\n isIP === false &&\n !isIPLiteral(parsed.host) &&\n (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&\n FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)\n )\n}\n\n/**\n * @param {URL} url\n * @returns {boolean}\n */\nfunction isHostOnlyURL (url) {\n return url.username === '' &&\n url.password === '' &&\n url.port === '' &&\n url.pathname === '/' &&\n url.search === '' &&\n url.hash === '' &&\n url.hostname !== ''\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n let malformedPercentEncoding = false\n let malformedSchemeSpecific = false\n let malformedHost = false\n let malformedIPLiteral = false\n let malformedScheme = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is\n // not an authority delimiter. Reject it in the authority rather than\n // rewriting it: normalizing \"\\\" -> \"/\" (WHATWG error recovery) could silently\n // change the resource identified by an otherwise-invalid input, and lets \"\\\"\n // act as a host delimiter here while Node's native URL parses a different\n // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is\n // untouched and remains valid encoded data.\n const authorityMatch = uri.match(AUTHORITY_PREFIX)\n if (authorityMatch !== null && authorityMatch[1].indexOf('\\\\') !== -1) {\n parsed.error = 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n }\n\n // Reject a malformed or whitespace-smuggled authority introducer. fast-uri\n // only recognizes a literal \"//\"; anything else in the leading separator run\n // (a backslash, or a \"//\" that appears only after removing the TAB/LF/CR that\n // Node strips) means the authority fast-uri parses differs from the one Node's\n // URL resolves. Reject rather than rewrite, mirroring the literal-backslash\n // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data.\n const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION)\n if (introducerMatch !== null) {\n const region = introducerMatch[1]\n const normalizedRegion = region.replace(/[\\t\\n\\r]/g, '')\n // Two or more leading separators introduce an authority.\n if (normalizedRegion.length >= 2) {\n if (normalizedRegion.slice(0, 2) !== '//') {\n parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n } else if (region.length !== normalizedRegion.length) {\n parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'\n malformedAuthorityOrPort = true\n }\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n if (parsed.scheme !== undefined) {\n if (VALID_SCHEME.test(parsed.scheme)) {\n parsed.scheme = parsed.scheme.toLowerCase()\n } else {\n parsed.error = parsed.error || MALFORMED_SCHEME_ERROR\n malformedScheme = true\n }\n }\n\n malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches)\n if (malformedPercentEncoding) {\n parsed.error = parsed.error || 'URI contains malformed percent-encoding.'\n }\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const bracketedIPLiteral = isIPLiteral(parsed.host)\n const hasIPLiteralBracket = parsed.host.indexOf('[') !== -1 || parsed.host.indexOf(']') !== -1\n const ipv6result = normalizeIPv6(parsed.host)\n isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true\n malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true)\n parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase()\n\n if (malformedIPLiteral) {\n parsed.error = parsed.error || MALFORMED_HOST_ERROR\n malformedAuthorityOrPort = true\n }\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // convert Unicode IDN -> ASCII IDN when the effective scheme uses domain hosts\n if (!malformedIPLiteral) {\n malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP)\n }\n\n if (uri.indexOf('%') !== -1 && parsed.host !== undefined && !malformedIPLiteral) {\n let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true)\n if (!isIP) {\n // Fold reg-name case after decoding unreserved octets. The second\n // pass only restores uppercase hex in escapes that remain encoded.\n host = normalizePercentEncoding(host.toLowerCase())\n }\n // Resolution parses both inputs with the internal `null` scheme before\n // the effective scheme is known. Keep raw host delimiters for that step\n // so resolve() can reject them for domain-host schemes; the resolved\n // authority is encoded when it is serialized.\n parsed.host = isIP || options.scheme !== 'null' ? reescapeHostDelimiters(host, isIP) : host\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.query) {\n parsed.query = normalizeQueryFragmentEncoding(parsed.query)\n }\n if (parsed.fragment) {\n parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment)\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {\n malformedSchemeSpecific = true\n }\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort,\n malformedPercentEncoding,\n malformedSchemeSpecific,\n malformedHost,\n malformedScheme\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri !== 'string' && typeof uri !== 'object') {\n return undefined\n }\n\n let value\n try {\n value = typeof uri === 'string' ? uri : serialize(uri, opts)\n } catch {\n return undefined\n }\n const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts)\n return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uri = require(\"fast-uri\");\nuri.code = 'require(\"ajv/dist/runtime/uri\").default';\nexports.default = uri;\n//# sourceMappingURL=uri.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nconst validation_error_1 = require(\"./runtime/validation_error\");\nconst ref_error_1 = require(\"./compile/ref_error\");\nconst rules_1 = require(\"./compile/rules\");\nconst compile_1 = require(\"./compile\");\nconst codegen_2 = require(\"./compile/codegen\");\nconst resolve_1 = require(\"./compile/resolve\");\nconst dataType_1 = require(\"./compile/validate/dataType\");\nconst util_1 = require(\"./compile/util\");\nconst $dataRefSchema = require(\"./refs/data.json\");\nconst uri_1 = require(\"./runtime/uri\");\nconst defaultRegExp = (str, flags) => new RegExp(str, flags);\ndefaultRegExp.code = \"new RegExp\";\nconst META_IGNORE_OPTIONS = [\"removeAdditional\", \"useDefaults\", \"coerceTypes\"];\nconst EXT_SCOPE_NAMES = new Set([\n \"validate\",\n \"serialize\",\n \"parse\",\n \"wrapper\",\n \"root\",\n \"schema\",\n \"keyword\",\n \"pattern\",\n \"formats\",\n \"validate$data\",\n \"func\",\n \"obj\",\n \"Error\",\n]);\nconst removedOptions = {\n errorDataPath: \"\",\n format: \"`validateFormats: false` can be used instead.\",\n nullable: '\"nullable\" keyword is supported by default.',\n jsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n extendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n missingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n processCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n sourceCode: \"Use option `code: {source: true}`\",\n strictDefaults: \"It is default now, see option `strict`.\",\n strictKeywords: \"It is default now, see option `strict`.\",\n uniqueItems: '\"uniqueItems\" keyword is always validated.',\n unknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n cache: \"Map is used as cache, schema object as key.\",\n serialize: \"Map is used as cache, schema object as key.\",\n ajvErrors: \"It is default now.\",\n};\nconst deprecatedOptions = {\n ignoreKeywordsWithRef: \"\",\n jsPropertySyntax: \"\",\n unicode: '\"minLength\"/\"maxLength\" account for unicode characters by default.',\n};\nconst MAX_EXPRESSION = 200;\n// eslint-disable-next-line complexity\nfunction requiredOptions(o) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n const s = o.strict;\n const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;\n const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n return {\n strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },\n loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n uriResolver: uriResolver,\n };\n}\nclass Ajv {\n constructor(opts = {}) {\n this.schemas = {};\n this.refs = {};\n this.formats = Object.create(null);\n this._compilations = new Set();\n this._loading = {};\n this._cache = new Map();\n opts = this.opts = { ...opts, ...requiredOptions(opts) };\n const { es5, lines } = this.opts.code;\n this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });\n this.logger = getLogger(opts.logger);\n const formatOpt = opts.validateFormats;\n opts.validateFormats = false;\n this.RULES = (0, rules_1.getRules)();\n checkOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n checkOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n this._metaOpts = getMetaSchemaOptions.call(this);\n if (opts.formats)\n addInitialFormats.call(this);\n this._addVocabularies();\n this._addDefaultMetaSchema();\n if (opts.keywords)\n addInitialKeywords.call(this, opts.keywords);\n if (typeof opts.meta == \"object\")\n this.addMetaSchema(opts.meta);\n addInitialSchemas.call(this);\n opts.validateFormats = formatOpt;\n }\n _addVocabularies() {\n this.addKeyword(\"$async\");\n }\n _addDefaultMetaSchema() {\n const { $data, meta, schemaId } = this.opts;\n let _dataRefSchema = $dataRefSchema;\n if (schemaId === \"id\") {\n _dataRefSchema = { ...$dataRefSchema };\n _dataRefSchema.id = _dataRefSchema.$id;\n delete _dataRefSchema.$id;\n }\n if (meta && $data)\n this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n }\n defaultMeta() {\n const { meta, schemaId } = this.opts;\n return (this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : undefined);\n }\n validate(schemaKeyRef, // key, ref or schema object\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n data // to be validated\n ) {\n let v;\n if (typeof schemaKeyRef == \"string\") {\n v = this.getSchema(schemaKeyRef);\n if (!v)\n throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n }\n else {\n v = this.compile(schemaKeyRef);\n }\n const valid = v(data);\n if (!(\"$async\" in v))\n this.errors = v.errors;\n return valid;\n }\n compile(schema, _meta) {\n const sch = this._addSchema(schema, _meta);\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n compileAsync(schema, meta) {\n if (typeof this.opts.loadSchema != \"function\") {\n throw new Error(\"options.loadSchema should be a function\");\n }\n const { loadSchema } = this.opts;\n return runCompileAsync.call(this, schema, meta);\n async function runCompileAsync(_schema, _meta) {\n await loadMetaSchema.call(this, _schema.$schema);\n const sch = this._addSchema(_schema, _meta);\n return sch.validate || _compileAsync.call(this, sch);\n }\n async function loadMetaSchema($ref) {\n if ($ref && !this.getSchema($ref)) {\n await runCompileAsync.call(this, { $ref }, true);\n }\n }\n async function _compileAsync(sch) {\n try {\n return this._compileSchemaEnv(sch);\n }\n catch (e) {\n if (!(e instanceof ref_error_1.default))\n throw e;\n checkLoaded.call(this, e);\n await loadMissingSchema.call(this, e.missingSchema);\n return _compileAsync.call(this, sch);\n }\n }\n function checkLoaded({ missingSchema: ref, missingRef }) {\n if (this.refs[ref]) {\n throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n }\n }\n async function loadMissingSchema(ref) {\n const _schema = await _loadSchema.call(this, ref);\n if (!this.refs[ref])\n await loadMetaSchema.call(this, _schema.$schema);\n if (!this.refs[ref])\n this.addSchema(_schema, ref, meta);\n }\n async function _loadSchema(ref) {\n const p = this._loading[ref];\n if (p)\n return p;\n try {\n return await (this._loading[ref] = loadSchema(ref));\n }\n finally {\n delete this._loading[ref];\n }\n }\n }\n // Adds schema to the instance\n addSchema(schema, // If array is passed, `key` will be ignored\n key, // 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`.\n _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.\n ) {\n if (Array.isArray(schema)) {\n for (const sch of schema)\n this.addSchema(sch, undefined, _meta, _validateSchema);\n return this;\n }\n let id;\n if (typeof schema === \"object\") {\n const { schemaId } = this.opts;\n id = schema[schemaId];\n if (id !== undefined && typeof id != \"string\") {\n throw new Error(`schema ${schemaId} must be string`);\n }\n }\n key = (0, resolve_1.normalizeId)(key || id);\n this._checkUnique(key);\n this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n return this;\n }\n // Add schema that will be used to validate other schemas\n // options in META_IGNORE_OPTIONS are alway set to false\n addMetaSchema(schema, key, // schema key\n _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema\n ) {\n this.addSchema(schema, key, true, _validateSchema);\n return this;\n }\n // Validate schema against its meta-schema\n validateSchema(schema, throwOrLogError) {\n if (typeof schema == \"boolean\")\n return true;\n let $schema;\n $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != \"string\") {\n throw new Error(\"$schema must be a string\");\n }\n $schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n if (!$schema) {\n this.logger.warn(\"meta-schema not available\");\n this.errors = null;\n return true;\n }\n const valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n const message = \"schema is invalid: \" + this.errorsText();\n if (this.opts.validateSchema === \"log\")\n this.logger.error(message);\n else\n throw new Error(message);\n }\n return valid;\n }\n // Get compiled schema by `key` or `ref`.\n // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)\n getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n // Remove cached schema(s).\n // If no parameter is passed all schemas but meta-schemas are removed.\n // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n this._removeAllSchemas(this.schemas, schemaKeyRef);\n this._removeAllSchemas(this.refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case \"undefined\":\n this._removeAllSchemas(this.schemas);\n this._removeAllSchemas(this.refs);\n this._cache.clear();\n return this;\n case \"string\": {\n const sch = getSchEnv.call(this, schemaKeyRef);\n if (typeof sch == \"object\")\n this._cache.delete(sch.schema);\n delete this.schemas[schemaKeyRef];\n delete this.refs[schemaKeyRef];\n return this;\n }\n case \"object\": {\n const cacheKey = schemaKeyRef;\n this._cache.delete(cacheKey);\n let id = schemaKeyRef[this.opts.schemaId];\n if (id) {\n id = (0, resolve_1.normalizeId)(id);\n delete this.schemas[id];\n delete this.refs[id];\n }\n return this;\n }\n default:\n throw new Error(\"ajv.removeSchema: invalid parameter\");\n }\n }\n // add \"vocabulary\" - a collection of keywords\n addVocabulary(definitions) {\n for (const def of definitions)\n this.addKeyword(def);\n return this;\n }\n addKeyword(kwdOrDef, def // deprecated\n ) {\n let keyword;\n if (typeof kwdOrDef == \"string\") {\n keyword = kwdOrDef;\n if (typeof def == \"object\") {\n this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n def.keyword = keyword;\n }\n }\n else if (typeof kwdOrDef == \"object\" && def === undefined) {\n def = kwdOrDef;\n keyword = def.keyword;\n if (Array.isArray(keyword) && !keyword.length) {\n throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n }\n }\n else {\n throw new Error(\"invalid addKeywords parameters\");\n }\n checkKeyword.call(this, keyword, def);\n if (!def) {\n (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n return this;\n }\n keywordMetaschema.call(this, def);\n const definition = {\n ...def,\n type: (0, dataType_1.getJSONTypes)(def.type),\n schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),\n };\n (0, util_1.eachItem)(keyword, definition.type.length === 0\n ? (k) => addRule.call(this, k, definition)\n : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n return this;\n }\n getKeyword(keyword) {\n const rule = this.RULES.all[keyword];\n return typeof rule == \"object\" ? rule.definition : !!rule;\n }\n // Remove keyword\n removeKeyword(keyword) {\n // TODO return type should be Ajv\n const { RULES } = this;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n for (const group of RULES.rules) {\n const i = group.rules.findIndex((rule) => rule.keyword === keyword);\n if (i >= 0)\n group.rules.splice(i, 1);\n }\n return this;\n }\n // Add format\n addFormat(name, format) {\n if (typeof format == \"string\")\n format = new RegExp(format);\n this.formats[name] = format;\n return this;\n }\n errorsText(errors = this.errors, // optional array of validation errors\n { separator = \", \", dataVar = \"data\" } = {} // optional options with properties `separator` and `dataVar`\n ) {\n if (!errors || errors.length === 0)\n return \"No errors\";\n return errors\n .map((e) => `${dataVar}${e.instancePath} ${e.message}`)\n .reduce((text, msg) => text + separator + msg);\n }\n $dataMetaSchema(metaSchema, keywordsJsonPointers) {\n const rules = this.RULES.all;\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n for (const jsonPointer of keywordsJsonPointers) {\n const segments = jsonPointer.split(\"/\").slice(1); // first segment is an empty string\n let keywords = metaSchema;\n for (const seg of segments)\n keywords = keywords[seg];\n for (const key in rules) {\n const rule = rules[key];\n if (typeof rule != \"object\")\n continue;\n const { $data } = rule.definition;\n const schema = keywords[key];\n if ($data && schema)\n keywords[key] = schemaOrData(schema);\n }\n }\n return metaSchema;\n }\n _removeAllSchemas(schemas, regex) {\n for (const keyRef in schemas) {\n const sch = schemas[keyRef];\n if (!regex || regex.test(keyRef)) {\n if (typeof sch == \"string\") {\n delete schemas[keyRef];\n }\n else if (sch && !sch.meta) {\n this._cache.delete(sch.schema);\n delete schemas[keyRef];\n }\n }\n }\n }\n _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n let id;\n const { schemaId } = this.opts;\n if (typeof schema == \"object\") {\n id = schema[schemaId];\n }\n else {\n if (this.opts.jtd)\n throw new Error(\"schema must be object\");\n else if (typeof schema != \"boolean\")\n throw new Error(\"schema must be object or boolean\");\n }\n let sch = this._cache.get(schema);\n if (sch !== undefined)\n return sch;\n baseId = (0, resolve_1.normalizeId)(id || baseId);\n const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });\n this._cache.set(sch.schema, sch);\n if (addSchema && !baseId.startsWith(\"#\")) {\n // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)\n if (baseId)\n this._checkUnique(baseId);\n this.refs[baseId] = sch;\n }\n if (validateSchema)\n this.validateSchema(schema, true);\n return sch;\n }\n _checkUnique(id) {\n if (this.schemas[id] || this.refs[id]) {\n throw new Error(`schema with key or id \"${id}\" already exists`);\n }\n }\n _compileSchemaEnv(sch) {\n if (sch.meta)\n this._compileMetaSchema(sch);\n else\n compile_1.compileSchema.call(this, sch);\n /* istanbul ignore if */\n if (!sch.validate)\n throw new Error(\"ajv implementation error\");\n return sch.validate;\n }\n _compileMetaSchema(sch) {\n const currentOpts = this.opts;\n this.opts = this._metaOpts;\n try {\n compile_1.compileSchema.call(this, sch);\n }\n finally {\n this.opts = currentOpts;\n }\n }\n}\nAjv.ValidationError = validation_error_1.default;\nAjv.MissingRefError = ref_error_1.default;\nexports.default = Ajv;\nfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n for (const key in checkOpts) {\n const opt = key;\n if (opt in options)\n this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n }\n}\nfunction getSchEnv(keyRef) {\n keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line\n return this.schemas[keyRef] || this.refs[keyRef];\n}\nfunction addInitialSchemas() {\n const optsSchemas = this.opts.schemas;\n if (!optsSchemas)\n return;\n if (Array.isArray(optsSchemas))\n this.addSchema(optsSchemas);\n else\n for (const key in optsSchemas)\n this.addSchema(optsSchemas[key], key);\n}\nfunction addInitialFormats() {\n for (const name in this.opts.formats) {\n const format = this.opts.formats[name];\n if (format)\n this.addFormat(name, format);\n }\n}\nfunction addInitialKeywords(defs) {\n if (Array.isArray(defs)) {\n this.addVocabulary(defs);\n return;\n }\n this.logger.warn(\"keywords option as map is deprecated, pass array\");\n for (const keyword in defs) {\n const def = defs[keyword];\n if (!def.keyword)\n def.keyword = keyword;\n this.addKeyword(def);\n }\n}\nfunction getMetaSchemaOptions() {\n const metaOpts = { ...this.opts };\n for (const opt of META_IGNORE_OPTIONS)\n delete metaOpts[opt];\n return metaOpts;\n}\nconst noLogs = { log() { }, warn() { }, error() { } };\nfunction getLogger(logger) {\n if (logger === false)\n return noLogs;\n if (logger === undefined)\n return console;\n if (logger.log && logger.warn && logger.error)\n return logger;\n throw new Error(\"logger must implement log, warn and error methods\");\n}\nconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\nfunction checkKeyword(keyword, def) {\n const { RULES } = this;\n (0, util_1.eachItem)(keyword, (kwd) => {\n if (RULES.keywords[kwd])\n throw new Error(`Keyword ${kwd} is already defined`);\n if (!KEYWORD_NAME.test(kwd))\n throw new Error(`Keyword ${kwd} has invalid name`);\n });\n if (!def)\n return;\n if (def.$data && !(\"code\" in def || \"validate\" in def)) {\n throw new Error('$data keyword must have \"code\" or \"validate\" function');\n }\n}\nfunction addRule(keyword, definition, dataType) {\n var _a;\n const post = definition === null || definition === void 0 ? void 0 : definition.post;\n if (dataType && post)\n throw new Error('keyword with \"post\" flag cannot have \"type\"');\n const { RULES } = this;\n let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.rules.push(ruleGroup);\n }\n RULES.keywords[keyword] = true;\n if (!definition)\n return;\n const rule = {\n keyword,\n definition: {\n ...definition,\n type: (0, dataType_1.getJSONTypes)(definition.type),\n schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),\n },\n };\n if (definition.before)\n addBeforeRule.call(this, ruleGroup, rule, definition.before);\n else\n ruleGroup.rules.push(rule);\n RULES.all[keyword] = rule;\n (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));\n}\nfunction addBeforeRule(ruleGroup, rule, before) {\n const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n if (i >= 0) {\n ruleGroup.rules.splice(i, 0, rule);\n }\n else {\n ruleGroup.rules.push(rule);\n this.logger.warn(`rule ${before} is not defined`);\n }\n}\nfunction keywordMetaschema(def) {\n let { metaSchema } = def;\n if (metaSchema === undefined)\n return;\n if (def.$data && this.opts.$data)\n metaSchema = schemaOrData(metaSchema);\n def.validateSchema = this.compile(metaSchema, true);\n}\nconst $dataRef = {\n $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n};\nfunction schemaOrData(schema) {\n return { anyOf: [schema, $dataRef] };\n}\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst def = {\n keyword: \"id\",\n code() {\n throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID');\n },\n};\nexports.default = def;\n//# sourceMappingURL=id.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callRef = exports.getValidate = void 0;\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst compile_1 = require(\"../../compile\");\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"$ref\",\n schemaType: \"string\",\n code(cxt) {\n const { gen, schema: $ref, it } = cxt;\n const { baseId, schemaEnv: env, validateName, opts, self } = it;\n const { root } = env;\n if (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId)\n return callRootRef();\n const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n if (schOrEnv === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n if (schOrEnv instanceof compile_1.SchemaEnv)\n return callValidate(schOrEnv);\n return inlineRefSchema(schOrEnv);\n function callRootRef() {\n if (env === root)\n return callRef(cxt, validateName, env, env.$async);\n const rootName = gen.scopeValue(\"root\", { ref: root });\n return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);\n }\n function callValidate(sch) {\n const v = getValidate(cxt, sch);\n callRef(cxt, v, sch, sch.$async);\n }\n function inlineRefSchema(sch) {\n const schName = gen.scopeValue(\"schema\", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });\n const valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({\n schema: sch,\n dataTypes: [],\n schemaPath: codegen_1.nil,\n topSchemaRef: schName,\n errSchemaPath: $ref,\n }, valid);\n cxt.mergeEvaluated(schCxt);\n cxt.ok(valid);\n }\n },\n};\nfunction getValidate(cxt, sch) {\n const { gen } = cxt;\n return sch.validate\n ? gen.scopeValue(\"validate\", { ref: sch.validate })\n : (0, codegen_1._) `${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n}\nexports.getValidate = getValidate;\nfunction callRef(cxt, v, sch, $async) {\n const { gen, it } = cxt;\n const { allErrors, schemaEnv: env, opts } = it;\n const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n if ($async)\n callAsyncRef();\n else\n callSyncRef();\n function callAsyncRef() {\n if (!env.$async)\n throw new Error(\"async schema referenced by sync schema\");\n const valid = gen.let(\"valid\");\n gen.try(() => {\n gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result\n if (!allErrors)\n gen.assign(valid, true);\n }, (e) => {\n gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n addErrorsFrom(e);\n if (!allErrors)\n gen.assign(valid, false);\n });\n cxt.ok(valid);\n }\n function callSyncRef() {\n cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n }\n function addErrorsFrom(source) {\n const errs = (0, codegen_1._) `${source}.errors`;\n gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged\n gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n }\n function addEvaluatedFrom(source) {\n var _a;\n if (!it.opts.unevaluated)\n return;\n const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n // TODO refactor\n if (it.props !== true) {\n if (schEvaluated && !schEvaluated.dynamicProps) {\n if (schEvaluated.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n }\n }\n else {\n const props = gen.var(\"props\", (0, codegen_1._) `${source}.evaluated.props`);\n it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n }\n }\n if (it.items !== true) {\n if (schEvaluated && !schEvaluated.dynamicItems) {\n if (schEvaluated.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n }\n }\n else {\n const items = gen.var(\"items\", (0, codegen_1._) `${source}.evaluated.items`);\n it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n }\n }\n }\n}\nexports.callRef = callRef;\nexports.default = def;\n//# sourceMappingURL=ref.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst id_1 = require(\"./id\");\nconst ref_1 = require(\"./ref\");\nconst core = [\n \"$schema\",\n \"$id\",\n \"$defs\",\n \"$vocabulary\",\n { keyword: \"$comment\" },\n \"definitions\",\n id_1.default,\n ref_1.default,\n];\nexports.default = core;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst ops = codegen_1.operators;\nconst KWDs = {\n maximum: { okStr: \"<=\", ok: ops.LTE, fail: ops.GT },\n minimum: { okStr: \">=\", ok: ops.GTE, fail: ops.LT },\n exclusiveMaximum: { okStr: \"<\", ok: ops.LT, fail: ops.GTE },\n exclusiveMinimum: { okStr: \">\", ok: ops.GT, fail: ops.LTE },\n};\nconst error = {\n message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,\n params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: Object.keys(KWDs),\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitNumber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,\n params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"multipleOf\",\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, schemaCode, it } = cxt;\n // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)\n const prec = it.opts.multipleOfPrecision;\n const res = gen.let(\"res\");\n const invalid = prec\n ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`\n : (0, codegen_1._) `${res} !== parseInt(${res})`;\n cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=multipleOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nfunction ucs2length(str) {\n const len = str.length;\n let length = 0;\n let pos = 0;\n let value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xfc00) === 0xdc00)\n pos++; // low surrogate\n }\n }\n return length;\n}\nexports.default = ucs2length;\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default';\n//# sourceMappingURL=ucs2length.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst ucs2length_1 = require(\"../../runtime/ucs2length\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxLength\", \"minLength\"],\n type: \"string\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode, it } = cxt;\n const op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitLength.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"pattern\",\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const u = it.opts.unicodeRegExp ? \"u\" : \"\";\n if ($data) {\n const { regExp } = it.opts.code;\n const regExpCode = regExp.code === \"new RegExp\" ? (0, codegen_1._) `new RegExp` : (0, util_1.useFunc)(gen, regExp);\n const valid = gen.let(\"valid\");\n gen.try(() => gen.assign(valid, (0, codegen_1._) `${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));\n cxt.fail$data((0, codegen_1._) `!${valid}`);\n }\n else {\n const regExp = (0, code_1.usePattern)(cxt, schema);\n cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxProperties\", \"minProperties\"],\n type: \"object\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,\n params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,\n};\nconst def = {\n keyword: \"required\",\n type: \"object\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, schema, schemaCode, data, $data, it } = cxt;\n const { opts } = it;\n if (!$data && schema.length === 0)\n return;\n const useLoop = schema.length >= opts.loopRequired;\n if (it.allErrors)\n allErrorsMode();\n else\n exitOnErrorMode();\n if (opts.strictRequired) {\n const props = cxt.parentSchema.properties;\n const { definedProperties } = cxt.it;\n for (const requiredKey of schema) {\n if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n const msg = `required property \"${requiredKey}\" is not defined at \"${schemaPath}\" (strictRequired)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n }\n }\n }\n function allErrorsMode() {\n if (useLoop || $data) {\n cxt.block$data(codegen_1.nil, loopAllRequired);\n }\n else {\n for (const prop of schema) {\n (0, code_1.checkReportMissingProp)(cxt, prop);\n }\n }\n }\n function exitOnErrorMode() {\n const missing = gen.let(\"missing\");\n if (useLoop || $data) {\n const valid = gen.let(\"valid\", true);\n cxt.block$data(valid, () => loopUntilMissing(missing, valid));\n cxt.ok(valid);\n }\n else {\n gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n function loopAllRequired() {\n gen.forOf(\"prop\", schemaCode, (prop) => {\n cxt.setParams({ missingProperty: prop });\n gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n });\n }\n function loopUntilMissing(missing, valid) {\n cxt.setParams({ missingProperty: missing });\n gen.forOf(missing, schemaCode, () => {\n gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error();\n gen.break();\n });\n }, codegen_1.nil);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=required.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxItems\", \"minItems\"],\n type: \"array\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://github.com/ajv-validator/ajv/issues/889\nconst equal = require(\"fast-deep-equal\");\nequal.code = 'require(\"ajv/dist/runtime/equal\").default';\nexports.default = equal;\n//# sourceMappingURL=equal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dataType_1 = require(\"../../compile/validate/dataType\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,\n};\nconst def = {\n keyword: \"uniqueItems\",\n type: \"array\",\n schemaType: \"boolean\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n if (!$data && !schema)\n return;\n const valid = gen.let(\"valid\");\n const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);\n cxt.ok(valid);\n function validateUniqueItems() {\n const i = gen.let(\"i\", (0, codegen_1._) `${data}.length`);\n const j = gen.let(\"j\");\n cxt.setParams({ i, j });\n gen.assign(valid, true);\n gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n }\n function canOptimize() {\n return itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n }\n function loopN(i, j) {\n const item = gen.name(\"item\");\n const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n const indices = gen.const(\"indices\", (0, codegen_1._) `{}`);\n gen.for((0, codegen_1._) `;${i}--;`, () => {\n gen.let(item, (0, codegen_1._) `${data}[${i}]`);\n gen.if(wrongType, (0, codegen_1._) `continue`);\n if (itemTypes.length > 1)\n gen.if((0, codegen_1._) `typeof ${item} == \"string\"`, (0, codegen_1._) `${item} += \"_\"`);\n gen\n .if((0, codegen_1._) `typeof ${indices}[${item}] == \"number\"`, () => {\n gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);\n cxt.error();\n gen.assign(valid, false).break();\n })\n .code((0, codegen_1._) `${indices}[${item}] = ${i}`);\n });\n }\n function loopN2(i, j) {\n const eql = (0, util_1.useFunc)(gen, equal_1.default);\n const outer = gen.name(\"outer\");\n gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {\n cxt.error();\n gen.assign(valid, false).break(outer);\n })));\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=uniqueItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to constant\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"const\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schemaCode, schema } = cxt;\n if ($data || (schema && typeof schema == \"object\")) {\n cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n }\n else {\n cxt.fail((0, codegen_1._) `${schema} !== ${data}`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=const.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to one of the allowed values\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"enum\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n if (!$data && schema.length === 0)\n throw new Error(\"enum must have non-empty array\");\n const useLoop = schema.length >= it.opts.loopEnum;\n let eql;\n const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));\n let valid;\n if (useLoop || $data) {\n valid = gen.let(\"valid\");\n cxt.block$data(valid, loopEnum);\n }\n else {\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const vSchema = gen.const(\"vSchema\", schemaCode);\n valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n }\n cxt.pass(valid);\n function loopEnum() {\n gen.assign(valid, false);\n gen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n }\n function equalCode(vSchema, i) {\n const sch = schema[i];\n return typeof sch === \"object\" && sch !== null\n ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`\n : (0, codegen_1._) `${data} === ${sch}`;\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=enum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst limitNumber_1 = require(\"./limitNumber\");\nconst multipleOf_1 = require(\"./multipleOf\");\nconst limitLength_1 = require(\"./limitLength\");\nconst pattern_1 = require(\"./pattern\");\nconst limitProperties_1 = require(\"./limitProperties\");\nconst required_1 = require(\"./required\");\nconst limitItems_1 = require(\"./limitItems\");\nconst uniqueItems_1 = require(\"./uniqueItems\");\nconst const_1 = require(\"./const\");\nconst enum_1 = require(\"./enum\");\nconst validation = [\n // number\n limitNumber_1.default,\n multipleOf_1.default,\n // string\n limitLength_1.default,\n pattern_1.default,\n // object\n limitProperties_1.default,\n required_1.default,\n // array\n limitItems_1.default,\n uniqueItems_1.default,\n // any\n { keyword: \"type\", schemaType: [\"string\", \"array\"] },\n { keyword: \"nullable\", schemaType: \"boolean\" },\n const_1.default,\n enum_1.default,\n];\nexports.default = validation;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateAdditionalItems = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"additionalItems\",\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { parentSchema, it } = cxt;\n const { items } = parentSchema;\n if (!Array.isArray(items)) {\n (0, util_1.checkStrictMode)(it, '\"additionalItems\" is ignored when \"items\" is not an array of schemas');\n return;\n }\n validateAdditionalItems(cxt, items);\n },\n};\nfunction validateAdditionalItems(cxt, items) {\n const { gen, schema, data, keyword, it } = cxt;\n it.items = true;\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n if (schema === false) {\n cxt.setParams({ len: items.length });\n cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);\n }\n else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.var(\"valid\", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var\n gen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n cxt.ok(valid);\n }\n function validateItems(valid) {\n gen.forRange(\"i\", items.length, len, (i) => {\n cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);\n if (!it.allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n });\n }\n}\nexports.validateAdditionalItems = validateAdditionalItems;\nexports.default = def;\n//# sourceMappingURL=additionalItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateTuple = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"array\", \"boolean\"],\n before: \"uniqueItems\",\n code(cxt) {\n const { schema, it } = cxt;\n if (Array.isArray(schema))\n return validateTuple(cxt, \"additionalItems\", schema);\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n const { gen, parentSchema, data, keyword, it } = cxt;\n checkStrictTuple(parentSchema);\n if (it.opts.unevaluated && schArr.length && it.items !== true) {\n it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n }\n const valid = gen.name(\"valid\");\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n schArr.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({\n keyword,\n schemaProp: i,\n dataProp: i,\n }, valid));\n cxt.ok(valid);\n });\n function checkStrictTuple(sch) {\n const { opts, errSchemaPath } = it;\n const l = schArr.length;\n const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n if (opts.strictTuples && !fullTuple) {\n const msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n }\n }\n}\nexports.validateTuple = validateTuple;\nexports.default = def;\n//# sourceMappingURL=items.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst items_1 = require(\"./items\");\nconst def = {\n keyword: \"prefixItems\",\n type: \"array\",\n schemaType: [\"array\"],\n before: \"uniqueItems\",\n code: (cxt) => (0, items_1.validateTuple)(cxt, \"items\"),\n};\nexports.default = def;\n//# sourceMappingURL=prefixItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst additionalItems_1 = require(\"./additionalItems\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { schema, parentSchema, it } = cxt;\n const { prefixItems } = parentSchema;\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n if (prefixItems)\n (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n else\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nexports.default = def;\n//# sourceMappingURL=items2020.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { min, max } }) => max === undefined\n ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`\n : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,\n params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,\n};\nconst def = {\n keyword: \"contains\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n let min;\n let max;\n const { minContains, maxContains } = parentSchema;\n if (it.opts.next) {\n min = minContains === undefined ? 1 : minContains;\n max = maxContains;\n }\n else {\n min = 1;\n }\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n cxt.setParams({ min, max });\n if (max === undefined && min === 0) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n return;\n }\n if (max !== undefined && min > max) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n cxt.fail();\n return;\n }\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n let cond = (0, codegen_1._) `${len} >= ${min}`;\n if (max !== undefined)\n cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;\n cxt.pass(cond);\n return;\n }\n it.items = true;\n const valid = gen.name(\"valid\");\n if (max === undefined && min === 1) {\n validateItems(valid, () => gen.if(valid, () => gen.break()));\n }\n else if (min === 0) {\n gen.let(valid, true);\n if (max !== undefined)\n gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);\n }\n else {\n gen.let(valid, false);\n validateItemsWithCount();\n }\n cxt.result(valid, () => cxt.reset());\n function validateItemsWithCount() {\n const schValid = gen.name(\"_valid\");\n const count = gen.let(\"count\", 0);\n validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n }\n function validateItems(_valid, block) {\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword: \"contains\",\n dataProp: i,\n dataPropType: util_1.Type.Num,\n compositeRule: true,\n }, _valid);\n block();\n });\n }\n function checkLimits(count) {\n gen.code((0, codegen_1._) `${count}++`);\n if (max === undefined) {\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());\n }\n else {\n gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());\n if (min === 1)\n gen.assign(valid, true);\n else\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=contains.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nexports.error = {\n message: ({ params: { property, depsCount, deps } }) => {\n const property_ies = depsCount === 1 ? \"property\" : \"properties\";\n return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;\n },\n params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`, // TODO change to reference\n};\nconst def = {\n keyword: \"dependencies\",\n type: \"object\",\n schemaType: \"object\",\n error: exports.error,\n code(cxt) {\n const [propDeps, schDeps] = splitDependencies(cxt);\n validatePropertyDeps(cxt, propDeps);\n validateSchemaDeps(cxt, schDeps);\n },\n};\nfunction splitDependencies({ schema }) {\n const propertyDeps = {};\n const schemaDeps = {};\n for (const key in schema) {\n if (key === \"__proto__\")\n continue;\n const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n deps[key] = schema[key];\n }\n return [propertyDeps, schemaDeps];\n}\nfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n const { gen, data, it } = cxt;\n if (Object.keys(propertyDeps).length === 0)\n return;\n const missing = gen.let(\"missing\");\n for (const prop in propertyDeps) {\n const deps = propertyDeps[prop];\n if (deps.length === 0)\n continue;\n const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n cxt.setParams({\n property: prop,\n depsCount: deps.length,\n deps: deps.join(\", \"),\n });\n if (it.allErrors) {\n gen.if(hasProperty, () => {\n for (const depProp of deps) {\n (0, code_1.checkReportMissingProp)(cxt, depProp);\n }\n });\n }\n else {\n gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n}\nexports.validatePropertyDeps = validatePropertyDeps;\nfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n for (const prop in schemaDeps) {\n if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))\n continue;\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);\n cxt.mergeValidEvaluated(schCxt, valid);\n }, () => gen.var(valid, true) // TODO var\n );\n cxt.ok(valid);\n }\n}\nexports.validateSchemaDeps = validateSchemaDeps;\nexports.default = def;\n//# sourceMappingURL=dependencies.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"property name must be valid\",\n params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,\n};\nconst def = {\n keyword: \"propertyNames\",\n type: \"object\",\n schemaType: [\"object\", \"boolean\"],\n error,\n code(cxt) {\n const { gen, schema, data, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n const valid = gen.name(\"valid\");\n gen.forIn(\"key\", data, (key) => {\n cxt.setParams({ propertyName: key });\n cxt.subschema({\n keyword: \"propertyNames\",\n data: key,\n dataTypes: [\"string\"],\n propertyName: key,\n compositeRule: true,\n }, valid);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error(true);\n if (!it.allErrors)\n gen.break();\n });\n });\n cxt.ok(valid);\n },\n};\nexports.default = def;\n//# sourceMappingURL=propertyNames.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must NOT have additional properties\",\n params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,\n};\nconst def = {\n keyword: \"additionalProperties\",\n type: [\"object\"],\n schemaType: [\"boolean\", \"object\"],\n allowUndefined: true,\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, errsCount, it } = cxt;\n /* istanbul ignore if */\n if (!errsCount)\n throw new Error(\"ajv implementation error\");\n const { allErrors, opts } = it;\n it.props = true;\n if (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema))\n return;\n const props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n checkAdditionalProperties();\n cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n function checkAdditionalProperties() {\n gen.forIn(\"key\", data, (key) => {\n if (!props.length && !patProps.length)\n additionalPropertyCode(key);\n else\n gen.if(isAdditional(key), () => additionalPropertyCode(key));\n });\n }\n function isAdditional(key) {\n let definedProp;\n if (props.length > 8) {\n // TODO maybe an option instead of hard-coded 8?\n const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n }\n else if (props.length) {\n definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));\n }\n else {\n definedProp = codegen_1.nil;\n }\n if (patProps.length) {\n definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n }\n return (0, codegen_1.not)(definedProp);\n }\n function deleteAdditional(key) {\n gen.code((0, codegen_1._) `delete ${data}[${key}]`);\n }\n function additionalPropertyCode(key) {\n if (opts.removeAdditional === \"all\" || (opts.removeAdditional && schema === false)) {\n deleteAdditional(key);\n return;\n }\n if (schema === false) {\n cxt.setParams({ additionalProperty: key });\n cxt.error();\n if (!allErrors)\n gen.break();\n return;\n }\n if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.name(\"valid\");\n if (opts.removeAdditional === \"failing\") {\n applyAdditionalSchema(key, valid, false);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.reset();\n deleteAdditional(key);\n });\n }\n else {\n applyAdditionalSchema(key, valid);\n if (!allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n }\n }\n function applyAdditionalSchema(key, valid, errors) {\n const subschema = {\n keyword: \"additionalProperties\",\n dataProp: key,\n dataPropType: util_1.Type.Str,\n };\n if (errors === false) {\n Object.assign(subschema, {\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n });\n }\n cxt.subschema(subschema, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=additionalProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_1 = require(\"../../compile/validate\");\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst def = {\n keyword: \"properties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n if (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === undefined) {\n additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n }\n const allProps = (0, code_1.allSchemaProperties)(schema);\n for (const prop of allProps) {\n it.definedProperties.add(prop);\n }\n if (it.opts.unevaluated && allProps.length && it.props !== true) {\n it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n }\n const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n if (properties.length === 0)\n return;\n const valid = gen.name(\"valid\");\n for (const prop of properties) {\n if (hasDefault(prop)) {\n applyPropertySchema(prop);\n }\n else {\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n applyPropertySchema(prop);\n if (!it.allErrors)\n gen.else().var(valid, true);\n gen.endIf();\n }\n cxt.it.definedProperties.add(prop);\n cxt.ok(valid);\n }\n function hasDefault(prop) {\n return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;\n }\n function applyPropertySchema(prop) {\n cxt.subschema({\n keyword: \"properties\",\n schemaProp: prop,\n dataProp: prop,\n }, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=properties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst util_2 = require(\"../../compile/util\");\nconst def = {\n keyword: \"patternProperties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, data, parentSchema, it } = cxt;\n const { opts } = it;\n const patterns = (0, code_1.allSchemaProperties)(schema);\n const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n if (patterns.length === 0 ||\n (alwaysValidPatterns.length === patterns.length &&\n (!it.opts.unevaluated || it.props === true))) {\n return;\n }\n const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n const valid = gen.name(\"valid\");\n if (it.props !== true && !(it.props instanceof codegen_1.Name)) {\n it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n }\n const { props } = it;\n validatePatternProperties();\n function validatePatternProperties() {\n for (const pat of patterns) {\n if (checkProperties)\n checkMatchingProperties(pat);\n if (it.allErrors) {\n validateProperties(pat);\n }\n else {\n gen.var(valid, true); // TODO var\n validateProperties(pat);\n gen.if(valid);\n }\n }\n }\n function checkMatchingProperties(pat) {\n for (const prop in checkProperties) {\n if (new RegExp(pat).test(prop)) {\n (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n }\n }\n }\n function validateProperties(pat) {\n gen.forIn(\"key\", data, (key) => {\n gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n const alwaysValid = alwaysValidPatterns.includes(pat);\n if (!alwaysValid) {\n cxt.subschema({\n keyword: \"patternProperties\",\n schemaProp: pat,\n dataProp: key,\n dataPropType: util_2.Type.Str,\n }, valid);\n }\n if (it.opts.unevaluated && props !== true) {\n gen.assign((0, codegen_1._) `${props}[${key}]`, true);\n }\n else if (!alwaysValid && !it.allErrors) {\n // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)\n // or if all properties were evaluated (props === true)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=patternProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"not\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n code(cxt) {\n const { gen, schema, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n cxt.fail();\n return;\n }\n const valid = gen.name(\"valid\");\n cxt.subschema({\n keyword: \"not\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, valid);\n cxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n },\n error: { message: \"must NOT be valid\" },\n};\nexports.default = def;\n//# sourceMappingURL=not.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"anyOf\",\n schemaType: \"array\",\n trackErrors: true,\n code: code_1.validateUnion,\n error: { message: \"must match a schema in anyOf\" },\n};\nexports.default = def;\n//# sourceMappingURL=anyOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must match exactly one schema in oneOf\",\n params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,\n};\nconst def = {\n keyword: \"oneOf\",\n schemaType: \"array\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n if (it.opts.discriminator && parentSchema.discriminator)\n return;\n const schArr = schema;\n const valid = gen.let(\"valid\", false);\n const passing = gen.let(\"passing\", null);\n const schValid = gen.name(\"_valid\");\n cxt.setParams({ passing });\n // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas\n gen.block(validateOneOf);\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n function validateOneOf() {\n schArr.forEach((sch, i) => {\n let schCxt;\n if ((0, util_1.alwaysValidSchema)(it, sch)) {\n gen.var(schValid, true);\n }\n else {\n schCxt = cxt.subschema({\n keyword: \"oneOf\",\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n }\n if (i > 0) {\n gen\n .if((0, codegen_1._) `${schValid} && ${valid}`)\n .assign(valid, false)\n .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)\n .else();\n }\n gen.if(schValid, () => {\n gen.assign(valid, true);\n gen.assign(passing, i);\n if (schCxt)\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=oneOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"allOf\",\n schemaType: \"array\",\n code(cxt) {\n const { gen, schema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const valid = gen.name(\"valid\");\n schema.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n const schCxt = cxt.subschema({ keyword: \"allOf\", schemaProp: i }, valid);\n cxt.ok(valid);\n cxt.mergeEvaluated(schCxt);\n });\n },\n};\nexports.default = def;\n//# sourceMappingURL=allOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params }) => (0, codegen_1.str) `must match \"${params.ifClause}\" schema`,\n params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,\n};\nconst def = {\n keyword: \"if\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, parentSchema, it } = cxt;\n if (parentSchema.then === undefined && parentSchema.else === undefined) {\n (0, util_1.checkStrictMode)(it, '\"if\" without \"then\" and \"else\" is ignored');\n }\n const hasThen = hasSchema(it, \"then\");\n const hasElse = hasSchema(it, \"else\");\n if (!hasThen && !hasElse)\n return;\n const valid = gen.let(\"valid\", true);\n const schValid = gen.name(\"_valid\");\n validateIf();\n cxt.reset();\n if (hasThen && hasElse) {\n const ifClause = gen.let(\"ifClause\");\n cxt.setParams({ ifClause });\n gen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n }\n else if (hasThen) {\n gen.if(schValid, validateClause(\"then\"));\n }\n else {\n gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n }\n cxt.pass(valid, () => cxt.error(true));\n function validateIf() {\n const schCxt = cxt.subschema({\n keyword: \"if\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, schValid);\n cxt.mergeEvaluated(schCxt);\n }\n function validateClause(keyword, ifClause) {\n return () => {\n const schCxt = cxt.subschema({ keyword }, schValid);\n gen.assign(valid, schValid);\n cxt.mergeValidEvaluated(schCxt, valid);\n if (ifClause)\n gen.assign(ifClause, (0, codegen_1._) `${keyword}`);\n else\n cxt.setParams({ ifClause: keyword });\n };\n }\n },\n};\nfunction hasSchema(it, keyword) {\n const schema = it.schema[keyword];\n return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);\n}\nexports.default = def;\n//# sourceMappingURL=if.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: [\"then\", \"else\"],\n schemaType: [\"object\", \"boolean\"],\n code({ keyword, parentSchema, it }) {\n if (parentSchema.if === undefined)\n (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=thenElse.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst additionalItems_1 = require(\"./additionalItems\");\nconst prefixItems_1 = require(\"./prefixItems\");\nconst items_1 = require(\"./items\");\nconst items2020_1 = require(\"./items2020\");\nconst contains_1 = require(\"./contains\");\nconst dependencies_1 = require(\"./dependencies\");\nconst propertyNames_1 = require(\"./propertyNames\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst properties_1 = require(\"./properties\");\nconst patternProperties_1 = require(\"./patternProperties\");\nconst not_1 = require(\"./not\");\nconst anyOf_1 = require(\"./anyOf\");\nconst oneOf_1 = require(\"./oneOf\");\nconst allOf_1 = require(\"./allOf\");\nconst if_1 = require(\"./if\");\nconst thenElse_1 = require(\"./thenElse\");\nfunction getApplicator(draft2020 = false) {\n const applicator = [\n // any\n not_1.default,\n anyOf_1.default,\n oneOf_1.default,\n allOf_1.default,\n if_1.default,\n thenElse_1.default,\n // object\n propertyNames_1.default,\n additionalProperties_1.default,\n dependencies_1.default,\n properties_1.default,\n patternProperties_1.default,\n ];\n // array\n if (draft2020)\n applicator.push(prefixItems_1.default, items2020_1.default);\n else\n applicator.push(additionalItems_1.default, items_1.default);\n applicator.push(contains_1.default);\n return applicator;\n}\nexports.default = getApplicator;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match format \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"format\",\n type: [\"number\", \"string\"],\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt, ruleType) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const { opts, errSchemaPath, schemaEnv, self } = it;\n if (!opts.validateFormats)\n return;\n if ($data)\n validate$DataFormat();\n else\n validateFormat();\n function validate$DataFormat() {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n });\n const fDef = gen.const(\"fDef\", (0, codegen_1._) `${fmts}[${schemaCode}]`);\n const fType = gen.let(\"fType\");\n const format = gen.let(\"format\");\n // TODO simplify\n gen.if((0, codegen_1._) `typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || \"string\"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `\"string\"`).assign(format, fDef));\n cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n function unknownFmt() {\n if (opts.strictSchema === false)\n return codegen_1.nil;\n return (0, codegen_1._) `${schemaCode} && !${format}`;\n }\n function invalidFmt() {\n const callFormat = schemaEnv.$async\n ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`\n : (0, codegen_1._) `${format}(${data})`;\n const validData = (0, codegen_1._) `(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n }\n }\n function validateFormat() {\n const formatDef = self.formats[schema];\n if (!formatDef) {\n unknownFormat();\n return;\n }\n if (formatDef === true)\n return;\n const [fmtType, format, fmtRef] = getFormat(formatDef);\n if (fmtType === ruleType)\n cxt.pass(validCondition());\n function unknownFormat() {\n if (opts.strictSchema === false) {\n self.logger.warn(unknownMsg());\n return;\n }\n throw new Error(unknownMsg());\n function unknownMsg() {\n return `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n }\n }\n function getFormat(fmtDef) {\n const code = fmtDef instanceof RegExp\n ? (0, codegen_1.regexpCode)(fmtDef)\n : opts.code.formats\n ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`\n : undefined;\n const fmt = gen.scopeValue(\"formats\", { key: schema, ref: fmtDef, code });\n if (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) {\n return [fmtDef.type || \"string\", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];\n }\n return [\"string\", fmtDef, fmt];\n }\n function validCondition() {\n if (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n if (!schemaEnv.$async)\n throw new Error(\"async format in sync schema\");\n return (0, codegen_1._) `await ${fmtRef}(${data})`;\n }\n return typeof format == \"function\" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=format.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst format_1 = require(\"./format\");\nconst format = [format_1.default];\nexports.default = format;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.contentVocabulary = exports.metadataVocabulary = void 0;\nexports.metadataVocabulary = [\n \"title\",\n \"description\",\n \"default\",\n \"deprecated\",\n \"readOnly\",\n \"writeOnly\",\n \"examples\",\n];\nexports.contentVocabulary = [\n \"contentMediaType\",\n \"contentEncoding\",\n \"contentSchema\",\n];\n//# sourceMappingURL=metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"./core\");\nconst validation_1 = require(\"./validation\");\nconst applicator_1 = require(\"./applicator\");\nconst format_1 = require(\"./format\");\nconst metadata_1 = require(\"./metadata\");\nconst draft7Vocabularies = [\n core_1.default,\n validation_1.default,\n (0, applicator_1.default)(),\n format_1.default,\n metadata_1.metadataVocabulary,\n metadata_1.contentVocabulary,\n];\nexports.default = draft7Vocabularies;\n//# sourceMappingURL=draft7.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscrError = void 0;\nvar DiscrError;\n(function (DiscrError) {\n DiscrError[\"Tag\"] = \"tag\";\n DiscrError[\"Mapping\"] = \"mapping\";\n})(DiscrError || (exports.DiscrError = DiscrError = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst types_1 = require(\"../discriminator/types\");\nconst compile_1 = require(\"../../compile\");\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag\n ? `tag \"${tagName}\" must be string`\n : `value of tag \"${tagName}\" must be in oneOf`,\n params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,\n};\nconst def = {\n keyword: \"discriminator\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt) {\n const { gen, data, schema, parentSchema, it } = cxt;\n const { oneOf } = parentSchema;\n if (!it.opts.discriminator) {\n throw new Error(\"discriminator: requires discriminator option\");\n }\n const tagName = schema.propertyName;\n if (typeof tagName != \"string\")\n throw new Error(\"discriminator: requires propertyName\");\n if (schema.mapping)\n throw new Error(\"discriminator: mapping is not supported\");\n if (!oneOf)\n throw new Error(\"discriminator: requires oneOf keyword\");\n const valid = gen.let(\"valid\", false);\n const tag = gen.const(\"tag\", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);\n gen.if((0, codegen_1._) `typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));\n cxt.ok(valid);\n function validateMapping() {\n const mapping = getMapping();\n gen.if(false);\n for (const tagValue in mapping) {\n gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);\n gen.assign(valid, applyTagSchema(mapping[tagValue]));\n }\n gen.else();\n cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });\n gen.endIf();\n }\n function applyTagSchema(schemaProp) {\n const _valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({ keyword: \"oneOf\", schemaProp }, _valid);\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n return _valid;\n }\n function getMapping() {\n var _a;\n const oneOfMapping = {};\n const topRequired = hasRequired(parentSchema);\n let tagRequired = true;\n for (let i = 0; i < oneOf.length; i++) {\n let sch = oneOf[i];\n if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n const ref = sch.$ref;\n sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n if (sch instanceof compile_1.SchemaEnv)\n sch = sch.schema;\n if (sch === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n }\n const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n if (typeof propSch != \"object\") {\n throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n }\n tagRequired = tagRequired && (topRequired || hasRequired(sch));\n addMappings(propSch, i);\n }\n if (!tagRequired)\n throw new Error(`discriminator: \"${tagName}\" must be required`);\n return oneOfMapping;\n function hasRequired({ required }) {\n return Array.isArray(required) && required.includes(tagName);\n }\n function addMappings(sch, i) {\n if (sch.const) {\n addMapping(sch.const, i);\n }\n else if (sch.enum) {\n for (const tagValue of sch.enum) {\n addMapping(tagValue, i);\n }\n }\n else {\n throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n }\n }\n function addMapping(tagValue, i) {\n if (typeof tagValue != \"string\" || tagValue in oneOfMapping) {\n throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n }\n oneOfMapping[tagValue] = i;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=index.js.map","","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;\nconst core_1 = require(\"./core\");\nconst draft7_1 = require(\"./vocabularies/draft7\");\nconst discriminator_1 = require(\"./vocabularies/discriminator\");\nconst draft7MetaSchema = require(\"./refs/json-schema-draft-07.json\");\nconst META_SUPPORT_DATA = [\"/properties\"];\nconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\";\nclass Ajv extends core_1.default {\n _addVocabularies() {\n super._addVocabularies();\n draft7_1.default.forEach((v) => this.addVocabulary(v));\n if (this.opts.discriminator)\n this.addKeyword(discriminator_1.default);\n }\n _addDefaultMetaSchema() {\n super._addDefaultMetaSchema();\n if (!this.opts.meta)\n return;\n const metaSchema = this.opts.$data\n ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)\n : draft7MetaSchema;\n this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);\n this.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n }\n defaultMeta() {\n return (this.opts.defaultMeta =\n super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));\n }\n}\nexports.Ajv = Ajv;\nmodule.exports = exports = Ajv;\nmodule.exports.Ajv = Ajv;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Ajv;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nvar validation_error_1 = require(\"./runtime/validation_error\");\nObject.defineProperty(exports, \"ValidationError\", { enumerable: true, get: function () { return validation_error_1.default; } });\nvar ref_error_1 = require(\"./compile/ref_error\");\nObject.defineProperty(exports, \"MissingRefError\", { enumerable: true, get: function () { return ref_error_1.default; } });\n//# sourceMappingURL=ajv.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ajv_1 = require(\"ajv\");\nconst codegen_1 = require(\"ajv/dist/compile/codegen\");\nconst code_1 = require(\"ajv/dist/compile/codegen/code\");\nconst validate_1 = require(\"ajv/dist/compile/validate\");\nconst errors_1 = require(\"ajv/dist/compile/errors\");\nconst names_1 = require(\"ajv/dist/compile/names\");\nconst keyword = \"errorMessage\";\nconst used = new ajv_1.Name(\"emUsed\");\nconst KEYWORD_PROPERTY_PARAMS = {\n required: \"missingProperty\",\n dependencies: \"property\",\n dependentRequired: \"property\",\n};\nconst INTERPOLATION = /\\$\\{[^}]+\\}/;\nconst INTERPOLATION_REPLACE = /\\$\\{([^}]+)\\}/g;\nconst EMPTY_STR = /^\"\"\\s*\\+\\s*|\\s*\\+\\s*\"\"$/g;\nfunction errorMessage(options) {\n return {\n keyword,\n schemaType: [\"string\", \"object\"],\n post: true,\n code(cxt) {\n const { gen, data, schema, schemaValue, it } = cxt;\n if (it.createErrors === false)\n return;\n const sch = schema;\n const instancePath = codegen_1.strConcat(names_1.default.instancePath, it.errorPath);\n gen.if(ajv_1._ `${names_1.default.errors} > 0`, () => {\n if (typeof sch == \"object\") {\n const [kwdPropErrors, kwdErrors] = keywordErrorsConfig(sch);\n if (kwdErrors)\n processKeywordErrors(kwdErrors);\n if (kwdPropErrors)\n processKeywordPropErrors(kwdPropErrors);\n processChildErrors(childErrorsConfig(sch));\n }\n const schMessage = typeof sch == \"string\" ? sch : sch._;\n if (schMessage)\n processAllErrors(schMessage);\n if (!options.keepErrors)\n removeUsedErrors();\n });\n function childErrorsConfig({ properties, items }) {\n const errors = {};\n if (properties) {\n errors.props = {};\n for (const p in properties)\n errors.props[p] = [];\n }\n if (items) {\n errors.items = {};\n for (let i = 0; i < items.length; i++)\n errors.items[i] = [];\n }\n return errors;\n }\n function keywordErrorsConfig(emSchema) {\n let propErrors;\n let errors;\n for (const k in emSchema) {\n if (k === \"properties\" || k === \"items\")\n continue;\n const kwdSch = emSchema[k];\n if (typeof kwdSch == \"object\") {\n propErrors || (propErrors = {});\n const errMap = (propErrors[k] = {});\n for (const p in kwdSch)\n errMap[p] = [];\n }\n else {\n errors || (errors = {});\n errors[k] = [];\n }\n }\n return [propErrors, errors];\n }\n function processKeywordErrors(kwdErrors) {\n const kwdErrs = gen.const(\"emErrors\", ajv_1.stringify(kwdErrors));\n const templates = gen.const(\"templates\", getTemplatesCode(kwdErrors, schema));\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => gen.code(ajv_1._ `${kwdErrs}[${err}.keyword].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n const { singleError } = options;\n if (singleError) {\n const message = gen.let(\"message\", ajv_1._ `\"\"`);\n const paramsErrors = gen.let(\"paramsErrors\", ajv_1._ `[]`);\n loopErrors((key) => {\n gen.if(message, () => gen.code(ajv_1._ `${message} += ${typeof singleError == \"string\" ? singleError : \";\"}`));\n gen.code(ajv_1._ `${message} += ${errMessage(key)}`);\n gen.assign(paramsErrors, ajv_1._ `${paramsErrors}.concat(${kwdErrs}[${key}])`);\n });\n errors_1.reportError(cxt, { message, params: ajv_1._ `{errors: ${paramsErrors}}` });\n }\n else {\n loopErrors((key) => errors_1.reportError(cxt, {\n message: errMessage(key),\n params: ajv_1._ `{errors: ${kwdErrs}[${key}]}`,\n }));\n }\n function loopErrors(body) {\n gen.forIn(\"key\", kwdErrs, (key) => gen.if(ajv_1._ `${kwdErrs}[${key}].length`, () => body(key)));\n }\n function errMessage(key) {\n return ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}[${key}]`;\n }\n }\n function processKeywordPropErrors(kwdPropErrors) {\n const kwdErrs = gen.const(\"emErrors\", ajv_1.stringify(kwdPropErrors));\n const templatesCode = [];\n for (const k in kwdPropErrors) {\n templatesCode.push([\n k,\n getTemplatesCode(kwdPropErrors[k], schema[k]),\n ]);\n }\n const templates = gen.const(\"templates\", gen.object(...templatesCode));\n const kwdPropParams = gen.scopeValue(\"obj\", {\n ref: KEYWORD_PROPERTY_PARAMS,\n code: ajv_1.stringify(KEYWORD_PROPERTY_PARAMS),\n });\n const propParam = gen.let(\"emPropParams\");\n const paramsErrors = gen.let(\"emParamsErrors\");\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => {\n gen.assign(propParam, ajv_1._ `${kwdPropParams}[${err}.keyword]`);\n gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${err}.keyword][${err}.params[${propParam}]]`);\n gen.if(paramsErrors, () => gen.code(ajv_1._ `${paramsErrors}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true));\n }));\n gen.forIn(\"key\", kwdErrs, (key) => gen.forIn(\"keyProp\", ajv_1._ `${kwdErrs}[${key}]`, (keyProp) => {\n gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${key}][${keyProp}]`);\n gen.if(ajv_1._ `${paramsErrors}.length`, () => {\n const tmpl = gen.const(\"tmpl\", ajv_1._ `${templates}[${key}] && ${templates}[${key}][${keyProp}]`);\n errors_1.reportError(cxt, {\n message: ajv_1._ `${tmpl} ? ${tmpl}() : ${schemaValue}[${key}][${keyProp}]`,\n params: ajv_1._ `{errors: ${paramsErrors}}`,\n });\n });\n }));\n }\n function processChildErrors(childErrors) {\n const { props, items } = childErrors;\n if (!props && !items)\n return;\n const isObj = ajv_1._ `typeof ${data} == \"object\"`;\n const isArr = ajv_1._ `Array.isArray(${data})`;\n const childErrs = gen.let(\"emErrors\");\n let childKwd;\n let childProp;\n const templates = gen.let(\"templates\");\n if (props && items) {\n childKwd = gen.let(\"emChildKwd\");\n gen.if(isObj);\n gen.if(isArr, () => {\n init(items, schema.items);\n gen.assign(childKwd, ajv_1.str `items`);\n }, () => {\n init(props, schema.properties);\n gen.assign(childKwd, ajv_1.str `properties`);\n });\n childProp = ajv_1._ `[${childKwd}]`;\n }\n else if (items) {\n gen.if(isArr);\n init(items, schema.items);\n childProp = ajv_1._ `.items`;\n }\n else if (props) {\n gen.if(codegen_1.and(isObj, codegen_1.not(isArr)));\n init(props, schema.properties);\n childProp = ajv_1._ `.properties`;\n }\n gen.forOf(\"err\", names_1.default.vErrors, (err) => ifMatchesChildError(err, childErrs, (child) => gen.code(ajv_1._ `${childErrs}[${child}].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n gen.forIn(\"key\", childErrs, (key) => gen.if(ajv_1._ `${childErrs}[${key}].length`, () => {\n errors_1.reportError(cxt, {\n message: ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}${childProp}[${key}]`,\n params: ajv_1._ `{errors: ${childErrs}[${key}]}`,\n });\n gen.assign(ajv_1._ `${names_1.default.vErrors}[${names_1.default.errors}-1].instancePath`, ajv_1._ `${instancePath} + \"/\" + ${key}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`);\n }));\n gen.endIf();\n function init(children, msgs) {\n gen.assign(childErrs, ajv_1.stringify(children));\n gen.assign(templates, getTemplatesCode(children, msgs));\n }\n }\n function processAllErrors(schMessage) {\n const errs = gen.const(\"emErrs\", ajv_1._ `[]`);\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(matchAnyError(err), () => gen.code(ajv_1._ `${errs}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));\n gen.if(ajv_1._ `${errs}.length`, () => errors_1.reportError(cxt, {\n message: templateExpr(schMessage),\n params: ajv_1._ `{errors: ${errs}}`,\n }));\n }\n function removeUsedErrors() {\n const errs = gen.const(\"emErrs\", ajv_1._ `[]`);\n gen.forOf(\"err\", names_1.default.vErrors, (err) => gen.if(ajv_1._ `!${err}.${used}`, () => gen.code(ajv_1._ `${errs}.push(${err})`)));\n gen.assign(names_1.default.vErrors, errs).assign(names_1.default.errors, ajv_1._ `${errs}.length`);\n }\n function matchKeywordError(err, kwdErrs) {\n return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath === ${instancePath}`, ajv_1._ `${err}.keyword in ${kwdErrs}`, \n // TODO match the end of the string?\n ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `/^\\\\/[^\\\\/]*$/.test(${err}.schemaPath.slice(${it.errSchemaPath.length}))`);\n }\n function ifMatchesChildError(err, childErrs, thenBody) {\n gen.if(codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`), () => {\n const childRegex = gen.scopeValue(\"pattern\", {\n ref: /^\\/([^/]*)(?:\\/|$)/,\n code: ajv_1._ `new RegExp(\"^\\\\\\/([^/]*)(?:\\\\\\/|$)\")`,\n });\n const matches = gen.const(\"emMatches\", ajv_1._ `${childRegex}.exec(${err}.instancePath.slice(${instancePath}.length))`);\n const child = gen.const(\"emChild\", ajv_1._ `${matches} && ${matches}[1].replace(/~1/g, \"/\").replace(/~0/g, \"~\")`);\n gen.if(ajv_1._ `${child} !== undefined && ${child} in ${childErrs}`, () => thenBody(child));\n });\n }\n function matchAnyError(err) {\n return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, codegen_1.or(ajv_1._ `${err}.instancePath === ${instancePath}`, codegen_1.and(ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`, ajv_1._ `${err}.instancePath[${instancePath}.length] === \"/\"`)), ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `${err}.schemaPath[${it.errSchemaPath}.length] === \"/\"`);\n }\n function getTemplatesCode(keys, msgs) {\n const templatesCode = [];\n for (const k in keys) {\n const msg = msgs[k];\n if (INTERPOLATION.test(msg))\n templatesCode.push([k, templateFunc(msg)]);\n }\n return gen.object(...templatesCode);\n }\n function templateExpr(msg) {\n if (!INTERPOLATION.test(msg))\n return ajv_1.stringify(msg);\n return new code_1._Code(code_1.safeStringify(msg)\n .replace(INTERPOLATION_REPLACE, (_s, ptr) => `\" + JSON.stringify(${validate_1.getData(ptr, it)}) + \"`)\n .replace(EMPTY_STR, \"\"));\n }\n function templateFunc(msg) {\n return ajv_1._ `function(){return ${templateExpr(msg)}}`;\n }\n },\n metaSchema: {\n anyOf: [\n { type: \"string\" },\n {\n type: \"object\",\n properties: {\n properties: { $ref: \"#/$defs/stringMap\" },\n items: { $ref: \"#/$defs/stringList\" },\n required: { $ref: \"#/$defs/stringOrMap\" },\n dependencies: { $ref: \"#/$defs/stringOrMap\" },\n },\n additionalProperties: { type: \"string\" },\n },\n ],\n $defs: {\n stringMap: {\n type: \"object\",\n additionalProperties: { type: \"string\" },\n },\n stringOrMap: {\n anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/stringMap\" }],\n },\n stringList: { type: \"array\", items: { type: \"string\" } },\n },\n },\n };\n}\nconst ajvErrors = (ajv, options = {}) => {\n if (!ajv.opts.allErrors)\n throw new Error(\"ajv-errors: Ajv option allErrors must be true\");\n if (ajv.opts.jsPropertySyntax) {\n throw new Error(\"ajv-errors: ajv option jsPropertySyntax is not supported\");\n }\n return ajv.addKeyword(errorMessage(options));\n};\nexports.default = ajvErrors;\nmodule.exports = ajvErrors;\nmodule.exports.default = ajvErrors;\n//# sourceMappingURL=index.js.map","// Ajv, ajv-errors, and their runtime dependency closure are bundled by tsdown.\n// eslint-disable-next-line import-x/no-extraneous-dependencies\nimport Ajv from 'ajv';\n// eslint-disable-next-line import-x/no-extraneous-dependencies\nimport ajvErrors from 'ajv-errors';\n\n/**\nLazily creates (and memoizes) the shared Ajv instance.\n\n@returns {Ajv} The shared Ajv instance.\n*/\nconst getAjv = ((): (() => Ajv) => {\n let ajvInstance: Ajv | undefined;\n\n return (): Ajv => {\n if (!ajvInstance) {\n ajvInstance = new Ajv({allErrors: true});\n ajvErrors(ajvInstance);\n }\n\n return ajvInstance;\n };\n})();\n\n/**\nFormats an array of schema validation errors.\n\n@param {Array} errors An array of error messages to format.\n@returns {String} Formatted error message\n*/\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst formatSchemaErrors = (errors) => errors.map((error) => `\\t- ${error.message}\\n`).join('');\n\nconst standardRuleSchema = {\n type: 'string',\n enum: ['off', 'warning', 'error'],\n errorMessage: {\n type: 'severity must be a string.',\n enum: 'severity must be either \"off\", \"warning\", or \"error\".',\n },\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst arrayRuleSchema = (minItems: any): any => ({\n type: 'array',\n items: [\n standardRuleSchema,\n {\n type: 'array',\n minItems,\n uniqueItems: true,\n errorMessage: {\n type: 'the second item in an array rule config must be an array.',\n minItems: 'the second item in an array rule config must have at least 1 item.',\n uniqueItems: 'the second item in an array rule config must have unique items.',\n },\n },\n ],\n minItems: 2,\n maxItems: 2,\n additionalItems: false,\n errorMessage: {\n type: 'rule config must be an array, e.g. [\"error\", [\"value1\", \"value2\"]].',\n minItems: 'array rules must have two items, severity and options array. e.g. [\"error\", [\"value1\", \"value2\"]].',\n maxItems: 'array rules must have two items, severity and options array. e.g. [\"error\", [\"value1\", \"value2\"]].',\n additionalItems:\n 'array rules are only allowed two items, severity and the list is values. e.g. [\"error\", [\"value1\", \"value2\"]].',\n },\n});\n\nconst objectRuleSchema = {\n type: 'array',\n items: [\n standardRuleSchema,\n {\n type: 'object',\n errorMessage: {\n type: 'the second item in an object rule config must be an object.',\n },\n },\n ],\n minItems: 2,\n maxItems: 2,\n additionalItems: false,\n errorMessage: {\n type: 'rule config must be an array, e.g. [\"error\", {}].',\n minItems: 'object rules must have two items, severity and options object. e.g. [\"error\", {}].',\n maxItems: 'object rules must have two items, severity and options object. e.g. [\"error\", {}].',\n additionalItems: 'object rules are only allowed two items, severity and options object. e.g. [\"error\", {}].',\n },\n};\n\nconst optionalObjExceptionsSchema = {\n type: 'array',\n items: [\n {\n type: 'string',\n errorMessage: {\n type: 'each exception must be a string.',\n },\n },\n ],\n uniqueItems: true,\n minItems: 1,\n errorMessage: {\n type: 'expections must be an array.',\n minItems: 'expections must have at least 1 item.',\n uniqueItems: 'expections must have unique items.',\n },\n};\n\nconst configurationSchema = {\n type: 'object',\n properties: {\n extends: {\n type: ['string', 'array'],\n items: {\n type: 'string',\n },\n minItems: 1,\n uniqueItems: true,\n errorMessage: {\n type: 'extends must be either a string or an array of strings.',\n minItems: 'extends must have at least one item if it is an array.',\n uniqueItems: 'extends must have unique items if it is an array.',\n },\n },\n rules: {\n type: 'object',\n errorMessage: {\n type: 'rules must be an object.',\n },\n },\n root: {\n type: 'boolean',\n errorMessage: {\n type: 'root must be a boolean.',\n },\n },\n },\n additionalProperties: false,\n errorMessage: {\n type: 'npm-package-json-lint config should be an object.',\n additionalProperties:\n 'npm-package-json-lint config has unexpected top-level property. Valid properties include: `extends`, `rules`, and `root`.',\n },\n};\n\n/**\nValidates standard rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isStandardRuleSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(standardRuleSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates array rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@param {number} minItems Min number of items in the array\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isArrayRuleSchemaValid = (ruleConfig: any, minItems: any): any => {\n const validate = getAjv().compile(arrayRuleSchema(minItems));\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates array rules config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isObjectRuleSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(objectRuleSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates optional object exceptions config.\n\n@param {Object} ruleConfig The ruleConfig object to validate.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isOptionalObjExceptSchemaValid = (ruleConfig: any): any => {\n const validate = getAjv().compile(optionalObjExceptionsSchema);\n const isValid = validate(ruleConfig);\n\n if (!isValid) {\n throw new Error(formatSchemaErrors(validate.errors));\n }\n\n return true;\n};\n\n/**\nValidates the top level properties of the config object.\n\n@param {Object} config The config object to validate.\n@param {string} source The name of the configuration source to report in any errors.\n@returns {boolean} True if valid. Error if not.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isConfigObjectSchemaValid = (config: any, source: any): any => {\n const validate = getAjv().compile(configurationSchema);\n const isValid = validate(config);\n\n if (!isValid) {\n throw new Error(`npm-package-json-lint configuration in ${source} is invalid:\\n${formatSchemaErrors(validate.errors)}`);\n }\n\n return true;\n};\n","import {RuleType} from '../types/rule-type';\nimport {\n isArrayRuleSchemaValid,\n isConfigObjectSchemaValid,\n isObjectRuleSchemaValid,\n isOptionalObjExceptSchemaValid,\n isStandardRuleSchemaValid,\n} from './ConfigSchema';\n\n/**\nValidates object rule config\n\n@param {Object} ruleConfig Object rule\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isObjectRuleConfigValid = (ruleConfig: any): any => {\n if (typeof ruleConfig === 'string' && ruleConfig === 'off') {\n return true;\n }\n\n if (typeof ruleConfig === 'string' && ruleConfig !== 'off') {\n throw new Error('\\t- is an object type rule. It must be set to \"off\" if an object is not supplied.');\n }\n\n return isObjectRuleSchemaValid(ruleConfig);\n};\n\n/**\nValidates optional object rule config\n\n@param {Object} ruleConfig Object rule\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isOptionalObjRuleConfigValid = (ruleConfig: any): any => {\n if (typeof ruleConfig === 'string') {\n return isStandardRuleSchemaValid(ruleConfig);\n }\n\n const object = 1;\n\n return isObjectRuleSchemaValid(ruleConfig) && ruleConfig[object].hasOwnProperty('exceptions')\n ? isOptionalObjExceptSchemaValid(ruleConfig[object].exceptions)\n : true;\n};\n\n/**\nValidates array rule config\n\n@param {Array} ruleConfig Array rule\n@param {number} minItems Min number of items in the array\n@return {Boolean} True if config is valid, false if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isArrayRuleConfigValid = (ruleConfig: any, minItems: any): any => {\n if (typeof ruleConfig === 'string' && ruleConfig === 'off') {\n return true;\n }\n\n if (typeof ruleConfig === 'string' && ruleConfig !== 'off') {\n throw new Error('\\t- is an array type rule. It must be set to \"off\" if an array is not supplied.');\n }\n\n return isArrayRuleSchemaValid(ruleConfig, minItems);\n};\n\n/**\nValidates standard rule config\n\n@param {Object} ruleConfig Value for standard rule config\n@return {Boolean} True if config is valid, error if not\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isStandardRuleConfigValid = (ruleConfig: any): any => isStandardRuleSchemaValid(ruleConfig);\n\n/**\nValidates configuration of a rule\n\n@param {Object} ruleModule The rule object.\n@param {string} ruleName The rule's unique name.\n@param {Array|String} userConfig The user's configuration for a rule.\n@param {String|null} source The name of the configuration source to report in any errors.\n@returns {undefined} No return\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst validateRule = (ruleModule: any, ruleName: any, userConfig: any, source: any): any => {\n if (ruleModule) {\n try {\n switch (ruleModule.ruleType) {\n case RuleType.Array: {\n isArrayRuleConfigValid(userConfig, ruleModule.minItems);\n\n break;\n }\n case RuleType.Object: {\n isObjectRuleConfigValid(userConfig);\n\n break;\n }\n case RuleType.OptionalObject: {\n isOptionalObjRuleConfigValid(userConfig);\n\n break;\n }\n default: {\n isStandardRuleConfigValid(userConfig);\n }\n }\n } catch (error_) {\n const modifiedErrorMessage = `Configuration for rule \"${ruleName}\" is invalid:\\n${error_.message}`;\n\n const error = new Error(typeof source === 'string' ? `${source}:\\n\\t${modifiedErrorMessage}` : modifiedErrorMessage);\n\n throw error;\n }\n }\n};\n\n/**\nValidates only the rules of a config object\n\n@param {Object} rulesConfig The rules config object to validate.\n@param {String} source The name of the configuration source to report in any errors.\n@param {Object} rules Rules object\n@returns {undefined} No return\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const validateRules = (rulesConfig: any, source: any, rules: any): any => {\n if (!rulesConfig) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n Object.keys(rulesConfig).forEach((ruleName) => {\n const ruleModule = rules.get(ruleName);\n\n validateRule(ruleModule, ruleName, rulesConfig[ruleName], source);\n });\n};\n\n/**\nValidates entire config object, including top-level properties.\n\n@param {Object} config The config object to validate.\n@param {String} source The name of the configuration source to report in any errors.\n@param {Object} rules Rules object\n@returns {undefined} No return\n@static\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const validate = (config: any, source: any, rules: any): any => {\n isConfigObjectSchemaValid(config, source);\n validateRules(config.rules, source, rules);\n};\n","import fs from 'node:fs';\nimport stripComments from 'strip-json-comments';\n\n/**\nRequire JavaScript file\n\n@param fileName String file path of file to load\n@internal\n*/\n// eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\nconst requireFile = (fileName: string): NodeRequire => require(fileName);\n\n/**\nSychronously reads file from file system\n\n@param fileName String file path of file to load\n@internal\n*/\nconst readFile = (fileName: string): string => fs.readFileSync(fileName, 'utf8').replace(/^\\u{FEFF}/u, '');\n\n/**\nHelper method for throwing errors when file fails to load.\n\n@param fileName Name of the file that failed to load.\n@param err Error object\n@throws {Error}\n@internal\n*/\nconst handleError = (fileName: string, err: Error): void => {\n throw new Error(`Failed to read config file: ${fileName}. \\nError: ${err.message}`);\n};\n\n// The parser and rules are bundled separately, so they must share the same metadata key.\nexport const sourceSymbol = Symbol.for('npm-package-json-lint:JSON-source');\n\n/**\nParse a JSON file\n\n@param fileName String file path of file to load\n@return Valid JSON\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const parseJsonFile = (fileName: string): Record<string, any> => {\n let json = {};\n let fileContents = '';\n\n try {\n fileContents = readFile(fileName);\n\n json = JSON.parse(stripComments(fileContents));\n } catch (error) {\n handleError(fileName, error);\n }\n\n Object.defineProperty(json, sourceSymbol, {\n value: fileContents,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n\n return json;\n};\n\n/**\nParse a JavaScript file\n\n@param fileName String file path of file to load\n@return Valid JavaScript object\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const parseJavaScriptFile = (fileName: string): Record<string, any> => {\n let obj = {};\n\n try {\n obj = requireFile(fileName);\n } catch (error) {\n handleError(fileName, error);\n }\n\n return obj;\n};\n","","/**\nBuilt-in default rule configuration.\n\nExtend it with `\"extends\": \"npm-package-json-lint:default\"` in a\n.npmpackagejsonlintrc.json file.\n*/\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nexport const defaultConfig = require('./default-rules.json');\n","import path from 'node:path';\nimport {parseJavaScriptFile, parseJsonFile} from '../file-parser';\nimport {defaultConfig} from './default';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:applyExtendsIfSpecified');\n\n/**\nBuilt-in configs that can be extended without installing a separate module.\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst virtualConfigs = new Map<string, any>([['npm-package-json-lint:default', defaultConfig]]);\n\n/**\nApplies values from the 'extends' field in a configuration file.\n\n@param {Object} config The configuration information.\n@param {string} parentName Name of parent. For troubleshooting.\n@param {Object} originalFilePath Base config file the extends originated from\n@returns {Object} A new configuration object with all of the 'extends' fields loaded and merged.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst applyExtends = (config: any, parentName: any, originalFilePath: any): any => {\n const configExtends = Array.isArray(config.extends) ? config.extends : [config.extends];\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return configExtends.reduceRight((previousConfig, moduleName) => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const extendsConfig = loadFromModule(moduleName, originalFilePath);\n\n // Merge base object\n const mergedConfig = {...extendsConfig, ...previousConfig};\n\n // Merge rules\n const rules = {...extendsConfig.rules, ...previousConfig.rules};\n\n // Merge plugins, if exist\n const extendsConfigPlugins = Array.isArray(extendsConfig.plugins) ? extendsConfig.plugins : [];\n const previousConfigPlugins = Array.isArray(previousConfig.plugins) ? previousConfig.plugins : [];\n const plugins = [...extendsConfigPlugins, ...previousConfigPlugins];\n const uniquePlugins = [...new Set(plugins)];\n\n // Merge overrides, if exist\n const extendsConfigOverrides = Array.isArray(extendsConfig.overrides) ? extendsConfig.overrides : [];\n const previousConfigOverrides = Array.isArray(previousConfig.overrides) ? previousConfig.overrides : [];\n const overrides = [...extendsConfigOverrides, ...previousConfigOverrides];\n\n // Override merged rules\n mergedConfig.rules = rules;\n\n if (plugins.length > 0) {\n mergedConfig.plugins = uniquePlugins;\n }\n\n if (overrides.length > 0) {\n mergedConfig.overrides = overrides;\n }\n\n return mergedConfig;\n } catch (error) {\n error.message += `\\nReferenced from: ${parentName}`;\n throw error;\n }\n }, config);\n};\n\n/**\nGets configuration from a extends config module\n\n@param {String} moduleName Name of the configuration module\n@param {Object} originalFilePath Base config file the extends originated from\n@return {Object} Configuration object\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst loadFromModule = (moduleName: any, originalFilePath: any): any => {\n let config;\n let adjustedModuleName = moduleName;\n\n if (virtualConfigs.has(moduleName)) {\n debug(`${moduleName} is a built-in config, loading it directly.`);\n config = virtualConfigs.get(moduleName);\n } else if (moduleName.startsWith('./')) {\n adjustedModuleName = path.join(process.cwd(), moduleName);\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n config = loadConfigFile(adjustedModuleName);\n } else {\n const resolvedModule = require.resolve(adjustedModuleName, {paths: [path.dirname(originalFilePath)]});\n\n // eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\n config = require(resolvedModule);\n }\n\n if (Object.keys(config).length > 0 && config.extends) {\n config = applyExtends(config, adjustedModuleName, originalFilePath);\n }\n\n return config;\n};\n\n/**\nLoads a configuration file regardless of the source. Inspects the file path\nto determine the correctly way to load the config file.\n\n@param {Object} filePath The path to the configuration.\n@returns {Object} The configuration information.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst loadConfigFile = (filePath: any): any => {\n let config;\n\n switch (path.extname(filePath)) {\n case '.js': {\n config = parseJavaScriptFile(filePath);\n break;\n }\n\n case '.json': {\n config = parseJsonFile(filePath);\n break;\n }\n\n default: {\n throw new Error(`Unsupport config file extension. File path: ${filePath}`);\n }\n }\n\n return config;\n};\n\n/**\nLoads a configuration file from the given file path.\n\n@param {Object} npmPackageJsonLintConfig Parsed config from cosmicconfig\n@param {string} filepath the path to the config file\n@returns {Object} the parsed config object (empty object if there was a parse error)\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const applyExtendsIfSpecified = (npmPackageJsonLintConfig: any, filepath: any): any => {\n let config = {...npmPackageJsonLintConfig};\n\n debug('Loading extends, if applicable');\n if (config?.hasOwnProperty('extends') && config.extends) {\n debug('extends property present, applying.');\n config = applyExtends(config, filepath, filepath);\n }\n\n debug('Loading extends complete');\n\n return config;\n};\n","import path from 'node:path';\nimport {minimatch} from 'minimatch';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:applyOverrides');\n\n/**\nApplies values from the 'overrides' field in a configuration file.\n@param {string} cwd The current working directory.\n@param {string} filePath The file path of the file being linted.\n@param {Object} rules Rules object\n@param {Object} overrides Overrides object\n@returns {Object} A new configuration object with all of the 'overrides' applied.\n@private\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const applyOverrides = (cwd: string, filePath: string, rules: any, overrides?: any[]): any => {\n let finalRules = {...rules};\n\n debug('overrides');\n debug(overrides);\n\n if (overrides) {\n // Compute the relative path once and reuse across all override checks.\n // Normalize to forward slashes so patterns work consistently across platforms.\n // eslint-disable-next-line unicorn/prefer-string-replace-all\n const relativeFilePath = path.relative(cwd, filePath).replace(/\\\\/g, '/');\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n overrides.forEach((override) => {\n const filteredPatterns = override.patterns.filter((pattern: string) => pattern.length);\n const transformedPatterns = filteredPatterns.map((pattern: string) =>\n pattern.endsWith(`/package.json`) ? pattern : `${pattern}/package.json`,\n );\n\n // Strip leading './' from patterns so they match the output of path.relative(),\n // which never includes a leading './'.\n const matches = transformedPatterns.some((pattern: string) =>\n minimatch(relativeFilePath, pattern.replace(/^\\.\\//, ''), {dot: true}),\n );\n\n debug('relativeFilePath: %s, patterns: %o, matches: %s', relativeFilePath, transformedPatterns, matches);\n\n if (matches) {\n finalRules = {...finalRules, ...override.rules};\n }\n });\n }\n\n debug('finalRules');\n debug(finalRules);\n\n return finalRules;\n};\n","import path from 'node:path';\nimport {applyExtendsIfSpecified} from './applyExtendsIfSpecified';\nimport {applyOverrides} from './applyOverrides';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:cosmicConfigTransformer');\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const transform = (cwd: any, configBaseDirectory: any, filePathBeingLinted: any): any => {\n debug(`cwd: ${cwd}`);\n debug(`configBaseDirectory`);\n debug(configBaseDirectory);\n\n return (cosmiconfigResult) => {\n debug(`cosmiconfigResult`);\n debug(cosmiconfigResult);\n\n if (!cosmiconfigResult) {\n return null;\n }\n\n const {config, filepath} = cosmiconfigResult;\n\n debug(`cosmiconfigResult.config`);\n debug(config);\n debug(`cosmiconfigResult.filepath`);\n debug(filepath);\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const configDir = configBaseDirectory || path.dirname(filepath || '');\n const npmPackageJsonLintConfig = {...config};\n\n const configAfterExtends = applyExtendsIfSpecified(npmPackageJsonLintConfig, filePathBeingLinted);\n const configAfterOverrides = applyOverrides(\n cwd,\n filePathBeingLinted,\n configAfterExtends.rules,\n configAfterExtends.overrides,\n );\n\n return configAfterOverrides;\n };\n};\n","import {cosmiconfigSync} from 'cosmiconfig';\nimport {validateRules} from './config/ConfigValidator';\nimport {transform} from './config/cosmicConfigTransformer';\nimport {applyExtendsIfSpecified} from './config/applyExtendsIfSpecified';\nimport {applyOverrides} from './config/applyOverrides';\nimport {Rules} from './native-rules';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:Config');\n\nconst noRules = 0;\n\n/**\nConfig class\n@class\n*/\nexport class Config {\n /**\n The user passed config object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config: any;\n\n /**\n The current working directory.\n */\n cwd: string;\n\n /**\n The user passed configFile path.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configFile: any;\n\n /**\n The base directory that config should be pulled from.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configBaseDirectory: any;\n\n /**\n Rules object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rules: any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(cwd: string, config: any, configFile: any, configBaseDirectory: any, rules: Rules) {\n if (config) {\n this.config = applyExtendsIfSpecified(config, 'PassedConfig');\n }\n\n this.cwd = cwd;\n this.configFile = configFile;\n this.configBaseDirectory = configBaseDirectory;\n this.rules = rules;\n }\n\n /**\n Gets the config for a file.\n \n @param filePath File path of the file being linted.\n @returns {Object} A config object.\n @memberof Config\n */\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n getConfigForFile(filePath: string) {\n debug(`Getting config for ${filePath}`);\n const filePathToSearch = filePath;\n\n debug(`filePathToSearch: ${filePathToSearch}`);\n let config;\n\n // eslint-disable-next-line unicorn/no-typeof-undefined\n if (typeof this.config === 'undefined') {\n debug(`User passed config is undefined.`);\n if (this.configFile) {\n debug(`Config file specified, loading it.`);\n config = cosmiconfigSync('npmpackagejsonlint', {\n transform: transform(this.cwd, this.configBaseDirectory, filePath),\n }).load(this.configFile);\n } else {\n debug(`Config file wasn't specified, searching for config.`);\n config = cosmiconfigSync('npmpackagejsonlint', {\n transform: transform(this.cwd, this.configBaseDirectory, filePathToSearch),\n searchStrategy: 'global',\n }).search(filePathToSearch);\n }\n } else {\n debug(`User passed config is set, using it.`);\n const configBeforeOverrides = this.config;\n\n debug(`Applying overrides to config for ${filePath}`);\n config = applyOverrides(this.cwd, filePath, configBeforeOverrides.rules, configBeforeOverrides.overrides);\n\n debug(`Overrides applied for ${filePath}`);\n }\n\n if (!config) {\n throw new Error(`No npm-package-json-lint configuration found.\\n${filePathToSearch}`);\n }\n\n if (Object.keys(config).length === noRules) {\n throw new Error(`No rules specified in configuration.\\n${filePathToSearch}`);\n }\n\n debug(`Overrides applied for ${filePath}`);\n debug('Final Config');\n debug(config);\n\n validateRules(config, 'cli', this.rules);\n\n return config;\n }\n}\n","import chalk from 'chalk';\nimport {readdirSync} from 'node:fs';\nimport path from 'node:path';\nimport {LintFunction} from './types/lint-function';\nimport {RuleType} from './types/rule-type';\n\nexport interface Rule {\n lint: LintFunction;\n ruleType: RuleType;\n minItems?: number;\n}\n\nexport class Rules {\n rules: Record<string, string>;\n\n constructor() {\n this.rules = {};\n }\n\n /**\n Loads rules\n \n @return Set of rules\n */\n load(): Record<string, string> {\n const rulesDirectory = path.join(__dirname, 'rules');\n\n try {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n readdirSync(rulesDirectory).forEach((filePath) => {\n const beginIndex = 0;\n const endIndex = -3;\n // remove the file extension, e.g. `.js`\n const ruleId = filePath.slice(beginIndex, endIndex);\n const filePathToRuleModule = path.join(rulesDirectory, filePath);\n\n this.registerRule(ruleId, filePathToRuleModule);\n });\n\n return this.rules;\n } catch (error) {\n throw new Error(`Error while loading rules from rules directory - ${error.message}`, error);\n }\n }\n\n /**\n Loads a rule module\n \n @param ruleId Name of the rule\n @return Rule module\n */\n get(ruleId: string): Rule {\n const rule = this.rules[ruleId];\n\n // eslint-disable-next-line unicorn/no-typeof-undefined\n if (typeof rule === 'undefined') {\n const errorMsg = `Rule, ${ruleId}, is invalid. Please ensure it matches a valid option.`;\n\n throw new Error(chalk.bold.red(errorMsg));\n }\n\n // eslint-disable-next-line import-x/no-dynamic-require, @typescript-eslint/no-require-imports\n const ruleModule = require(this.rules[ruleId]);\n\n return ruleModule;\n }\n\n /**\n Gets entire rule set\n \n @returns Rule set\n */\n getRules(): Record<string, string> {\n return this.rules;\n }\n\n /**\n Registers a rule in the rules object\n \n @param ruleId Name of the rule\n @param filePathToRuleModule File path to rule\n */\n registerRule(ruleId: string, filePathToRuleModule: string): void {\n this.rules[ruleId] = filePathToRuleModule;\n }\n}\n","export enum Severity {\n Error = 'error',\n Warning = 'warning',\n Off = 'off',\n}\n","import {LintIssue} from '../lint-issue';\nimport {Severity} from '../types/severity';\nimport type {PackageJsonFileLintingResult} from '../types/package-json-linting-result';\n\n/**\nA result count object for a files.\n@typedef {Object} FileResultCounts\n@property {number} errorCount Number of errors for a file result.\n@property {number} warningCount Number of warnings for a file result.\n*/\n\nexport interface PackageJsonFileAggregatedResultCounts {\n errorCount: number;\n warningCount: number;\n}\n\n/**\nAggregates the count of errors and warning for a package.json file.\n\n@param issues Array of {@link LintIssue} objects from a package.json file.\n@returns Counts object {@link PackageJsonFileAggregatedResultCounts}.\n*/\nexport const aggregateCountsPerFile = (issues: LintIssue[]): PackageJsonFileAggregatedResultCounts => {\n const incrementOne = 1;\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return issues.reduce(\n (counts, issue) => {\n const isErrorSeverity = issue.severity === Severity.Error;\n const newErrorCount = isErrorSeverity ? counts.errorCount + incrementOne : counts.errorCount;\n const newWarningCount = isErrorSeverity ? counts.warningCount : counts.warningCount + incrementOne;\n\n return {\n errorCount: newErrorCount,\n warningCount: newWarningCount,\n };\n },\n {\n errorCount: 0,\n warningCount: 0,\n },\n );\n};\n\nexport interface OverallAggregatedResultCounts {\n /**\n Total number of ignored files.\n */\n ignoreCount: number;\n /**\n Total number of errors.\n */\n errorCount: number;\n /**\n Total number of warnings.\n */\n warningCount: number;\n}\n\n/**\nAggregates the count of errors and warnings for all package.json files.\n\n@param results Array of {@link PackageJsonFileLintingResult} objects from all package.json files.\n@returns Counts object {@link OverallAggregatedResultCounts}\n*/\nexport const aggregateOverallCounts = (results: PackageJsonFileLintingResult[]): OverallAggregatedResultCounts =>\n // eslint-disable-next-line unicorn/no-array-reduce\n results.reduce(\n (counts, result) => ({\n ignoreCount: result.ignored ? counts.ignoreCount + 1 : counts.ignoreCount,\n errorCount: counts.errorCount + result.errorCount,\n warningCount: counts.warningCount + result.warningCount,\n }),\n {\n ignoreCount: 0,\n errorCount: 0,\n warningCount: 0,\n },\n );\n","import path from 'node:path';\nimport type {PackageJson} from 'type-fest';\nimport {Ignore} from 'ignore';\nimport {Rules} from '../native-rules';\nimport {parseJsonFile} from '../file-parser';\nimport {LintIssue} from '../lint-issue';\nimport {RuleType} from '../types/rule-type';\nimport {Severity} from '../types/severity';\nimport {aggregateCountsPerFile, aggregateOverallCounts, OverallAggregatedResultCounts} from './results-helper';\nimport {Config} from '../configuration';\nimport type {PackageJsonFileLintingResult} from '../types/package-json-linting-result';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:linter');\n\nexport interface CreateResultObjectOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An optional string representing the package.json file.\n */\n fileName: string;\n /**\n A flag indicating that the file was skipped.\n */\n ignored: boolean;\n /**\n A list of issues.\n */\n issues: LintIssue[];\n /**\n Number of errors.\n */\n errorCount: number;\n /**\n Number of warnings.\n */\n warningCount: number;\n}\n\n/**\nCreates a results object.\n\n@param options A {@link CreateResultObjectOptions} object\n@returns The lint results {@link PackageJsonFileLintingResult} for the package.json file.\n@internal\n*/\nconst createResultObject = (options: CreateResultObjectOptions): PackageJsonFileLintingResult => {\n const {cwd, fileName, ignored, issues, errorCount, warningCount} = options;\n const relativeFilePath = path.relative(cwd, fileName);\n\n return {\n // Files outside cwd already start with `../`, so don't prefix them with `./`\n filePath: relativeFilePath.startsWith(`..${path.sep}`) ? relativeFilePath : `./${relativeFilePath}`,\n issues,\n ignored,\n errorCount,\n warningCount,\n };\n};\n\n/**\nRuns configured rules against the provided package.json object.\n\n@param packageJsonData Valid package.json data\n@param configObj Configuration object\n@param rules Object of rule definitions\n@return An array of {@link LintIssue} objects.\n@internal\n*/\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst lint = (packageJsonData: any, configObj, rules: Rules): LintIssue[] => {\n const lintIssues = [];\n\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\n for (const rule in configObj) {\n const ruleModule = rules.get(rule);\n\n // eslint-disable-next-line no-useless-assignment\n let severity = Severity.Off;\n let ruleConfig;\n\n if (ruleModule.ruleType === RuleType.Array || ruleModule.ruleType === RuleType.Object) {\n severity = typeof configObj[rule] === 'string' && configObj[rule] === 'off' ? configObj[rule] : configObj[rule][0];\n ruleConfig = typeof configObj[rule] === 'string' ? {} : configObj[rule][1];\n } else if (ruleModule.ruleType === RuleType.OptionalObject) {\n if (typeof configObj[rule] === 'string') {\n severity = configObj[rule] as Severity;\n ruleConfig = {};\n } else {\n // eslint-disable-next-line prefer-destructuring\n severity = configObj[rule][0];\n // eslint-disable-next-line prefer-destructuring\n ruleConfig = configObj[rule][1];\n }\n } else {\n severity = configObj[rule];\n }\n\n if (severity === Severity.Off) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n const lintResult = ruleModule.lint(packageJsonData, severity, ruleConfig);\n\n if (lintResult !== null) {\n lintIssues.push(lintResult);\n }\n }\n\n return lintIssues;\n};\n\n/**\nProcesses package.json object\n\n@param cwd The current working directory.\n@param packageJsonObj An object representation of a package.json file.\n@param config A config object.\n@param fileName An optional string representing the package.json file.\n@param rules An instance of `Rules`.\n@returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file.\n@internal\n*/\nconst processPackageJsonObject = (\n cwd: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObj: PackageJson | any,\n config,\n fileName: string,\n rules: Rules,\n): PackageJsonFileLintingResult => {\n const lintIssues = lint(packageJsonObj, config, rules);\n const counts = aggregateCountsPerFile(lintIssues);\n const result = createResultObject({\n cwd,\n fileName,\n ignored: false,\n issues: lintIssues,\n errorCount: counts.errorCount,\n warningCount: counts.warningCount,\n });\n\n return result;\n};\n\n/**\nProcesses a package.json file.\n\n@param cwd The current working directory.\n@param fileName The filename of the file being linted.\n@param config A config object.\n@param rules An instance of `Rules`.\n@returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file.\n@internal\n*/\nconst processPackageJsonFile = (cwd: string, fileName: string, config, rules: Rules): PackageJsonFileLintingResult => {\n const packageJsonObj = parseJsonFile(path.resolve(fileName));\n\n return processPackageJsonObject(cwd, packageJsonObj, config, fileName, rules);\n};\n\nexport interface LinterResult {\n results: LintIssue[];\n ignoreCount: number;\n /**\n Number of errors for the package.json file.\n */\n errorCount: number;\n /**\n Number of warnings for the package.json file.\n */\n warningCount: number;\n}\n\nexport interface ExecuteOnPackageJsonObjectOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An object representation of a package.json file.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject: PackageJson | any;\n /**\n An optional string representing the texts filename.\n */\n filename?: string;\n /**\n An instance of the `ignore` module.\n */\n ignorer: Ignore;\n /**\n An instance of {@Config}.\n */\n configHelper: Config;\n /**\n An instance of {@link Rules}\n */\n rules: Rules;\n}\n\nexport interface OverallLintingResult extends OverallAggregatedResultCounts {\n results: PackageJsonFileLintingResult[];\n}\n\n/**\nExecutes linter on package.json object\n\n@param options A {@link ExecuteOnPackageJsonObjectOptions} object\n@returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n*/\nexport const executeOnPackageJsonObject = (options: ExecuteOnPackageJsonObjectOptions): OverallLintingResult => {\n const {cwd, packageJsonObject, filename = '', ignorer, configHelper, rules} = options;\n\n debug('executing on package.json object');\n const results = [];\n\n const resolvedFilename = path.isAbsolute(filename) ? filename : path.resolve(cwd, filename);\n const relativeFilePath = path.relative(cwd, resolvedFilename);\n\n let result;\n\n if (ignorer.ignores(relativeFilePath)) {\n debug(`Ignored: ${relativeFilePath}`);\n\n result = createResultObject({\n cwd,\n fileName: resolvedFilename,\n ignored: true,\n issues: [],\n errorCount: 0,\n warningCount: 0,\n });\n } else {\n debug(`Getting config for ${resolvedFilename}`);\n const config = configHelper.getConfigForFile(resolvedFilename);\n\n debug(`Config fetched for ${resolvedFilename}`);\n result = processPackageJsonObject(cwd, packageJsonObject, config, resolvedFilename, rules);\n }\n\n results.push(result);\n\n debug('Aggregating overall counts');\n const stats = aggregateOverallCounts(results);\n\n debug('stats');\n debug(stats);\n\n return {\n results,\n ignoreCount: stats.ignoreCount,\n errorCount: stats.errorCount,\n warningCount: stats.warningCount,\n };\n};\n\nexport interface ExecuteOnPackageJsonFilesOptions {\n /**\n The current working directory.\n */\n cwd: string;\n /**\n An array of files and directory names.\n */\n fileList: string[];\n /**\n An instance of the `ignore` module.\n */\n ignorer: Ignore;\n /**\n An instance of {@Config}.\n */\n configHelper: Config;\n /**\n An instance of {@link Rules}\n */\n rules: Rules;\n}\n\n/**\nExecutes the current configuration on an array of file and directory names.\n@param options A {@link ExecuteOnPackageJsonFilesOptions} object\n@returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n*/\nexport const executeOnPackageJsonFiles = (options: ExecuteOnPackageJsonFilesOptions): OverallLintingResult => {\n const {cwd, fileList, ignorer, configHelper, rules} = options;\n\n debug('executing on package.json files');\n const results = fileList.map((filePath) => {\n const relativeFilePath = path.relative(cwd, filePath);\n\n if (ignorer.ignores(relativeFilePath)) {\n debug(`Ignored: ${relativeFilePath}`);\n\n return createResultObject({\n cwd,\n fileName: filePath,\n ignored: true,\n issues: [],\n errorCount: 0,\n warningCount: 0,\n });\n }\n\n debug(`Getting config for ${filePath}`);\n const config = configHelper.getConfigForFile(filePath);\n\n debug(`Config fetched for ${filePath}`);\n\n return processPackageJsonFile(cwd, filePath, config, rules);\n });\n\n debug('Aggregating overall counts');\n const stats = aggregateOverallCounts(results);\n\n debug('stats');\n debug(stats);\n\n return {\n results,\n ignoreCount: stats.ignoreCount,\n errorCount: stats.errorCount,\n warningCount: stats.warningCount,\n };\n};\n","import path from 'node:path';\nimport globby from 'globby';\nimport {slash} from './slash';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:getFileList');\n\nconst GLOB_CHARS = /[!()*+?@[\\]{}]/;\n\n/**\nSplits a glob pattern into its static base directory and the rest of the pattern.\n\n@param pattern A glob pattern with forward slashes\n@returns The static base and the pattern relative to it\n*/\nconst splitGlobBase = (pattern: string): {base: string; rest: string} => {\n const segments = pattern.split('/');\n const firstGlobIndex = segments.findIndex((segment) => GLOB_CHARS.test(segment));\n const baseSegments = segments.slice(0, firstGlobIndex === -1 ? -1 : firstGlobIndex);\n const restSegments = segments.slice(baseSegments.length);\n\n return {base: `${baseSegments.join('/')}/`, rest: restSegments.join('/')};\n};\n\n/**\nDetermines whether a pattern points outside of cwd (e.g. `../sibling`).\n\n@param pattern A glob pattern\n@param cwd The current working directory\n@returns True if the pattern resolves outside of cwd\n*/\nconst isOutsideCwd = (pattern: string, cwd: string): boolean => {\n const relative = path.relative(cwd, path.resolve(cwd, pattern));\n\n return relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative);\n};\n\n/**\nGlobs a pattern that points outside of cwd from its own static base directory.\nglobby's gitignore filter only accepts paths inside its cwd, so these can't share the main glob.\n\n@param pattern A glob pattern that resolves outside of cwd\n@param cwd The current working directory\n@returns Absolute paths of the matching files\n*/\nconst globOutsideCwd = (pattern: string, cwd: string): string[] => {\n const {base, rest} = splitGlobBase(slash(path.resolve(cwd, pattern)));\n\n return globby.sync([rest, '!**/node_modules/**'], {\n cwd: base,\n gitignore: true,\n absolute: true,\n });\n};\n\n/**\nGenerates a list of files to lint based on a list of provided patterns\n\n@param {Array<string>} patterns An array of patterns\n@param {string} cwd The current working directory.\n@returns {Array<string>} An array a files to lint.\n*/\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const getFileList = (patterns, cwd) => {\n debug('patterns');\n debug(patterns);\n\n // step 1 - filter out empty entries\n const filteredPatterns = patterns.filter((pattern) => pattern.length);\n\n debug('filteredPatterns');\n debug(filteredPatterns);\n\n // step 2 - convert directories to globs\n const globPatterns = filteredPatterns.map((pattern) =>\n pattern.endsWith(`/package.json`) ? pattern : `${pattern}/**/package.json`,\n );\n\n // step 3 - glob patterns outside of cwd (e.g. `../sibling`) separately, see `globOutsideCwd`\n const insidePatterns = globPatterns.filter((pattern) => pattern.startsWith('!') || !isOutsideCwd(pattern, cwd));\n const outsidePatterns = globPatterns.filter((pattern) => !pattern.startsWith('!') && isOutsideCwd(pattern, cwd));\n\n debug('insidePatterns');\n debug(insidePatterns);\n debug('outsidePatterns');\n debug(outsidePatterns);\n\n const hasInsidePatterns = insidePatterns.some((pattern) => !pattern.startsWith('!'));\n const globFiles = [\n ...(hasInsidePatterns\n ? globby.sync([...insidePatterns, '!**/node_modules/**'], {cwd, gitignore: true, absolute: true})\n : []),\n ...outsidePatterns.flatMap((pattern) => globOutsideCwd(pattern, cwd)),\n ];\n\n debug('globFiles');\n debug(globFiles);\n\n // step 4 - normalize and de-duplicate, keeping the first occurrence of each file\n const files = [...new Set(globFiles.map((globFile) => path.resolve(globFile)))];\n\n debug('Final file list from `getFileList`');\n debug(files);\n\n return files;\n};\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport ignore, {Ignore} from 'ignore';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:getIgnorer');\n\nconst DEFAULT_IGNORE_FILENAME = '.npmpackagejsonlintignore';\nconst FILE_NOT_FOUND_ERROR_CODE = 'ENOENT';\n\n/**\nGenerates ignorer based on ignore file content.\n\n@param cwd Current work directory.\n@param ignorePath Ignore path.\n@returns An instance of an Ignorer\n*/\nexport const getIgnorer = (cwd: string, ignorePath: string): Ignore => {\n const ignoreFilePath = ignorePath || DEFAULT_IGNORE_FILENAME;\n\n debug(`ignoreFilePath: ${ignoreFilePath}`);\n const absoluteIgnoreFilePath = path.isAbsolute(ignoreFilePath) ? ignoreFilePath : path.resolve(cwd, ignoreFilePath);\n\n debug(`absoluteIgnoreFilePath: ${absoluteIgnoreFilePath}`);\n let ignoreText = '';\n\n try {\n ignoreText = fs.readFileSync(absoluteIgnoreFilePath, 'utf8');\n } catch (readError) {\n if (readError.code !== FILE_NOT_FOUND_ERROR_CODE) {\n throw readError;\n }\n }\n\n debug('Ignore text added');\n\n // Files outside cwd (e.g. `npmPkgJsonLint ../sibling`) produce `../` relative paths.\n // `ignore` throws on those by default, so allow them. Patterns are relative to cwd, so they won't match.\n return ignore({allowRelativePaths: true}).add(ignoreText);\n};\n","","import type {PackageJson} from 'type-fest';\nimport {slash} from './utils/slash';\nimport {isPlainObj} from './utils/isPlainObj';\nimport {Config} from './configuration';\nimport {Rules} from './native-rules';\nimport {executeOnPackageJsonFiles, executeOnPackageJsonObject, OverallLintingResult} from './linter/linter';\nimport {getFileList} from './utils/getFileList';\nimport {getIgnorer} from './utils/getIgnorer';\nimport {Severity} from './types/severity';\nimport type {PackageJsonFileLintingResult} from './types/package-json-linting-result';\nimport {LintIssue} from './lint-issue';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst debug = require('debug')('npm-package-json-lint:NpmPackageJsonLint');\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst pkg = require('../package.json');\n\nconst noIssues = 0;\n\n/**\nChecks if the given issue is an error issue.\n\n@param issue A {@link LintIssue} object\n@returns True if error, false if warning.\n@private\n*/\nconst isIssueAnError = (issue: LintIssue): boolean => issue.severity === Severity.Error;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isPackageJsonObjectValid = (packageJsonObject: PackageJson | any): boolean => isPlainObj(packageJsonObject);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRequiredOptionsValid = (packageJsonObject: PackageJson | any, patterns: string[]): boolean =>\n (!patterns && !isPackageJsonObjectValid(packageJsonObject)) ||\n (patterns && (packageJsonObject || isPackageJsonObjectValid(packageJsonObject)));\n\n/**\nFilters results to only include errors.\n\n@param results The results to filter.\n@returns The filtered results.\n*/\nconst getErrorResults = (results: PackageJsonFileLintingResult[]): PackageJsonFileLintingResult[] => {\n const filtered = [];\n\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n results.forEach((result) => {\n // eslint-disable-next-line unicorn/no-array-callback-reference\n const filteredIssues = result.issues.filter(isIssueAnError);\n\n if (filteredIssues.length <= noIssues) {\n return;\n }\n\n const filteredResult = {\n issues: filteredIssues,\n errorCount: filteredIssues.length,\n warningCount: 0,\n };\n\n filtered.push(Object.assign(result, filteredResult));\n });\n\n return filtered;\n};\n\nexport interface NpmPackageJsonLintOptions {\n cwd?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject?: any;\n packageJsonFilePath?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configFile?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configBaseDirectory?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patterns?: any;\n quiet?: boolean;\n ignorePath?: string;\n fix?: boolean;\n}\n\nexport class NpmPackageJsonLint {\n cwd: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJsonObject: any;\n\n packageJsonFilePath: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patterns: any;\n\n quiet: boolean;\n\n ignorePath: string;\n\n fix: boolean;\n\n version: string;\n\n rules: Rules;\n\n configHelper: Config;\n\n /**\n constructor\n @param options An instance of the {@link NpmPackageJsonLintOptions} options object.\n @constructor\n */\n constructor(options: NpmPackageJsonLintOptions) {\n const {\n cwd,\n packageJsonObject,\n packageJsonFilePath,\n config,\n configFile,\n configBaseDirectory,\n patterns,\n quiet = false,\n ignorePath = '',\n fix = false,\n } = options;\n\n this.cwd = slash(cwd || process.cwd());\n\n this.packageJsonObject = packageJsonObject;\n this.packageJsonFilePath = packageJsonFilePath ? slash(packageJsonFilePath) : packageJsonFilePath;\n this.patterns = patterns;\n this.quiet = quiet;\n this.ignorePath = ignorePath;\n this.fix = fix;\n\n this.version = pkg.version;\n\n this.rules = new Rules();\n this.rules.load();\n\n this.configHelper = new Config(this.cwd, config, configFile, configBaseDirectory, this.rules);\n }\n\n /**\n Runs the linter using the config specified in the constructor\n \n @returns The results {@link OverallLintingResult} from linting a collection of package.json files.\n */\n // eslint-disable-next-line max-lines-per-function\n lint(): OverallLintingResult {\n debug('Starting lint');\n\n if (isRequiredOptionsValid(this.packageJsonObject, this.patterns)) {\n throw new Error(\n 'You must pass npm-package-json-lint a `patterns` glob or a `packageJsonObject` string, though not both.',\n );\n }\n\n const ignorer = getIgnorer(this.cwd, this.ignorePath);\n let linterOutput: OverallLintingResult;\n\n if (this.patterns) {\n debug('Linting using patterns');\n\n if (!Array.isArray(this.patterns)) {\n throw new TypeError('Patterns must be an array.');\n }\n\n const fileList = getFileList(this.patterns, this.cwd);\n\n linterOutput = executeOnPackageJsonFiles({\n cwd: this.cwd,\n fileList,\n ignorer,\n configHelper: this.configHelper,\n rules: this.rules,\n });\n } else {\n debug('Linting using passed object.');\n linterOutput = executeOnPackageJsonObject({\n cwd: this.cwd,\n packageJsonObject: this.packageJsonObject,\n ignorer,\n filename: this.packageJsonFilePath,\n configHelper: this.configHelper,\n rules: this.rules,\n });\n }\n\n if (this.quiet) {\n const errorsOnly = getErrorResults(linterOutput.results);\n\n return {\n results: errorsOnly,\n ignoreCount: linterOutput.ignoreCount,\n errorCount: linterOutput.errorCount,\n warningCount: linterOutput.warningCount,\n };\n }\n\n debug('lint complete');\n\n return linterOutput;\n }\n}\n","import chalk from 'chalk';\nimport {Severity} from './types/severity';\n\n/**\nA lint issue\n*/\nexport class LintIssue {\n /**\n Unique, lowercase, hyphen-separate name for the lint\n \n @type {string}\n @memberof LintIssue\n */\n lintId: string;\n\n /**\n 'error' or 'warning'\n \n @type {Severity}\n @memberof LintIssue\n */\n severity: Severity;\n\n /**\n Name of the node in the JSON the lint audits\n \n @type {string}\n @memberof LintIssue\n */\n node: string;\n\n /**\n Human-friendly message to users\n \n @type {string}\n @memberof LintIssue\n */\n lintMessage: string;\n\n /**\n Creates an instance of LintIssue.\n @param lintId Unique, lowercase, hyphen-separate name for the lint\n @param severity 'error' or 'warning'\n @param node Name of the node in the JSON the lint audits\n @param lintMessage Human-friendly message to users\n @memberof LintIssue\n */\n constructor(lintId: string, severity: Severity, node: string, lintMessage: string) {\n this.lintId = lintId;\n this.severity = severity;\n this.node = node;\n this.lintMessage = lintMessage;\n }\n\n /**\n Helper to convert the LintIssue to a printable string\n \n @returns {string} Human-friendly message about the lint issue\n */\n toString(): string {\n const formattedSeverity = chalk[this.severity === Severity.Error ? 'bgRedBright' : 'bgYellowBright'](\n this.severity.toUpperCase(),\n );\n const formattedLintId = chalk.cyan.bold(this.lintId);\n const formattedNode = chalk.magenta.bold(this.node);\n const formattedMessage =\n this.severity === Severity.Error ? chalk.red.bold(this.lintMessage) : chalk.yellow(this.lintMessage);\n\n return `${formattedSeverity} ${formattedLintId} - node: ${formattedNode} - ${formattedMessage}`;\n }\n}\n","/**\nPluralizes a word\n\n@param {string} singularWord Word in singular form\n@param {number} count Count to use to determine whether to return the pluralized word\n@returns {string} Pluralized word\n*/\nexport const plur = (singularWord: string, count: number): string =>\n count === 0 || count > 1 ? `${singularWord}s` : singularWord;\n","import chalk from 'chalk';\nimport {plur} from './utils/plur';\nimport {LintIssue} from './lint-issue';\n\nconst zeroIssues = 0;\nconst oneFile = 1;\n\n/**\nPrints issues to console\n\n@param issues An array of LintIssues\n@internal\n*/\nconst printResultSetIssues = (issues: LintIssue[]): void => {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n issues.forEach((issue) => {\n console.log(issue.toString());\n });\n};\n\n/**\nPrint results for an individual package.json file linting\n\n@param resultSet Result object from a given file's lint result\n@param isQuiet True suppress warnings, false show warnings\n@internal\n*/\nconst printIndividualResultSet = (resultSet, isQuiet: boolean): void => {\n const {filePath, issues, ignored, errorCount, warningCount} = resultSet;\n\n if (ignored) {\n console.log('');\n\n console.log(`${chalk.yellow.underline(filePath)} - ignored`);\n } else if (errorCount > zeroIssues || (!isQuiet && warningCount > zeroIssues)) {\n console.log('');\n\n console.log(chalk.underline(filePath));\n\n printResultSetIssues(issues);\n\n const errorCountMessage = `${errorCount} ${plur('error', errorCount)}`;\n const warningCountMessage = `${warningCount} ${plur('warning', warningCount)}`;\n\n console.log(chalk.red.bold(errorCountMessage));\n\n if (!isQuiet) {\n console.log(chalk.yellow.bold(warningCountMessage));\n }\n }\n};\n\n/**\nPrints the overall total counts section\n\n@param linterOutput Full results from linting. Includes an array of results and overall counts\n@param isQuiet True suppress warnings, false show warnings\n@internal\n*/\nconst printTotals = (linterOutput, isQuiet: boolean): void => {\n const {errorCount, warningCount, ignoreCount} = linterOutput;\n\n if (errorCount <= zeroIssues && warningCount <= zeroIssues) {\n return;\n }\n\n const errorCountMessage = `${errorCount} ${plur('error', errorCount)}`;\n const warningCountMessage = `${warningCount} ${plur('warning', warningCount)}`;\n const ignoreCountMessage = `${ignoreCount} ${plur('file', ignoreCount)} ignored`;\n\n console.log('');\n console.log(chalk.underline('Totals'));\n console.log(chalk.red.bold(errorCountMessage));\n\n if (isQuiet) {\n return;\n }\n\n console.log(chalk.yellow.bold(warningCountMessage));\n console.log(chalk.yellow.bold(ignoreCountMessage));\n};\n\n/**\nPrint results to console\n\n@param linterOutput An array of LintIssues\n@param isQuiet Flag indicating whether to print warnings.\n@internal\n*/\nexport const write = (linterOutput, isQuiet: boolean): void => {\n // eslint-disable-next-line unicorn/no-for-each -- for...of is banned by no-restricted-syntax in this project\n linterOutput.results.forEach((result) => {\n printIndividualResultSet(result, isQuiet);\n });\n\n if (linterOutput.results.length > oneFile) {\n printTotals(linterOutput, isQuiet);\n }\n};\n"],"ignoreList":[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],"mappings":"A,83BAAA,MAAaiD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