@powerlines/schema 0.11.58 → 0.11.59

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/resolve.mjs CHANGED
@@ -1,23 +1,25 @@
1
1
  import { bundle } from "./bundle.mjs";
2
2
  import defu from "defu";
3
3
  import { isSetString } from "@stryke/type-checks/is-set-string";
4
+ import { findFileDotExtension, findFileExtensionSafe } from "@stryke/path/find";
4
5
  import { esbuildPlugin } from "@powerlines/deepkit/esbuild-plugin";
5
6
  import { reflect } from "@powerlines/deepkit/vendor/type";
6
- import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
7
- import { findFileDotExtension } from "@stryke/path/find";
7
+ import { extractFileReference } from "@stryke/convert/extract-file-reference";
8
+ import { parse } from "smol-toml";
9
+ import { parse as parse$1 } from "yaml";
8
10
 
9
11
  //#region src/resolve.ts
10
12
  /**
11
13
  * Compiles a type definition to a module and returns the module.
12
14
  *
13
15
  * @param context - The context object containing the environment paths.
14
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
16
+ * @param type - The type definition to compile. This can be either a string or a {@link FileReference} object.
15
17
  * @param overrides - Optional overrides for the ESBuild configuration.
16
18
  * @returns A promise that resolves to the compiled module.
17
19
  */
18
20
  async function resolveModule(context, type, overrides) {
19
21
  let typeDefinition;
20
- if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
22
+ if (isSetString(type)) typeDefinition = extractFileReference(type);
21
23
  else typeDefinition = type;
22
24
  const result = await bundle(context, typeDefinition.file, overrides);
23
25
  let resolved;
@@ -45,26 +47,47 @@ ${result.text}` : ""}`);
45
47
  * Compiles a type definition to a module and returns the specified export from the module.
46
48
  *
47
49
  * @param context - The context object containing the environment paths.
48
- * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
50
+ * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
49
51
  * @param options - Optional overrides for the ESBuild configuration.
50
52
  * @returns A promise that resolves to the compiled module.
51
53
  */
52
54
  async function resolve(context, input, options) {
53
- let typeDefinition;
54
- if (isSetString(input)) typeDefinition = parseTypeDefinition(input);
55
- else typeDefinition = input;
56
- const resolved = await resolveModule(context, typeDefinition, options);
57
- let exportName = typeDefinition.name;
55
+ const fileReference = extractFileReference(input);
56
+ if (!fileReference) throw new Error(`Failed to extract a file reference from the provided input. The input must be a string or an object with a "file" property that specifies the file path and optional export name.`);
57
+ const extension = findFileExtensionSafe(fileReference.file);
58
+ if (extension.startsWith("json")) try {
59
+ const json = await context.fs.read(fileReference.file);
60
+ if (!isSetString(json)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid JSON.`);
61
+ return JSON.parse(json);
62
+ } catch (error) {
63
+ throw new Error(`Failed to read or parse the JSON file at "${fileReference.file}". Please ensure the file exists and contains valid JSON. Error: ${error.message}`);
64
+ }
65
+ else if (extension === "yaml" || extension === "yml") try {
66
+ const yaml = await context.fs.read(fileReference.file);
67
+ if (!isSetString(yaml)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid YAML.`);
68
+ return parse$1(yaml);
69
+ } catch (error) {
70
+ throw new Error(`Failed to read or parse the YAML file at "${fileReference.file}". Please ensure the file exists and contains valid YAML. Error: ${error.message}`);
71
+ }
72
+ else if (extension === "toml") try {
73
+ const toml = await context.fs.read(fileReference.file);
74
+ if (!isSetString(toml)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid TOML.`);
75
+ return parse(toml);
76
+ } catch (error) {
77
+ throw new Error(`Failed to read or parse the TOML file at "${fileReference.file}". Please ensure the file exists and contains valid TOML. Error: ${error.message}`);
78
+ }
79
+ const resolved = await resolveModule(context, fileReference, options);
80
+ let exportName = fileReference.export;
58
81
  if (!exportName) exportName = "default";
59
82
  const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
60
- if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
83
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${fileReference.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${fileReference.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
61
84
  return resolvedExport;
62
85
  }
63
86
  /**
64
87
  * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.
65
88
  *
66
89
  * @param context - The context object containing the environment paths.
67
- * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
90
+ * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
68
91
  * @param options - Optional overrides for the ESBuild configuration.
69
92
  * @returns A promise that resolves to the Deepkit Type reflection.
70
93
  */
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.mjs","names":[],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext, UnresolvedContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { findFileDotExtension } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { TypeDefinition } from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { bundle, BundleOptions } from \"./bundle\";\nimport { TypeDefinitionReference } from \"./types\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n type: TypeDefinitionReference,\n overrides?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle<TContext>(\n context,\n typeDefinition.file,\n overrides\n );\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: TypeDefinitionReference,\n options?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(input)) {\n typeDefinition = parseTypeDefinition(input) as TypeDefinition;\n } else {\n typeDefinition = input;\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n typeDefinition,\n options\n );\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n typeDefinition.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n typeDefinition.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: TypeDefinitionReference,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {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IAAI,mBAAmB,QACrB,MAAM,IAAI,MACR,eAAe,WAAW,kCACxB,eAAe,KAChB,YACC,OAAO,KAAK,QAAQ,EAAE,WAAW,IAC7B,gFACE,eAAe,KAChB,kBAAkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,QACF,EAAE,KACA,IACF,EAAE,iEAEV;CAGF,OAAO;AACT;;;;;;;;;AAUA,eAAsB,kBAGpB,SACA,OACA,SACe;CACf,OAAO,QACL,MAAM,QACJ,SACA,OACA,KAAK,SAAS,EACZ,SAAS,CACP,cAAc,SAAS;EACrB,YAAY;EACZ,OAAO;CACT,CAAC,CACH,EACF,CAAC,CACH,CACF;AACF"}
1
+ {"version":3,"file":"resolve.mjs","names":["parseYaml","parseToml"],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext, UnresolvedContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { extractFileReference } from \"@stryke/convert/extract-file-reference\";\nimport { findFileDotExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { FileReference, FileReferenceInput } from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { parse as parseToml } from \"smol-toml\";\nimport { parse as parseYaml } from \"yaml\";\nimport { bundle, BundleOptions } from \"./bundle\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n type: FileReference,\n overrides?: BundleOptions\n): Promise<TResult> {\n let typeDefinition!: FileReference;\n if (isSetString(type)) {\n typeDefinition = extractFileReference(type) as FileReference;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle<TContext>(\n context,\n typeDefinition.file,\n overrides\n );\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: FileReferenceInput,\n options?: BundleOptions\n): Promise<TResult> {\n const fileReference = extractFileReference(input);\n if (!fileReference) {\n throw new Error(\n `Failed to extract a file reference from the provided input. The input must be a string or an object with a \"file\" property that specifies the file path and optional export name.`\n );\n }\n\n const extension = findFileExtensionSafe(fileReference.file);\n if (extension.startsWith(\"json\")) {\n try {\n const json = await context.fs.read(fileReference.file);\n if (!isSetString(json)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid JSON.`\n );\n }\n\n return JSON.parse(json) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the JSON file at \"${fileReference.file}\". Please ensure the file exists and contains valid JSON. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"yaml\" || extension === \"yml\") {\n try {\n const yaml = await context.fs.read(fileReference.file);\n if (!isSetString(yaml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid YAML.`\n );\n }\n\n return parseYaml(yaml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the YAML file at \"${fileReference.file}\". Please ensure the file exists and contains valid YAML. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"toml\") {\n try {\n const toml = await context.fs.read(fileReference.file);\n if (!isSetString(toml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid TOML.`\n );\n }\n\n return parseToml(toml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the TOML file at \"${fileReference.file}\". Please ensure the file exists and contains valid TOML. Error: ${(error as Error).message}`\n );\n }\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n fileReference,\n options\n );\n\n let exportName = fileReference.export;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n fileReference.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n fileReference.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: FileReference,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n })\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,eAAsB,cAIpB,SACA,MACA,WACkB;CAClB,IAAI;CACJ,IAAI,YAAY,IAAI,GAClB,iBAAiB,qBAAqB,IAAI;MAE1C,iBAAiB;CAGnB,MAAM,SAAS,MAAM,OACnB,SACA,eAAe,MACf,SACF;CAEA,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,QAAQ,SAAS,WAAW,OAAO,MAAM;GACxD,UAAU,OAAO;GACjB,KAAK,qBAAqB,OAAO,IAAI;EACvC,CAAC;CACH,SAAS,OAAO;EACd,IACE,YAAa,MAAgB,OAAO,KACpC,IAAI,OACF,uBAAuB,QAAQ,OAAO,WAAW,QAAQ,aAAa,KACxE,EAAE,KAAM,MAAgB,OAAO,GAC/B;GACA,MAAM,aAAc,MAAgB,QAAQ,MAC1C,IAAI,OACF,wBAAwB,QAAQ,OAAO,WAAW,QAAQ,aAAa,MACzE,CACF,IAAI;GACJ,MAAM,IAAI,MACR,eA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IAAI;CACvB,SAAS,OAAO;EACd,MAAM,IAAI,MACR,6CAA6C,cAAc,KAAK,mEAAoE,MAAgB,SACtJ;CACF;CAGF,MAAM,WAAW,MAAM,cACrB,SACA,eACA,OACF;CAEA,IAAI,aAAa,cAAc;CAC/B,IAAI,CAAC,YACH,aAAa;CAGf,MAAM,iBAAiB,SAAS,eAAe,SAAS,MAAM;CAC9D,IAAI,mBAAmB,QACrB,MAAM,IAAI,MACR,eAAe,WAAW,kCACxB,cAAc,KACf,YACC,OAAO,KAAK,QAAQ,EAAE,WAAW,IAC7B,gFACE,cAAc,KACf,kBAAkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,QACF,EAAE,KACA,IACF,EAAE,iEAEV;CAGF,OAAO;AACT;;;;;;;;;AAUA,eAAsB,kBAGpB,SACA,OACA,SACe;CACf,OAAO,QACL,MAAM,QACJ,SACA,OACA,KAAK,SAAS,EACZ,SAAS,CACP,cAAc,SAAS;EACrB,YAAY;EACZ,OAAO;CACT,CAAC,CACH,EACF,CAAC,CACH,CACF;AACF"}
@@ -110,6 +110,9 @@ const hasValidJsonSchemaKeywords = (schema) => {
110
110
  };
111
111
  /**
112
112
  * Type guard for shared JSON Schema keyword groups.
113
+ *
114
+ * @param input - The value to check.
115
+ * @returns True if the input is a JSON Schema keyword group, false otherwise.
113
116
  */
114
117
  function isJsonSchemaKeywords(input) {
115
118
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -117,6 +120,9 @@ function isJsonSchemaKeywords(input) {
117
120
  }
118
121
  /**
119
122
  * Type guard for generic JSON Schema objects with optional `$ref`.
123
+ *
124
+ * @param input - The value to check.
125
+ * @returns True if the input is a generic JSON Schema object, false otherwise.
120
126
  */
121
127
  function isJsonSchemaAny(input) {
122
128
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -125,6 +131,9 @@ function isJsonSchemaAny(input) {
125
131
  }
126
132
  /**
127
133
  * Type guard for JSON Schema array types.
134
+ *
135
+ * @param input - The value to check.
136
+ * @returns True if the input is a JSON Schema array schema, false otherwise.
128
137
  */
129
138
  function isJsonSchemaArray(input) {
130
139
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -134,6 +143,9 @@ function isJsonSchemaArray(input) {
134
143
  }
135
144
  /**
136
145
  * Type guard for bigint-backed integer schemas.
146
+ *
147
+ * @param input - The value to check.
148
+ * @returns True if the input is a bigint-backed integer schema, false otherwise.
137
149
  */
138
150
  function isJsonSchemaBigint(input) {
139
151
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -143,6 +155,9 @@ function isJsonSchemaBigint(input) {
143
155
  }
144
156
  /**
145
157
  * Type guard for boolean schemas.
158
+ *
159
+ * @param input - The value to check.
160
+ * @returns True if the input is a boolean schema, false otherwise.
146
161
  */
147
162
  function isJsonSchemaBoolean(input) {
148
163
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -151,6 +166,9 @@ function isJsonSchemaBoolean(input) {
151
166
  }
152
167
  /**
153
168
  * Type guard for date/time schemas.
169
+ *
170
+ * @param input - The value to check.
171
+ * @returns True if the input is a date or time schema, false otherwise.
154
172
  */
155
173
  function isJsonSchemaDate(input) {
156
174
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -163,6 +181,9 @@ function isJsonSchemaDate(input) {
163
181
  }
164
182
  /**
165
183
  * Type guard for enum-constrained schemas.
184
+ *
185
+ * @param input - The value to check.
186
+ * @returns True if the input is an enum-constrained schema, false otherwise.
166
187
  */
167
188
  function isJsonSchemaEnum(input) {
168
189
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -178,6 +199,9 @@ function isJsonSchemaEnum(input) {
178
199
  }
179
200
  /**
180
201
  * Type guard for `allOf` composition schemas.
202
+ *
203
+ * @param input - The value to check.
204
+ * @returns True if the input is an `allOf` schema, false otherwise.
181
205
  */
182
206
  function isJsonSchemaAllOf(input) {
183
207
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -187,6 +211,9 @@ function isJsonSchemaAllOf(input) {
187
211
  }
188
212
  /**
189
213
  * Type guard for literal-value schemas.
214
+ *
215
+ * @param input - The value to check.
216
+ * @returns True if the input is a literal-value schema, false otherwise.
190
217
  */
191
218
  function isJsonSchemaLiteral(input) {
192
219
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -196,6 +223,9 @@ function isJsonSchemaLiteral(input) {
196
223
  }
197
224
  /**
198
225
  * Type guard for map tuple-array schemas.
226
+ *
227
+ * @param input - The value to check.
228
+ * @returns True if the input is a map tuple-array schema, false otherwise.
199
229
  */
200
230
  function isJsonSchemaMap(input) {
201
231
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -206,6 +236,9 @@ function isJsonSchemaMap(input) {
206
236
  }
207
237
  /**
208
238
  * Type guard for native enum schemas.
239
+ *
240
+ * @param input - The value to check.
241
+ * @returns True if the input is a native enum schema, false otherwise.
209
242
  */
210
243
  function isJsonSchemaNativeEnum(input) {
211
244
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -215,6 +248,9 @@ function isJsonSchemaNativeEnum(input) {
215
248
  }
216
249
  /**
217
250
  * Type guard for impossible/never schemas.
251
+ *
252
+ * @param input - The value to check.
253
+ * @returns True if the input is a never schema, false otherwise.
218
254
  */
219
255
  function isJsonSchemaNever(input) {
220
256
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -223,6 +259,9 @@ function isJsonSchemaNever(input) {
223
259
  }
224
260
  /**
225
261
  * Type guard for `null` schemas.
262
+ *
263
+ * @param input - The value to check.
264
+ * @returns True if the input is a null schema, false otherwise.
226
265
  */
227
266
  function isJsonSchemaNull(input) {
228
267
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -231,6 +270,9 @@ function isJsonSchemaNull(input) {
231
270
  }
232
271
  /**
233
272
  * Type guard for nullable schema unions.
273
+ *
274
+ * @param input - The value to check.
275
+ * @returns True if the input is a nullable schema union, false otherwise.
234
276
  */
235
277
  function isJsonSchemaNullable(input) {
236
278
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -242,6 +284,9 @@ function isJsonSchemaNullable(input) {
242
284
  }
243
285
  /**
244
286
  * Type guard for numeric schemas.
287
+ *
288
+ * @param input - The value to check.
289
+ * @returns True if the input is a numeric schema, false otherwise.
245
290
  */
246
291
  function isJsonSchemaNumber(input) {
247
292
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -251,18 +296,27 @@ function isJsonSchemaNumber(input) {
251
296
  }
252
297
  /**
253
298
  * Type guard for integer schemas.
299
+ *
300
+ * @param input - The value to check.
301
+ * @returns True if the input is an integer schema, false otherwise.
254
302
  */
255
303
  function isJsonSchemaInteger(input) {
256
304
  return isJsonSchemaNumber(input) && input.type === "integer";
257
305
  }
258
306
  /**
259
307
  * Type guard for decimal schemas.
308
+ *
309
+ * @param input - The value to check.
310
+ * @returns True if the input is a decimal schema, false otherwise.
260
311
  */
261
312
  function isJsonSchemaDecimal(input) {
262
313
  return isJsonSchemaNumber(input) && input.type === "number";
263
314
  }
264
315
  /**
265
316
  * Type guard for object schemas.
317
+ *
318
+ * @param input - The value to check.
319
+ * @returns True if the input is an object schema, false otherwise.
266
320
  */
267
321
  function isJsonSchemaObject(input) {
268
322
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -271,6 +325,9 @@ function isJsonSchemaObject(input) {
271
325
  }
272
326
  /**
273
327
  * Type guard for string schemas.
328
+ *
329
+ * @param input - The value to check.
330
+ * @returns True if the input is a string schema, false otherwise.
274
331
  */
275
332
  function isJsonSchemaString(input) {
276
333
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -279,6 +336,9 @@ function isJsonSchemaString(input) {
279
336
  }
280
337
  /**
281
338
  * Type guard for set-like array schemas.
339
+ *
340
+ * @param input - The value to check.
341
+ * @returns True if the input is a set-like array schema, false otherwise.
282
342
  */
283
343
  function isJsonSchemaSet(input) {
284
344
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -287,6 +347,9 @@ function isJsonSchemaSet(input) {
287
347
  }
288
348
  /**
289
349
  * Type guard for record schemas.
350
+ *
351
+ * @param input - The value to check.
352
+ * @returns True if the input is a record schema, false otherwise.
290
353
  */
291
354
  function isJsonSchemaRecord(input) {
292
355
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -295,6 +358,9 @@ function isJsonSchemaRecord(input) {
295
358
  }
296
359
  /**
297
360
  * Type guard for tuple schemas.
361
+ *
362
+ * @param input - The value to check.
363
+ * @returns True if the input is a tuple schema, false otherwise.
298
364
  */
299
365
  function isJsonSchemaTuple(input) {
300
366
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -303,6 +369,9 @@ function isJsonSchemaTuple(input) {
303
369
  }
304
370
  /**
305
371
  * Type guard for undefined-representing schemas.
372
+ *
373
+ * @param input - The value to check.
374
+ * @returns True if the input is an undefined-representing schema, false otherwise.
306
375
  */
307
376
  function isJsonSchemaUndefined(input) {
308
377
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -311,6 +380,9 @@ function isJsonSchemaUndefined(input) {
311
380
  }
312
381
  /**
313
382
  * Type guard for primitive-union schema variants.
383
+ *
384
+ * @param input - The value to check.
385
+ * @returns True if the input is a primitive-union schema variant, false otherwise.
314
386
  */
315
387
  function isJsonSchemaPrimitiveUnion(input) {
316
388
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -332,6 +404,9 @@ function isJsonSchemaPrimitiveUnion(input) {
332
404
  }
333
405
  /**
334
406
  * Type guard for union schemas.
407
+ *
408
+ * @param input - The value to check.
409
+ * @returns True if the input is a union schema, false otherwise.
335
410
  */
336
411
  function isJsonSchemaUnion(input) {
337
412
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -340,12 +415,18 @@ function isJsonSchemaUnion(input) {
340
415
  }
341
416
  /**
342
417
  * Type guard for permissive unknown schemas.
418
+ *
419
+ * @param input - The value to check.
420
+ * @returns True if the input is a permissive unknown schema, false otherwise.
343
421
  */
344
422
  function isJsonSchemaUnknown(input) {
345
423
  return isJsonSchemaAny(input);
346
424
  }
347
425
  /**
348
426
  * Type guard for `anyOf` composition schemas.
427
+ *
428
+ * @param input - The value to check.
429
+ * @returns True if the input is an `anyOf` schema, false otherwise.
349
430
  */
350
431
  function isJsonSchemaAnyOf(input) {
351
432
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -354,6 +435,9 @@ function isJsonSchemaAnyOf(input) {
354
435
  }
355
436
  /**
356
437
  * Type guard for reference schemas.
438
+ *
439
+ * @param input - The value to check.
440
+ * @returns True if the input is a reference schema, false otherwise.
357
441
  */
358
442
  function isJsonSchemaRef(input) {
359
443
  if (!(0, _stryke_type_checks.isSetObject)(input)) return false;
@@ -496,6 +580,15 @@ function isSchema(input) {
496
580
  function isSchemaWithSource(input) {
497
581
  return isSchema(input) && "source" in input && (0, _stryke_type_checks.isSetObject)(input.source) && "schema" in input.source && "variant" in input.source && (0, _stryke_type_checks.isSetString)(input.source.variant);
498
582
  }
583
+ /**
584
+ * Type guard for Powerlines Schemas that are in Object form.
585
+ *
586
+ * @param input - The value to check.
587
+ * @returns True if the input is a Powerlines Schema object in Object form, false otherwise.
588
+ */
589
+ function isSchemaObject(input) {
590
+ return isSchema(input) && isJsonSchemaObject(input.schema);
591
+ }
499
592
 
500
593
  //#endregion
501
594
  exports.isJsonSchema = isJsonSchema;
@@ -531,6 +624,7 @@ exports.isJsonSchemaUnion = isJsonSchemaUnion;
531
624
  exports.isJsonSchemaUnknown = isJsonSchemaUnknown;
532
625
  exports.isNullOnlyJsonSchema = isNullOnlyJsonSchema;
533
626
  exports.isSchema = isSchema;
627
+ exports.isSchemaObject = isSchemaObject;
534
628
  exports.isSchemaWithSource = isSchemaWithSource;
535
629
  exports.isStandardSchema = isStandardSchema;
536
630
  exports.isUntypedInput = isUntypedInput;
@@ -20,114 +20,198 @@ declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaP
20
20
  declare function isJsonSchemaType(value: unknown): value is JsonSchemaType;
21
21
  /**
22
22
  * Type guard for shared JSON Schema keyword groups.
23
+ *
24
+ * @param input - The value to check.
25
+ * @returns True if the input is a JSON Schema keyword group, false otherwise.
23
26
  */
24
27
  declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords;
25
28
  /**
26
29
  * Type guard for generic JSON Schema objects with optional `$ref`.
30
+ *
31
+ * @param input - The value to check.
32
+ * @returns True if the input is a generic JSON Schema object, false otherwise.
27
33
  */
28
34
  declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny;
29
35
  /**
30
36
  * Type guard for JSON Schema array types.
37
+ *
38
+ * @param input - The value to check.
39
+ * @returns True if the input is a JSON Schema array schema, false otherwise.
31
40
  */
32
41
  declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray;
33
42
  /**
34
43
  * Type guard for bigint-backed integer schemas.
44
+ *
45
+ * @param input - The value to check.
46
+ * @returns True if the input is a bigint-backed integer schema, false otherwise.
35
47
  */
36
48
  declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint;
37
49
  /**
38
50
  * Type guard for boolean schemas.
51
+ *
52
+ * @param input - The value to check.
53
+ * @returns True if the input is a boolean schema, false otherwise.
39
54
  */
40
55
  declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean;
41
56
  /**
42
57
  * Type guard for date/time schemas.
58
+ *
59
+ * @param input - The value to check.
60
+ * @returns True if the input is a date or time schema, false otherwise.
43
61
  */
44
62
  declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate;
45
63
  /**
46
64
  * Type guard for enum-constrained schemas.
65
+ *
66
+ * @param input - The value to check.
67
+ * @returns True if the input is an enum-constrained schema, false otherwise.
47
68
  */
48
69
  declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum;
49
70
  /**
50
71
  * Type guard for `allOf` composition schemas.
72
+ *
73
+ * @param input - The value to check.
74
+ * @returns True if the input is an `allOf` schema, false otherwise.
51
75
  */
52
76
  declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf;
53
77
  /**
54
78
  * Type guard for literal-value schemas.
79
+ *
80
+ * @param input - The value to check.
81
+ * @returns True if the input is a literal-value schema, false otherwise.
55
82
  */
56
83
  declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral;
57
84
  /**
58
85
  * Type guard for map tuple-array schemas.
86
+ *
87
+ * @param input - The value to check.
88
+ * @returns True if the input is a map tuple-array schema, false otherwise.
59
89
  */
60
90
  declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap;
61
91
  /**
62
92
  * Type guard for native enum schemas.
93
+ *
94
+ * @param input - The value to check.
95
+ * @returns True if the input is a native enum schema, false otherwise.
63
96
  */
64
97
  declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum;
65
98
  /**
66
99
  * Type guard for impossible/never schemas.
100
+ *
101
+ * @param input - The value to check.
102
+ * @returns True if the input is a never schema, false otherwise.
67
103
  */
68
104
  declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever;
69
105
  /**
70
106
  * Type guard for `null` schemas.
107
+ *
108
+ * @param input - The value to check.
109
+ * @returns True if the input is a null schema, false otherwise.
71
110
  */
72
111
  declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull;
73
112
  /**
74
113
  * Type guard for nullable schema unions.
114
+ *
115
+ * @param input - The value to check.
116
+ * @returns True if the input is a nullable schema union, false otherwise.
75
117
  */
76
118
  declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable;
77
119
  /**
78
120
  * Type guard for numeric schemas.
121
+ *
122
+ * @param input - The value to check.
123
+ * @returns True if the input is a numeric schema, false otherwise.
79
124
  */
80
125
  declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber;
81
126
  /**
82
127
  * Type guard for integer schemas.
128
+ *
129
+ * @param input - The value to check.
130
+ * @returns True if the input is an integer schema, false otherwise.
83
131
  */
84
132
  declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger;
85
133
  /**
86
134
  * Type guard for decimal schemas.
135
+ *
136
+ * @param input - The value to check.
137
+ * @returns True if the input is a decimal schema, false otherwise.
87
138
  */
88
139
  declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal;
89
140
  /**
90
141
  * Type guard for object schemas.
142
+ *
143
+ * @param input - The value to check.
144
+ * @returns True if the input is an object schema, false otherwise.
91
145
  */
92
146
  declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject;
93
147
  /**
94
148
  * Type guard for string schemas.
149
+ *
150
+ * @param input - The value to check.
151
+ * @returns True if the input is a string schema, false otherwise.
95
152
  */
96
153
  declare function isJsonSchemaString(input: unknown): input is JsonSchemaString;
97
154
  /**
98
155
  * Type guard for set-like array schemas.
156
+ *
157
+ * @param input - The value to check.
158
+ * @returns True if the input is a set-like array schema, false otherwise.
99
159
  */
100
160
  declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet;
101
161
  /**
102
162
  * Type guard for record schemas.
163
+ *
164
+ * @param input - The value to check.
165
+ * @returns True if the input is a record schema, false otherwise.
103
166
  */
104
167
  declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord;
105
168
  /**
106
169
  * Type guard for tuple schemas.
170
+ *
171
+ * @param input - The value to check.
172
+ * @returns True if the input is a tuple schema, false otherwise.
107
173
  */
108
174
  declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple;
109
175
  /**
110
176
  * Type guard for undefined-representing schemas.
177
+ *
178
+ * @param input - The value to check.
179
+ * @returns True if the input is an undefined-representing schema, false otherwise.
111
180
  */
112
181
  declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined;
113
182
  /**
114
183
  * Type guard for primitive-union schema variants.
184
+ *
185
+ * @param input - The value to check.
186
+ * @returns True if the input is a primitive-union schema variant, false otherwise.
115
187
  */
116
188
  declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion;
117
189
  /**
118
190
  * Type guard for union schemas.
191
+ *
192
+ * @param input - The value to check.
193
+ * @returns True if the input is a union schema, false otherwise.
119
194
  */
120
195
  declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion;
121
196
  /**
122
197
  * Type guard for permissive unknown schemas.
198
+ *
199
+ * @param input - The value to check.
200
+ * @returns True if the input is a permissive unknown schema, false otherwise.
123
201
  */
124
202
  declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown;
125
203
  /**
126
204
  * Type guard for `anyOf` composition schemas.
205
+ *
206
+ * @param input - The value to check.
207
+ * @returns True if the input is an `anyOf` schema, false otherwise.
127
208
  */
128
209
  declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf;
129
210
  /**
130
211
  * Type guard for reference schemas.
212
+ *
213
+ * @param input - The value to check.
214
+ * @returns True if the input is a reference schema, false otherwise.
131
215
  */
132
216
  declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef;
133
217
  /**
@@ -220,6 +304,13 @@ declare function isSchema(input: unknown): input is Schema$1;
220
304
  * @returns True if the input is a SchemaWithSource object, false otherwise.
221
305
  */
222
306
  declare function isSchemaWithSource(input: unknown): input is ExtractedSchema;
307
+ /**
308
+ * Type guard for Powerlines Schemas that are in Object form.
309
+ *
310
+ * @param input - The value to check.
311
+ * @returns True if the input is a Powerlines Schema object in Object form, false otherwise.
312
+ */
313
+ declare function isSchemaObject(input: unknown): input is Schema$1<JsonSchemaObject>;
223
314
  //#endregion
224
- export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema };
315
+ export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaObject, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedInputStrict, isUntypedSchema, isUntypedSchemaStrict, isValibotSchema };
225
316
  //# sourceMappingURL=type-checks.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.d.cts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;AAoGA;;;;iBAAgB,yBAAA,CACd,KAAA,YACC,KAAA,IAAS,uBAAuB;;;;AAAA;AAanC;;iBAAgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;iBA2QzD,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,kBAAkB;;AA7Q2C;AA2QzE;iBAagB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;;;;iBAavD,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eA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