typia 14.0.0 → 14.0.2

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.
Files changed (41) hide show
  1. package/lib/internal/_createStandardSchema.d.ts +1 -2
  2. package/lib/internal/_createStandardSchema.js.map +1 -1
  3. package/lib/internal/_createStandardSchema.mjs.map +1 -1
  4. package/lib/module.d.ts +1 -2
  5. package/lib/module.js.map +1 -1
  6. package/lib/module.mjs.map +1 -1
  7. package/lib/re-exports.d.ts +1 -1
  8. package/lib/re-exports.js.map +1 -1
  9. package/lib/transformers/NoTransformConfigurationError.js +19 -4
  10. package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
  11. package/lib/transformers/NoTransformConfigurationError.mjs +12 -6
  12. package/lib/transformers/NoTransformConfigurationError.mjs.map +1 -1
  13. package/native/cmd/ttsc-typia/create_assert_error_factory_arity_test.go +5 -2
  14. package/native/cmd/ttsc-typia/dependency_collector_virtual_scheme_test.go +52 -0
  15. package/native/cmd/ttsc-typia/json_schema_nonsensible_intersection_diagnostic_test.go +80 -0
  16. package/native/cmd/ttsc-typia/project_dependencies_callee_argument_transform_test.go +177 -0
  17. package/native/cmd/ttsc-typia/project_dependencies_callee_barrel_transform_test.go +115 -0
  18. package/native/cmd/ttsc-typia/project_dependencies_callee_inference_transform_test.go +285 -0
  19. package/native/cmd/ttsc-typia/project_dependencies_callee_shape_transform_test.go +117 -0
  20. package/native/cmd/ttsc-typia/project_dependencies_callee_untransformed_barrel_transform_test.go +121 -0
  21. package/native/cmd/ttsc-typia/project_dependencies_complete_diagnostic_transform_test.go +116 -0
  22. package/native/cmd/ttsc-typia/project_dependencies_complete_envelope_transform_test.go +115 -0
  23. package/native/cmd/ttsc-typia/project_dependencies_complete_inferred_type_transform_test.go +127 -0
  24. package/native/cmd/ttsc-typia/project_dependencies_complete_replaced_library_transform_test.go +153 -0
  25. package/native/cmd/ttsc-typia/project_dependencies_complete_untouched_reprint_transform_test.go +155 -0
  26. package/native/cmd/ttsc-typia/project_dependencies_computed_key_transform_test.go +218 -0
  27. package/native/cmd/ttsc-typia/project_dependencies_custom_lib_name_transform_test.go +6 -5
  28. package/native/cmd/ttsc-typia/project_dependencies_enum_member_value_transform_test.go +131 -0
  29. package/native/cmd/ttsc-typia/project_dependencies_inferred_declaration_transform_test.go +159 -0
  30. package/native/cmd/ttsc-typia/project_dependencies_jsdoc_typedef_transform_test.go +134 -0
  31. package/native/cmd/ttsc-typia/project_dependencies_named_tuple_member_transform_test.go +123 -0
  32. package/native/cmd/ttsc-typia/project_dependencies_qualified_barrel_transform_test.go +141 -0
  33. package/native/cmd/ttsc-typia/project_dependencies_type_parameter_default_transform_test.go +127 -0
  34. package/native/cmd/ttsc-typia/transform.go +193 -19
  35. package/native/core/schemas/metadata/MetadataDependency.go +613 -30
  36. package/native/transform/CallExpressionTransformer.go +16 -1
  37. package/package.json +4 -5
  38. package/src/internal/_createStandardSchema.ts +1 -2
  39. package/src/module.ts +6 -2
  40. package/src/re-exports.ts +13 -0
  41. package/src/transformers/NoTransformConfigurationError.ts +19 -4
@@ -1,3 +1,2 @@
1
- import { StandardSchemaV1 } from "@standard-schema/spec";
2
- import { IValidation } from "@typia/interface";
1
+ import { IValidation, StandardSchemaV1 } from "@typia/interface";
3
2
  export declare const _createStandardSchema: <T>(fn: (input: unknown) => IValidation<T>) => ((input: unknown) => IValidation<T>) & StandardSchemaV1<T, T>;
@@ -1 +1 @@
1
- {"version":3,"file":"_createStandardSchema.js","sourceRoot":"","sources":["../../src/internal/_createStandardSchema.ts"],"names":[],"mappings":";;;AAGO,MAAM,qBAAqB,GAAG,CACnC,EAAsC,EACyB,EAAE,CACjE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;IAChB,WAAW,EAAE;QACX,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,KAAc,EAA8B,EAAE;YACvD,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAA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AC;oBAClC,KAAK,EAAE,CAAC;oBACR,cAAc,GAAG,GAAG,CAAC;gBACvB,CAAC;qBAAM,CAAC;oBACN,sBAAsB;oBACtB,KAAK,GAAG,eAAe,CAAC,SAAS,CAAC;gBACpC,CAAC;YACH,CAAC;iBAAM,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;gBAC3B,oBAAoB;gBACpB,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,KAAK,KAAK,eAAe,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"_createStandardSchema.js","sourceRoot":"","sources":["../../src/internal/_createStandardSchema.ts"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG,CACnC,EAAsC,EACyB,EAAE,CACjE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;IAChB,WAAW,EAAE;QACX,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,KAAc,EAA8B,EAAE;YACvD,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO;oBACL,KAAK,EAAE,MAAM,CAAC,IAAI;iBACyB,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;wBACpC,OAAO,EAAE,YAAY,KAAK,CAAC,QAAQ,SAAS,WAAW,CAAC,KAAK,CAAC,K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AAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,KAAK,KAAK,eAAe,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"_createStandardSchema.mjs","names":[],"sources":["../../src/internal/_createStandardSchema.ts"],"sourcesContent":["import { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { IValidation } from \"@typia/interface\";\n\nexport const _createStandardSchema = <T>(\n fn: (input: unknown) => IValidation<T>,\n): ((input: unknown) => IValidation<T>) & StandardSchemaV1<T, T> =>\n Object.assign(fn, {\n \"~standard\": {\n version: 1,\n vendor: \"typia\",\n validate: (input: unknown): StandardSchemaV1.Result<T> => {\n const result = fn(input);\n if (result.success) {\n return {\n value: result.data,\n } satisfies StandardSchemaV1.SuccessResult<T>;\n } else {\n return {\n issues: result.errors.map((error) => ({\n message: `expected ${error.expected}, got ${formatValue(error.value)}`,\n path: typiaPathToStandardSchemaPath(error.path),\n })),\n } satisfies StandardSchemaV1.FailureResult;\n }\n },\n },\n } satisfies StandardSchemaV1<T, T>);\n\nconst formatValue = (value: unknown): string => {\n if (typeof value === \"object\") {\n if (value === null) return \"null\";\n try {\n if (Array.isArray(value)) return \"[object Array]\";\n } catch {\n // A revoked proxy can throw even for Array.isArray().\n }\n return \"[object Object]\";\n }\n if (typeof value === \"function\") return \"[function]\";\n return String(value);\n};\n\nenum PathParserState {\n // Start of a new segment\n // When the parser is in this state,\n // the pointer must point `.` or `[` or equal to length of the path\n Start,\n // Parsing a property key (`.hoge`)\n Property,\n // Parsing a string key (`[\"fuga\"]`)\n StringKey,\n // Parsing a number key (`[42]`)\n NumberKey,\n}\n\nconst typiaPathToStandardSchemaPath = (\n path: string,\n): ReadonlyArray<StandardSchemaV1.PathSegment> => {\n if (!path.startsWith(\"$input\")) {\n throw new Error(`Invalid path: ${JSON.stringify(path)}`);\n }\n\n const segments: StandardSchemaV1.PathSegment[] = [];\n let currentSegment = \"\";\n let state: PathParserState = PathParserState.Start;\n let index = \"$input\".length - 1;\n while (index < path.length - 1) {\n index++;\n const char = path[index];\n\n if (state === PathParserState.Property) {\n if (char === \".\" || char === \"[\") {\n // End of property\n segments.push({\n key: currentSegment,\n });\n state = PathParserState.Start;\n } else if (index === path.length - 1) {\n // End of path\n currentSegment += char;\n segments.push({\n key: currentSegment,\n });\n index++;\n state = PathParserState.Start;\n } else {\n currentSegment += char;\n }\n } else if (state === PathParserState.StringKey) {\n if (char === '\"') {\n // End of string key\n segments.push({\n key: JSON.parse(currentSegment + char),\n });\n // Skip `\"` and `]`\n index += 2;\n state = PathParserState.Start;\n } else if (char === \"\\\\\") {\n // Skip the next character from parsing\n currentSegment += path[index];\n index++;\n currentSegment += path[index];\n } else {\n currentSegment += char;\n }\n } else if (state === PathParserState.NumberKey) {\n if (char === \"]\") {\n // End of number key\n segments.push({\n key: Number.parseInt(currentSegment),\n });\n index++;\n state = PathParserState.Start;\n } else {\n currentSegment += char;\n }\n }\n\n if (state === PathParserState.Start && index < path.length - 1) {\n const newChar = path[index];\n currentSegment = \"\";\n if (newChar === \"[\") {\n if (path[index + 1] === '\"') {\n // Start of string key\n // NOTE: Typia uses JSON.stringify for this kind of keys, so `'` will not used as a string delimiter\n state = PathParserState.StringKey;\n index++;\n currentSegment = '\"';\n } else {\n // Start of number key\n state = PathParserState.NumberKey;\n }\n } else if (newChar === \".\") {\n // Start of property\n state = PathParserState.Property;\n } else {\n throw new Error(\"Unreachable: pointer points invalid character\");\n }\n }\n }\n\n if (state !== PathParserState.Start) {\n throw new Error(`Failed to parse path: ${JSON.stringify(path)}`);\n }\n\n return segments;\n};\n"],"mappings":";AAGA,MAAa,yBACX,OAEA,OAAO,OAAO,IAAI,EAChB,aA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KAAK;GACvB;GACA,kBAAkB,KAAK;EACzB,OACE,kBAAkB;OAEf,IAAI,UAAA,GACT,IAAI,SAAS,KAAK;GAEhB,SAAS,KAAK,EACZ,KAAK,OAAO,SAAS,cAAc,EACrC,CAAC;GACD;GACA,QAAA;EACF,OACE,kBAAkB;EAItB,IAAI,UAAA,KAAmC,QAAQ,KAAK,SAAS,GAAG;GAC9D,MAAM,UAAU,KAAK;GACrB,iBAAiB;GACjB,IAAI,YAAY,KACd,IAAI,KAAK,QAAQ,OAAO,MAAK;IAG3B,QAAA;IACA;IACA,iBAAiB;GACnB,OAEE,QAAA;QAEG,IAAI,YAAY,KAErB,QAAA;QAEA,MAAM,IAAI,MAAM,+CAA+C;EAEnE;CACF;CAEA,IAAI,UAAA,GACF,MAAM,IAAI,MAAM,yBAAyB,KAAK,UAAU,IAAI,GAAG;CAGjE,OAAO;AACT"}
1
+ {"version":3,"file":"_createStandardSchema.mjs","names":[],"sources":["../../src/internal/_createStandardSchema.ts"],"sourcesContent":["import { IValidation, StandardSchemaV1 } from \"@typia/interface\";\n\nexport const _createStandardSchema = <T>(\n fn: (input: unknown) => IValidation<T>,\n): ((input: unknown) => IValidation<T>) & StandardSchemaV1<T, T> =>\n Object.assign(fn, {\n \"~standard\": {\n version: 1,\n vendor: \"typia\",\n validate: (input: unknown): StandardSchemaV1.Result<T> => {\n const result = fn(input);\n if (result.success) {\n return {\n value: result.data,\n } satisfies StandardSchemaV1.SuccessResult<T>;\n } else {\n return {\n issues: result.errors.map((error) => ({\n message: `expected ${error.expected}, got ${formatValue(error.value)}`,\n path: typiaPathToStandardSchemaPath(error.path),\n })),\n } satisfies StandardSchemaV1.FailureResult;\n }\n },\n },\n } satisfies StandardSchemaV1<T, T>);\n\nconst formatValue = (value: unknown): string => {\n if (typeof value === \"object\") {\n if (value === null) return \"null\";\n try {\n if (Array.isArray(value)) return \"[object Array]\";\n } catch {\n // A revoked proxy can throw even for Array.isArray().\n }\n return \"[object Object]\";\n }\n if (typeof value === \"function\") return \"[function]\";\n return String(value);\n};\n\nenum PathParserState {\n // Start of a new segment\n // When the parser is in this state,\n // the pointer must point `.` or `[` or equal to length of the path\n Start,\n // Parsing a property key (`.hoge`)\n Property,\n // Parsing a string key (`[\"fuga\"]`)\n StringKey,\n // Parsing a number key (`[42]`)\n NumberKey,\n}\n\nconst typiaPathToStandardSchemaPath = (\n path: string,\n): ReadonlyArray<StandardSchemaV1.PathSegment> => {\n if (!path.startsWith(\"$input\")) {\n throw new Error(`Invalid path: ${JSON.stringify(path)}`);\n }\n\n const segments: StandardSchemaV1.PathSegment[] = [];\n let currentSegment = \"\";\n let state: PathParserState = PathParserState.Start;\n let index = \"$input\".length - 1;\n while (index < path.length - 1) {\n index++;\n const char = path[index];\n\n if (state === PathParserState.Property) {\n if (char === \".\" || char === \"[\") {\n // End of property\n segments.push({\n key: currentSegment,\n });\n state = PathParserState.Start;\n } else if (index === path.length - 1) {\n // End of path\n currentSegment += char;\n segments.push({\n key: currentSegment,\n });\n index++;\n state = PathParserState.Start;\n } else {\n currentSegment += char;\n }\n } else if (state === PathParserState.StringKey) {\n if (char === '\"') {\n // End of string key\n segments.push({\n key: JSON.parse(currentSegment + char),\n });\n // Skip `\"` and `]`\n index += 2;\n state = PathParserState.Start;\n } else if (char === \"\\\\\") {\n // Skip the next character from parsing\n currentSegment += path[index];\n index++;\n currentSegment += path[index];\n } else {\n currentSegment += char;\n }\n } else if (state === PathParserState.NumberKey) {\n if (char === \"]\") {\n // End of number key\n segments.push({\n key: Number.parseInt(currentSegment),\n });\n index++;\n state = PathParserState.Start;\n } else {\n currentSegment += char;\n }\n }\n\n if (state === PathParserState.Start && index < path.length - 1) {\n const newChar = path[index];\n currentSegment = \"\";\n if (newChar === \"[\") {\n if (path[index + 1] === '\"') {\n // Start of string key\n // NOTE: Typia uses JSON.stringify for this kind of keys, so `'` will not used as a string delimiter\n state = PathParserState.StringKey;\n index++;\n currentSegment = '\"';\n } else {\n // Start of number key\n state = PathParserState.NumberKey;\n }\n } else if (newChar === \".\") {\n // Start of property\n state = PathParserState.Property;\n } else {\n throw new Error(\"Unreachable: pointer points invalid character\");\n }\n }\n }\n\n if (state !== PathParserState.Start) {\n throw new Error(`Failed to parse path: ${JSON.stringify(path)}`);\n }\n\n return segments;\n};\n"],"mappings":";AAEA,MAAa,yBACX,OAEA,OAAO,OAAO,IAAI,EAChB,aAAa;CACX,SAAS;CACT,QAAQ;CACR,WAAW,UAA+C;EACxD,MAAM,SAAS,GAAG,KAAK;EACvB,IAAI,OAAO,SACT,OAAO,EACL,OAAO,OAAO,KAChB;OAEA,OAAO,EACL,QAAQ,OAAO,OAAO,KAAK,WAAW;GACpC,SAAS,YAAY,MAAM,SAAS,QAAQ,YAAY,MAAM,KAAK;GACnE,MAAM,8BAA8B,MAAM,IAAI;EAChD,EAAE,EACJ;CAEJ;AACF,EACF,CAAkC;AAEpC,MAAM,eAAe,UAA2B;CAC9C,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,UAAU,MAAM,OAAO;EAC3B,IAAI;GACF,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;EACnC,QAAQ,CAER;EACA,OAAO;CACT;CACA,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,OAAO,OAAO,KAAK;AACrB;AAeA,MAAM,iCACJ,SACgD;CAChD,IAAI,CAAC,KAAK,WAAW,QAAQ,GAC3B,MAAM,IAAI,MAAM,iBAAiB,KAAK,UAAU,IAAI,GAAG;CAGzD,MAAM,WAA2C,CAAC;CAClD,IAAI,iBAAiB;CACrB,IAAI,QAAA;CACJ,IAAI,QAAQ;CACZ,OAAO,QAAQ,KAAK,SAAS,GAAG;EAC9B;EACA,MAAM,OAAO,KAAK;EAElB,IAAI,UAAA,GACF,IAAI,SAAS,OAAO,SAAS,KAAK;GAEhC,SAAS,KAAK,EACZ,KAAK,eACP,CAAC;GACD,QAAA;EACF,OAAO,IAAI,UAAU,KAAK,SAAS,GAAG;GAEpC,kBAAkB;GAClB,SAAS,KAAK,EACZ,KAAK,eACP,CAAC;GACD;GACA,QAAA;EACF,OACE,kBAAkB;OAEf,IAAI,UAAA,GACT,IAAI,SAAS,MAAK;GAEhB,SAAS,KAAK,EACZ,KAAK,KAAK,MAAM,iBAAiB,IAAI,EACvC,CAAC;GAED,SAAS;GACT,QAAA;EACF,OAAO,IAAI,SAAS,MAAM;GAExB,kBAAkB,KAAK;GACvB;GACA,kBAAkB,KAAK;EACzB,OACE,kBAAkB;OAEf,IAAI,UAAA,GACT,IAAI,SAAS,KAAK;GAEhB,SAAS,KAAK,EACZ,KAAK,OAAO,SAAS,cAAc,EACrC,CAAC;GACD;GACA,QAAA;EACF,OACE,kBAAkB;EAItB,IAAI,UAAA,KAAmC,QAAQ,KAAK,SAAS,GAAG;GAC9D,MAAM,UAAU,KAAK;GACrB,iBAAiB;GACjB,IAAI,YAAY,KACd,IAAI,KAAK,QAAQ,OAAO,MAAK;IAG3B,QAAA;IACA;IACA,iBAAiB;GACnB,OAEE,QAAA;QAEG,IAAI,YAAY,KAErB,QAAA;QAEA,MAAM,IAAI,MAAM,+CAA+C;EAEnE;CACF;CAEA,IAAI,UAAA,GACF,MAAM,IAAI,MAAM,yBAAyB,KAAK,UAAU,IAAI,GAAG;CAGjE,OAAO;AACT"}
package/lib/module.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { StandardSchemaV1 } from "@standard-schema/spec";
2
- import { IRandomGenerator, IValidation, Resolved } from "@typia/interface";
1
+ import { IRandomGenerator, IValidation, Resolved, StandardSchemaV1 } from "@typia/interface";
3
2
  import { TypeGuardError } from "./TypeGuardError";
4
3
  export * as compare from "./compare";
5
4
  export * as functional from "./functional";
package/lib/module.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gGAA6F;AAE7F,QAAY,OAAO,sC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AAA,6DAA6B,EAAC,sBAAsB,CAAC,CAAC;AACxD,CAAC;AA6BD,gBAAgB;AAChB;IACE,IAAA,6DAA6B,EAAC,cAAc,CAAC,CAAC;AAChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":[],"sources":["../src/module.ts"],"sourcesContent":["import { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { IRandomGenerator, IValidation, Resolved } from \"@typia/interface\";\n\nimport { TypeGuardError } from \"./TypeGuardError\";\nimport { NoTransformConfigurationError } from \"./transformers/NoTransformConfigurationError\";\n\nexport * as compare from \"./compare\";\nexport * as functional from \"./functional\";\nexport * as http from \"./http\";\nexport * as llm from \"./llm\";\nexport * as json from \"./json\";\nexport * as plain from \"./plain\";\nexport * as notations from \"./notations\";\nexport * as protobuf from \"./protobuf\";\nexport * as reflect from \"./reflect\";\n\nexport * from \"./TypeGuardError\";\n\nexport * from \"./re-exports\";\n\n/* -----------------------------------------------------------\n BASIC VALIDATORS\n----------------------------------------------------------- */\n/**\n * Asserts type `T`.\n *\n * Performs runtime type checking against compile-time type `T`. Stops at first\n * mismatch and throws {@link TypeGuardError} containing:\n *\n * - `path`: Property path where error occurred (e.g., `\"input.user.age\"`)\n * - `expected`: Expected type string (e.g., `\"number & ExclusiveMinimum<19>\"`)\n * - `value`: Actual value that failed validation\n *\n * Related functions:\n *\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of stopping at first\n * - {@link assertGuard} — Type guard with no return value (narrows type only)\n * - {@link assertEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assert<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/**\n * Asserts type `T`.\n *\n * Performs runtime type checking against compile-time type `T`. Stops at first\n * mismatch and throws {@link TypeGuardError} containing:\n *\n * - `path`: Property path where error occurred (e.g., `\"input.user.age\"`)\n * - `expected`: Expected type string (e.g., `\"number & ExclusiveMinimum<19>\"`)\n * - `value`: Actual value that failed validation\n *\n * Related functions:\n *\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of stopping at first\n * - {@link assertGuard} — Type guard with no return value (narrows type only)\n * - {@link assertEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assert<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/** @internal */\nexport function assert(): never {\n NoTransformConfigurationError(\"assert\");\n}\n\n/**\n * Asserts type `T` as assertion guard.\n *\n * Unlike {@link assert}, returns nothing (`asserts input is T`). After this\n * call, TypeScript narrows `input` to type `T` in subsequent code. Useful when\n * you need type narrowing with runtime validation but don't need the return\n * value.\n *\n * Throws {@link TypeGuardError} on first mismatch with `path`, `expected`, and\n * `value`.\n *\n * Related functions:\n *\n * - {@link assert} — Same validation but returns the input value\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of throwing\n * - {@link assertGuardEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assertGuard<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/**\n * Asserts type `T` as assertion guard.\n *\n * Unlike {@link assert}, returns nothing (`asserts input is T`). After this\n * call, TypeScript narrows `input` to type `T` in subsequent code. Useful when\n * you need type narrowing with runtime validation but don't need the return\n * value.\n *\n * Throws {@link TypeGuardError} on first mismatch with `path`, `expected`, and\n * `value`.\n *\n * Related functions:\n *\n * - {@link assert} — Same validation but returns the input value\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of throwing\n * - {@link assertGuardEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assertGuard<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/** @internal */\nexport function assertGuard(): never {\n NoTransformConfigurationError(\"assertGuard\");\n}\n\n/**\n * Tests type `T`.\n *\n * Performs runtime type checking without throwing exceptions. Acts as\n * TypeScript type guard, narrowing the input type in conditional branches when\n * result is `true`.\n *\n * Related functions:\n *\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n * - {@link equals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to check\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function is<T>(input: T): input is T;\n\n/**\n * Tests type `T`.\n *\n * Performs runtime type checking without throwing exceptions. Acts as\n * TypeScript type guard, narrowing the input type in conditional branches when\n * result is `true`.\n *\n * Related functions:\n *\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n * - {@link equals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to check\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function is<T>(input: unknown): input is T;\n\n/** @internal */\nexport function is(): never {\n NoTransformConfigurationError(\"is\");\n}\n\n/**\n * Tests type `T` up to a limited depth.\n *\n * Like {@link is}, but only descends into nested objects, arrays, and tuples\n * until the depth budget `N` is exhausted; beyond that point a value is\n * accepted as long as it is an `object` (or `null` where the type permits).\n * Useful for **discrimination** rather than full validation — when you only\n * need to know which branch of a union an input belongs to, paying for a deep\n * structural check of every leaf is wasteful.\n *\n * Because the check is shallow past depth `N`, a `true` result is **not** a\n * guarantee that the whole value conforms to `T`. The name `shallow` reflects\n * this: only the discriminating, near-surface part of the type is verified. For\n * a full guarantee, use {@link is}.\n *\n * Related functions:\n *\n * - {@link is} — Full-depth check, returns a sound type guard\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @param input Value to test\n * @returns `true` if valid up to depth `N`, `false` otherwise (type predicate\n * `input is T`)\n */\nexport function shallow<T, N extends number = 2>(input: T): input is T;\n\n/**\n * Tests type `T` up to a limited depth.\n *\n * Like {@link is}, but only descends into nested objects, arrays, and tuples\n * until the depth budget `N` is exhausted; beyond that point a value is\n * accepted as long as it is an `object` (or `null` where the type permits).\n * Useful for **discrimination** rather than full validation — when you only\n * need to know which branch of a union an input belongs to, paying for a deep\n * structural check of every leaf is wasteful.\n *\n * Because the check is shallow past depth `N`, a `true` result is **not** a\n * guarantee that the whole value conforms to `T`. The name `shallow` reflects\n * this: only the discriminating, near-surface part of the type is verified. For\n * a full guarantee, use {@link is}.\n *\n * Related functions:\n *\n * - {@link is} — Full-depth check, returns a sound type guard\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @param input Value to test\n * @returns `true` if valid up to depth `N`, `false` otherwise (type predicate\n * `input is T`)\n */\nexport function shallow<T, N extends number = 2>(input: unknown): input is T;\n\n/** @internal */\nexport function shallow(): never {\n NoTransformConfigurationError(\"shallow\");\n}\n\n/**\n * Validates type `T`.\n *\n * Unlike {@link assert} which throws on first error, this function continues\n * checking and collects all type mismatches into {@link IValidation.errors}\n * array. Never throws.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array of {@link IValidation.IError} with `path`,\n * `expected`, `value`\n *\n * Related functions:\n *\n * - {@link assert} — Throws on first error instead of collecting all\n * - {@link is} — Simple boolean check\n * - {@link validateEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validate<T>(input: T): IValidation<T>;\n\n/**\n * Validates type `T`.\n *\n * Unlike {@link assert} which throws on first error, this function continues\n * checking and collects all type mismatches into {@link IValidation.errors}\n * array. Never throws.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array of {@link IValidation.IError} with `path`,\n * `expected`, `value`\n *\n * Related functions:\n *\n * - {@link assert} — Throws on first error instead of collecting all\n * - {@link is} — Simple boolean check\n * - {@link validateEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validate<T>(input: unknown): IValidation<T>;\n\n/** @internal */\nexport function validate(): never {\n NoTransformConfigurationError(\"validate\");\n}\n\n/* -----------------------------------------------------------\n STRICT VALIDATORS\n----------------------------------------------------------- */\n/**\n * Asserts type `T` with strict equality.\n *\n * Stricter than {@link assert}: also fails when input contains any property not\n * defined in type `T`. For extra property errors, `expected` will be\n * `\"undefined\"`.\n *\n * Related functions:\n *\n * - {@link assert} — Allows extra properties\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n * - {@link assertGuardEquals} — Type guard version with no return value\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertEquals<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/**\n * Asserts type `T` with strict equality.\n *\n * Stricter than {@link assert}: also fails when input contains any property not\n * defined in type `T`. For extra property errors, `expected` will be\n * `\"undefined\"`.\n *\n * Related functions:\n *\n * - {@link assert} — Allows extra properties\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n * - {@link assertGuardEquals} — Type guard version with no return value\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertEquals<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/** @internal */\nexport function assertEquals(): never {\n NoTransformConfigurationError(\"assertEquals\");\n}\n\n/**\n * Asserts type `T` with strict equality as assertion guard.\n *\n * Combines {@link assertGuard} with strict equality checking. Returns nothing\n * but narrows input to type `T`. Also fails when input contains properties not\n * in `T`.\n *\n * Related functions:\n *\n * - {@link assertGuard} — Allows extra properties\n * - {@link assertEquals} — Returns value instead of type guard\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertGuardEquals<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/**\n * Asserts type `T` with strict equality as assertion guard.\n *\n * Combines {@link assertGuard} with strict equality checking. Returns nothing\n * but narrows input to type `T`. Also fails when input contains properties not\n * in `T`.\n *\n * Related functions:\n *\n * - {@link assertGuard} — Allows extra properties\n * - {@link assertEquals} — Returns value instead of type guard\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertGuardEquals<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/** @internal */\nexport function assertGuardEquals(): never {\n NoTransformConfigurationError(\"assertGuardEquals\");\n}\n\n/**\n * Tests type `T` with strict equality.\n *\n * Stricter than {@link is}: also returns `false` when input contains any\n * property not defined in type `T`. Useful for detecting unexpected data or\n * typos.\n *\n * Related functions:\n *\n * - {@link is} — Allows extra properties\n * - {@link assertEquals} — Throws with detailed error info on mismatch\n * - {@link validateEquals} — Returns all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function equals<T>(input: T): input is T;\n\n/**\n * Tests type `T` with strict equality.\n *\n * Stricter than {@link is}: also returns `false` when input contains any\n * property not defined in type `T`. Useful for detecting unexpected data or\n * typos.\n *\n * Related functions:\n *\n * - {@link is} — Allows extra properties\n * - {@link assertEquals} — Throws with detailed error info on mismatch\n * - {@link validateEquals} — Returns all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function equals<T>(input: unknown): input is T;\n\n/** @internal */\nexport function equals(): never {\n NoTransformConfigurationError(\"equals\");\n}\n\n/**\n * Validates type `T` with strict equality.\n *\n * Combines {@link validate} with strict equality checking. Collects all errors\n * including extra property violations into {@link IValidation.errors} array.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array with `path`, `expected`, `value` for each\n * mismatch\n *\n * Related functions:\n *\n * - {@link validate} — Allows extra properties\n * - {@link assertEquals} — Throws on first error\n * - {@link equals} — Simple boolean check\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validateEquals<T>(input: T): IValidation<T>;\n\n/**\n * Validates type `T` with strict equality.\n *\n * Combines {@link validate} with strict equality checking. Collects all errors\n * including extra property violations into {@link IValidation.errors} array.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array with `path`, `expected`, `value` for each\n * mismatch\n *\n * Related functions:\n *\n * - {@link validate} — Allows extra properties\n * - {@link assertEquals} — Throws on first error\n * - {@link equals} — Simple boolean check\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validateEquals<T>(input: unknown): IValidation<T>;\n\n/** @internal */\nexport function validateEquals(): never {\n NoTransformConfigurationError(\"validateEquals\");\n}\n\n/* -----------------------------------------------------------\n RANDOM\n----------------------------------------------------------- */\n/**\n * Generates random data of type `T`.\n *\n * Creates random instance conforming to compile-time type `T`. Generates only\n * primitive data; methods in `T` are ignored. If `T` has `toJSON()` method,\n * generates its return type instead.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Randomly generated data as `Resolved<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function random(generator?: Partial<IRandomGenerator>): never;\n\n/**\n * Generates random data of type `T`.\n *\n * Creates random instance conforming to compile-time type `T`. Generates only\n * primitive data; methods in `T` are ignored. If `T` has `toJSON()` method,\n * generates its return type instead.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Randomly generated data as `Resolved<T>`\n */\nexport function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;\n\n/** @internal */\nexport function random(): never {\n NoTransformConfigurationError(\"random\");\n}\n\n/* -----------------------------------------------------------\n FACTORY FUNCTIONS\n----------------------------------------------------------- */\n/**\n * Creates reusable {@link assert} function.\n *\n * Returns a function that can be called multiple times without recompilation.\n * Useful when the same type validation is needed repeatedly.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assert function `(input: unknown, errorFactory?) => T`\n * @danger You must configure the generic argument `T`\n */\nexport function createAssert(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assert} function.\n *\n * Returns a function that can be called multiple times without recompilation.\n * Useful when the same type validation is needed repeatedly.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assert function `(input: unknown, errorFactory?) => T`,\n * whose own `errorFactory` overrides this one for that single call\n */\nexport function createAssert<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T;\n\n/** @internal */\nexport function createAssert<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T {\n NoTransformConfigurationError(\"createAssert\");\n}\n\n/**\n * Creates reusable {@link assertGuard} function.\n *\n * Returns a reusable type guard assertion function.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuard<T>()` — otherwise compile error.\n * That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertGuard(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertGuard} function.\n *\n * Returns a reusable type guard assertion function.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuard<T>()` — otherwise compile error.\n * That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function, whose own `errorFactory`\n * overrides this one for that single call\n */\nexport function createAssertGuard<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T;\n\n/** @internal */\nexport function createAssertGuard<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T {\n NoTransformConfigurationError(\"createAssertGuard\");\n}\n\n/**\n * Creates reusable {@link is} function.\n *\n * Returns a type guard function that can be called multiple times without\n * recompilation.\n *\n * @template T Target type to check\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createIs(): never;\n\n/**\n * Creates reusable {@link is} function.\n *\n * Returns a type guard function that can be called multiple times without\n * recompilation.\n *\n * @template T Target type to check\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createIs<T>(): (input: unknown) => input is T;\n\n/** @internal */\nexport function createIs<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createIs\");\n}\n\n/**\n * Creates reusable {@link shallow} function.\n *\n * Returns a depth-limited type guard function that can be called multiple times\n * without recompilation.\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createShallow(): never;\n\n/**\n * Creates reusable {@link shallow} function.\n *\n * Returns a depth-limited type guard function that can be called multiple times\n * without recompilation.\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createShallow<T, N extends number = 2>(): (\n input: unknown,\n) => input is T;\n\n/** @internal */\nexport function createShallow<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createShallow\");\n}\n\n/**\n * Creates reusable {@link validate} function.\n *\n * Returns a validation function that can be called multiple times without\n * recompilation. Also implements {@link StandardSchemaV1} interface for\n * interoperability.\n *\n * @template T Target type to validate against\n * @returns Reusable validate function `(input: unknown) => IValidation<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createValidate(): never;\n\n/**\n * Creates reusable {@link validate} function.\n *\n * Returns a validation function that can be called multiple times without\n * recompilation. Also implements {@link StandardSchemaV1} interface for\n * interoperability.\n *\n * @template T Target type to validate against\n * @returns Reusable validate function `(input: unknown) => IValidation<T>`\n */\nexport function createValidate<T>(): ((input: unknown) => IValidation<T>) &\n StandardSchemaV1<T, T>;\n\n/** @internal */\nexport function createValidate(): ((input: unknown) => IValidation) &\n StandardSchemaV1<unknown, unknown> {\n NoTransformConfigurationError(\"createValidate\");\n}\n\n/**\n * Creates reusable {@link assertEquals} function.\n *\n * Returns a strict assertion function that rejects superfluous properties. Can\n * be called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertEquals function `(input: unknown, errorFactory?) =>\n * T`\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertEquals(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertEquals} function.\n *\n * Returns a strict assertion function that rejects superfluous properties. Can\n * be called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertEquals function `(input: unknown, errorFactory?) =>\n * T`, whose own `errorFactory` overrides this one for that single call\n */\nexport function createAssertEquals<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T;\n\n/** @internal */\nexport function createAssertEquals<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T {\n NoTransformConfigurationError(\"createAssertEquals\");\n}\n\n/**\n * Creates reusable {@link assertGuardEquals} function.\n *\n * Returns a strict assertion guard that rejects superfluous properties.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuardEquals<T>()` — otherwise compile\n * error. That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertGuardEquals(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertGuardEquals} function.\n *\n * Returns a strict assertion guard that rejects superfluous properties.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuardEquals<T>()` — otherwise compile\n * error. That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function, whose own `errorFactory`\n * overrides this one for that single call\n */\nexport function createAssertGuardEquals<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T;\n\n/** @internal */\nexport function createAssertGuardEquals<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T {\n NoTransformConfigurationError(\"createAssertGuardEquals\");\n}\n\n/**\n * Creates reusable {@link equals} function.\n *\n * Returns a strict type guard that rejects superfluous properties. Can be\n * called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createEquals(): never;\n\n/**\n * Creates reusable {@link equals} function.\n *\n * Returns a strict type guard that rejects superfluous properties. Can be\n * called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createEquals<T>(): (input: unknown) => input is T;\n\n/** @internal */\nexport function createEquals<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createEquals\");\n}\n\n/**\n * Creates reusable {@link validateEquals} function.\n *\n * Returns a strict validation function that rejects superfluous properties.\n * Also implements {@link StandardSchemaV1} interface for interoperability.\n *\n * @template T Target type for exact match\n * @returns Reusable validateEquals function `(input: unknown) =>\n * IValidation<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createValidateEquals(): never;\n\n/**\n * Creates reusable {@link validateEquals} function.\n *\n * Returns a strict validation function that rejects superfluous properties.\n * Also implements {@link StandardSchemaV1} interface for interoperability.\n *\n * @template T Target type for exact match\n * @returns Reusable validateEquals function `(input: unknown) =>\n * IValidation<T>`\n */\nexport function createValidateEquals<T>(): ((\n input: unknown,\n) => IValidation<T>) &\n StandardSchemaV1<T, T>;\n\n/** @internal */\nexport function createValidateEquals(): ((input: unknown) => IValidation) &\n StandardSchemaV1<unknown, unknown> {\n NoTransformConfigurationError(\"createValidateEquals\");\n}\n\n/**\n * Creates reusable {@link random} function.\n *\n * Returns a random data generator that can be called multiple times without\n * recompilation.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Reusable random function `() => Resolved<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createRandom(generator?: Partial<IRandomGenerator>): never;\n\n/**\n * Creates reusable {@link random} function.\n *\n * Returns a random data generator that can be called multiple times without\n * recompilation.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Reusable random function `() => Resolved<T>`\n */\nexport function createRandom<T>(\n generator?: Partial<IRandomGenerator>,\n): () => Resolved<T>;\n\n/** @internal */\nexport function createRandom(): never {\n NoTransformConfigurationError(\"createRandom\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AA6DA,SAAgB,cAAqB;CACnC,8BAA8B,aAAa;AAC7C;;AA2CA,SAAgB,KAAY;CAC1B,8BAA8B,IAAI;AACpC;;AAiEA,SAAgB,UAAiB;CAC/B,8BAA8B,SAAS;AACzC;;AAqDA,SAAgB,WAAkB;CAChC,8BAA8B,UAAU;AAC1C;;AA0DA,SAAgB,eAAsB;CACpC,8BAA8B,cAAc;AAC9C;;AAqDA,SAAgB,oBAA2B;CACzC,8BAA8B,mBAAmB;AACnD;;AAyCA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AAmDA,SAAgB,iBAAwB;CACtC,8BAA8B,gBAAgB;AAChD;;AAiCA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AAyCA,SAAgB,eAGT;CACL,8BAA8B,cAAc;AAC9C;;AAgDA,SAAgB,oBAGQ;CACtB,8BAA8B,mBAAmB;AACnD;;AA0BA,SAAgB,WAA8C;CAC5D,8BAA8B,UAAU;AAC1C;;AAgCA,SAAgB,gBAAmD;CACjE,8BAA8B,eAAe;AAC/C;;AA6BA,SAAgB,iBACqB;CACnC,8BAA8B,gBAAgB;AAChD;;AAuCA,SAAgB,qBAGT;CACL,8BAA8B,oBAAoB;AACpD;;AAgDA,SAAgB,0BAGQ;CACtB,8BAA8B,yBAAyB;AACzD;;AA0BA,SAAgB,eAAkD;CAChE,8BAA8B,cAAc;AAC9C;;AA+BA,SAAgB,uBACqB;CACnC,8BAA8B,sBAAsB;AACtD;;AA8BA,SAAgB,eAAsB;CACpC,8BAA8B,cAAc;AAC9C"}
1
+ {"version":3,"file":"module.mjs","names":[],"sources":["../src/module.ts"],"sourcesContent":["import {\n IRandomGenerator,\n IValidation,\n Resolved,\n StandardSchemaV1,\n} from \"@typia/interface\";\n\nimport { TypeGuardError } from \"./TypeGuardError\";\nimport { NoTransformConfigurationError } from \"./transformers/NoTransformConfigurationError\";\n\nexport * as compare from \"./compare\";\nexport * as functional from \"./functional\";\nexport * as http from \"./http\";\nexport * as llm from \"./llm\";\nexport * as json from \"./json\";\nexport * as plain from \"./plain\";\nexport * as notations from \"./notations\";\nexport * as protobuf from \"./protobuf\";\nexport * as reflect from \"./reflect\";\n\nexport * from \"./TypeGuardError\";\n\nexport * from \"./re-exports\";\n\n/* -----------------------------------------------------------\n BASIC VALIDATORS\n----------------------------------------------------------- */\n/**\n * Asserts type `T`.\n *\n * Performs runtime type checking against compile-time type `T`. Stops at first\n * mismatch and throws {@link TypeGuardError} containing:\n *\n * - `path`: Property path where error occurred (e.g., `\"input.user.age\"`)\n * - `expected`: Expected type string (e.g., `\"number & ExclusiveMinimum<19>\"`)\n * - `value`: Actual value that failed validation\n *\n * Related functions:\n *\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of stopping at first\n * - {@link assertGuard} — Type guard with no return value (narrows type only)\n * - {@link assertEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assert<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/**\n * Asserts type `T`.\n *\n * Performs runtime type checking against compile-time type `T`. Stops at first\n * mismatch and throws {@link TypeGuardError} containing:\n *\n * - `path`: Property path where error occurred (e.g., `\"input.user.age\"`)\n * - `expected`: Expected type string (e.g., `\"number & ExclusiveMinimum<19>\"`)\n * - `value`: Actual value that failed validation\n *\n * Related functions:\n *\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of stopping at first\n * - {@link assertGuard} — Type guard with no return value (narrows type only)\n * - {@link assertEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assert<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/** @internal */\nexport function assert(): never {\n NoTransformConfigurationError(\"assert\");\n}\n\n/**\n * Asserts type `T` as assertion guard.\n *\n * Unlike {@link assert}, returns nothing (`asserts input is T`). After this\n * call, TypeScript narrows `input` to type `T` in subsequent code. Useful when\n * you need type narrowing with runtime validation but don't need the return\n * value.\n *\n * Throws {@link TypeGuardError} on first mismatch with `path`, `expected`, and\n * `value`.\n *\n * Related functions:\n *\n * - {@link assert} — Same validation but returns the input value\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of throwing\n * - {@link assertGuardEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assertGuard<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/**\n * Asserts type `T` as assertion guard.\n *\n * Unlike {@link assert}, returns nothing (`asserts input is T`). After this\n * call, TypeScript narrows `input` to type `T` in subsequent code. Useful when\n * you need type narrowing with runtime validation but don't need the return\n * value.\n *\n * Throws {@link TypeGuardError} on first mismatch with `path`, `expected`, and\n * `value`.\n *\n * Related functions:\n *\n * - {@link assert} — Same validation but returns the input value\n * - {@link is} — Returns `boolean` instead of throwing\n * - {@link validate} — Collects all errors instead of throwing\n * - {@link assertGuardEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When input doesn't conform to type `T`\n */\nexport function assertGuard<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/** @internal */\nexport function assertGuard(): never {\n NoTransformConfigurationError(\"assertGuard\");\n}\n\n/**\n * Tests type `T`.\n *\n * Performs runtime type checking without throwing exceptions. Acts as\n * TypeScript type guard, narrowing the input type in conditional branches when\n * result is `true`.\n *\n * Related functions:\n *\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n * - {@link equals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to check\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function is<T>(input: T): input is T;\n\n/**\n * Tests type `T`.\n *\n * Performs runtime type checking without throwing exceptions. Acts as\n * TypeScript type guard, narrowing the input type in conditional branches when\n * result is `true`.\n *\n * Related functions:\n *\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n * - {@link equals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to check\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function is<T>(input: unknown): input is T;\n\n/** @internal */\nexport function is(): never {\n NoTransformConfigurationError(\"is\");\n}\n\n/**\n * Tests type `T` up to a limited depth.\n *\n * Like {@link is}, but only descends into nested objects, arrays, and tuples\n * until the depth budget `N` is exhausted; beyond that point a value is\n * accepted as long as it is an `object` (or `null` where the type permits).\n * Useful for **discrimination** rather than full validation — when you only\n * need to know which branch of a union an input belongs to, paying for a deep\n * structural check of every leaf is wasteful.\n *\n * Because the check is shallow past depth `N`, a `true` result is **not** a\n * guarantee that the whole value conforms to `T`. The name `shallow` reflects\n * this: only the discriminating, near-surface part of the type is verified. For\n * a full guarantee, use {@link is}.\n *\n * Related functions:\n *\n * - {@link is} — Full-depth check, returns a sound type guard\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @param input Value to test\n * @returns `true` if valid up to depth `N`, `false` otherwise (type predicate\n * `input is T`)\n */\nexport function shallow<T, N extends number = 2>(input: T): input is T;\n\n/**\n * Tests type `T` up to a limited depth.\n *\n * Like {@link is}, but only descends into nested objects, arrays, and tuples\n * until the depth budget `N` is exhausted; beyond that point a value is\n * accepted as long as it is an `object` (or `null` where the type permits).\n * Useful for **discrimination** rather than full validation — when you only\n * need to know which branch of a union an input belongs to, paying for a deep\n * structural check of every leaf is wasteful.\n *\n * Because the check is shallow past depth `N`, a `true` result is **not** a\n * guarantee that the whole value conforms to `T`. The name `shallow` reflects\n * this: only the discriminating, near-surface part of the type is verified. For\n * a full guarantee, use {@link is}.\n *\n * Related functions:\n *\n * - {@link is} — Full-depth check, returns a sound type guard\n * - {@link assert} — Throws {@link TypeGuardError} with detailed error info on\n * mismatch\n * - {@link validate} — Returns all errors without throwing\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @param input Value to test\n * @returns `true` if valid up to depth `N`, `false` otherwise (type predicate\n * `input is T`)\n */\nexport function shallow<T, N extends number = 2>(input: unknown): input is T;\n\n/** @internal */\nexport function shallow(): never {\n NoTransformConfigurationError(\"shallow\");\n}\n\n/**\n * Validates type `T`.\n *\n * Unlike {@link assert} which throws on first error, this function continues\n * checking and collects all type mismatches into {@link IValidation.errors}\n * array. Never throws.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array of {@link IValidation.IError} with `path`,\n * `expected`, `value`\n *\n * Related functions:\n *\n * - {@link assert} — Throws on first error instead of collecting all\n * - {@link is} — Simple boolean check\n * - {@link validateEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validate<T>(input: T): IValidation<T>;\n\n/**\n * Validates type `T`.\n *\n * Unlike {@link assert} which throws on first error, this function continues\n * checking and collects all type mismatches into {@link IValidation.errors}\n * array. Never throws.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array of {@link IValidation.IError} with `path`,\n * `expected`, `value`\n *\n * Related functions:\n *\n * - {@link assert} — Throws on first error instead of collecting all\n * - {@link is} — Simple boolean check\n * - {@link validateEquals} — Also rejects properties not defined in `T`\n *\n * @template T Target type to validate against\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validate<T>(input: unknown): IValidation<T>;\n\n/** @internal */\nexport function validate(): never {\n NoTransformConfigurationError(\"validate\");\n}\n\n/* -----------------------------------------------------------\n STRICT VALIDATORS\n----------------------------------------------------------- */\n/**\n * Asserts type `T` with strict equality.\n *\n * Stricter than {@link assert}: also fails when input contains any property not\n * defined in type `T`. For extra property errors, `expected` will be\n * `\"undefined\"`.\n *\n * Related functions:\n *\n * - {@link assert} — Allows extra properties\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n * - {@link assertGuardEquals} — Type guard version with no return value\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertEquals<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/**\n * Asserts type `T` with strict equality.\n *\n * Stricter than {@link assert}: also fails when input contains any property not\n * defined in type `T`. For extra property errors, `expected` will be\n * `\"undefined\"`.\n *\n * Related functions:\n *\n * - {@link assert} — Allows extra properties\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n * - {@link assertGuardEquals} — Type guard version with no return value\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns The input value typed as `T`\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertEquals<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): T;\n\n/** @internal */\nexport function assertEquals(): never {\n NoTransformConfigurationError(\"assertEquals\");\n}\n\n/**\n * Asserts type `T` with strict equality as assertion guard.\n *\n * Combines {@link assertGuard} with strict equality checking. Returns nothing\n * but narrows input to type `T`. Also fails when input contains properties not\n * in `T`.\n *\n * Related functions:\n *\n * - {@link assertGuard} — Allows extra properties\n * - {@link assertEquals} — Returns value instead of type guard\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertGuardEquals<T>(\n input: T,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/**\n * Asserts type `T` with strict equality as assertion guard.\n *\n * Combines {@link assertGuard} with strict equality checking. Returns nothing\n * but narrows input to type `T`. Also fails when input contains properties not\n * in `T`.\n *\n * Related functions:\n *\n * - {@link assertGuard} — Allows extra properties\n * - {@link assertEquals} — Returns value instead of type guard\n * - {@link equals} — Boolean result without throwing\n * - {@link validateEquals} — Collects all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to assert (narrowed to `T` after call)\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @throws {TypeGuardError} When type mismatch or extra property detected\n */\nexport function assertGuardEquals<T>(\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): asserts input is T;\n\n/** @internal */\nexport function assertGuardEquals(): never {\n NoTransformConfigurationError(\"assertGuardEquals\");\n}\n\n/**\n * Tests type `T` with strict equality.\n *\n * Stricter than {@link is}: also returns `false` when input contains any\n * property not defined in type `T`. Useful for detecting unexpected data or\n * typos.\n *\n * Related functions:\n *\n * - {@link is} — Allows extra properties\n * - {@link assertEquals} — Throws with detailed error info on mismatch\n * - {@link validateEquals} — Returns all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function equals<T>(input: T): input is T;\n\n/**\n * Tests type `T` with strict equality.\n *\n * Stricter than {@link is}: also returns `false` when input contains any\n * property not defined in type `T`. Useful for detecting unexpected data or\n * typos.\n *\n * Related functions:\n *\n * - {@link is} — Allows extra properties\n * - {@link assertEquals} — Throws with detailed error info on mismatch\n * - {@link validateEquals} — Returns all errors without throwing\n *\n * @template T Target type for exact match\n * @param input Value to test\n * @returns `true` if valid, `false` otherwise (type predicate `input is T`)\n */\nexport function equals<T>(input: unknown): input is T;\n\n/** @internal */\nexport function equals(): never {\n NoTransformConfigurationError(\"equals\");\n}\n\n/**\n * Validates type `T` with strict equality.\n *\n * Combines {@link validate} with strict equality checking. Collects all errors\n * including extra property violations into {@link IValidation.errors} array.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array with `path`, `expected`, `value` for each\n * mismatch\n *\n * Related functions:\n *\n * - {@link validate} — Allows extra properties\n * - {@link assertEquals} — Throws on first error\n * - {@link equals} — Simple boolean check\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validateEquals<T>(input: T): IValidation<T>;\n\n/**\n * Validates type `T` with strict equality.\n *\n * Combines {@link validate} with strict equality checking. Collects all errors\n * including extra property violations into {@link IValidation.errors} array.\n *\n * Return structure:\n *\n * - `success: true` → `data` contains validated input as `T`\n * - `success: false` → `errors` array with `path`, `expected`, `value` for each\n * mismatch\n *\n * Related functions:\n *\n * - {@link validate} — Allows extra properties\n * - {@link assertEquals} — Throws on first error\n * - {@link equals} — Simple boolean check\n *\n * @template T Target type for exact match\n * @param input Value to validate\n * @returns {@link IValidation} <T> containing either `data` or `errors`\n */\nexport function validateEquals<T>(input: unknown): IValidation<T>;\n\n/** @internal */\nexport function validateEquals(): never {\n NoTransformConfigurationError(\"validateEquals\");\n}\n\n/* -----------------------------------------------------------\n RANDOM\n----------------------------------------------------------- */\n/**\n * Generates random data of type `T`.\n *\n * Creates random instance conforming to compile-time type `T`. Generates only\n * primitive data; methods in `T` are ignored. If `T` has `toJSON()` method,\n * generates its return type instead.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Randomly generated data as `Resolved<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function random(generator?: Partial<IRandomGenerator>): never;\n\n/**\n * Generates random data of type `T`.\n *\n * Creates random instance conforming to compile-time type `T`. Generates only\n * primitive data; methods in `T` are ignored. If `T` has `toJSON()` method,\n * generates its return type instead.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Randomly generated data as `Resolved<T>`\n */\nexport function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;\n\n/** @internal */\nexport function random(): never {\n NoTransformConfigurationError(\"random\");\n}\n\n/* -----------------------------------------------------------\n FACTORY FUNCTIONS\n----------------------------------------------------------- */\n/**\n * Creates reusable {@link assert} function.\n *\n * Returns a function that can be called multiple times without recompilation.\n * Useful when the same type validation is needed repeatedly.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assert function `(input: unknown, errorFactory?) => T`\n * @danger You must configure the generic argument `T`\n */\nexport function createAssert(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assert} function.\n *\n * Returns a function that can be called multiple times without recompilation.\n * Useful when the same type validation is needed repeatedly.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assert function `(input: unknown, errorFactory?) => T`,\n * whose own `errorFactory` overrides this one for that single call\n */\nexport function createAssert<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T;\n\n/** @internal */\nexport function createAssert<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T {\n NoTransformConfigurationError(\"createAssert\");\n}\n\n/**\n * Creates reusable {@link assertGuard} function.\n *\n * Returns a reusable type guard assertion function.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuard<T>()` — otherwise compile error.\n * That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertGuard(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertGuard} function.\n *\n * Returns a reusable type guard assertion function.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuard<T>()` — otherwise compile error.\n * That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type to validate against\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function, whose own `errorFactory`\n * overrides this one for that single call\n */\nexport function createAssertGuard<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T;\n\n/** @internal */\nexport function createAssertGuard<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T {\n NoTransformConfigurationError(\"createAssertGuard\");\n}\n\n/**\n * Creates reusable {@link is} function.\n *\n * Returns a type guard function that can be called multiple times without\n * recompilation.\n *\n * @template T Target type to check\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createIs(): never;\n\n/**\n * Creates reusable {@link is} function.\n *\n * Returns a type guard function that can be called multiple times without\n * recompilation.\n *\n * @template T Target type to check\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createIs<T>(): (input: unknown) => input is T;\n\n/** @internal */\nexport function createIs<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createIs\");\n}\n\n/**\n * Creates reusable {@link shallow} function.\n *\n * Returns a depth-limited type guard function that can be called multiple times\n * without recompilation.\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createShallow(): never;\n\n/**\n * Creates reusable {@link shallow} function.\n *\n * Returns a depth-limited type guard function that can be called multiple times\n * without recompilation.\n *\n * @template T Target type to check\n * @template N Maximum depth to descend before accepting a value structurally.\n * Must be a non-negative integer literal. Defaults to `2`.\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createShallow<T, N extends number = 2>(): (\n input: unknown,\n) => input is T;\n\n/** @internal */\nexport function createShallow<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createShallow\");\n}\n\n/**\n * Creates reusable {@link validate} function.\n *\n * Returns a validation function that can be called multiple times without\n * recompilation. Also implements {@link StandardSchemaV1} interface for\n * interoperability.\n *\n * @template T Target type to validate against\n * @returns Reusable validate function `(input: unknown) => IValidation<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createValidate(): never;\n\n/**\n * Creates reusable {@link validate} function.\n *\n * Returns a validation function that can be called multiple times without\n * recompilation. Also implements {@link StandardSchemaV1} interface for\n * interoperability.\n *\n * @template T Target type to validate against\n * @returns Reusable validate function `(input: unknown) => IValidation<T>`\n */\nexport function createValidate<T>(): ((input: unknown) => IValidation<T>) &\n StandardSchemaV1<T, T>;\n\n/** @internal */\nexport function createValidate(): ((input: unknown) => IValidation) &\n StandardSchemaV1<unknown, unknown> {\n NoTransformConfigurationError(\"createValidate\");\n}\n\n/**\n * Creates reusable {@link assertEquals} function.\n *\n * Returns a strict assertion function that rejects superfluous properties. Can\n * be called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertEquals function `(input: unknown, errorFactory?) =>\n * T`\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertEquals(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertEquals} function.\n *\n * Returns a strict assertion function that rejects superfluous properties. Can\n * be called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertEquals function `(input: unknown, errorFactory?) =>\n * T`, whose own `errorFactory` overrides this one for that single call\n */\nexport function createAssertEquals<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T;\n\n/** @internal */\nexport function createAssertEquals<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => T {\n NoTransformConfigurationError(\"createAssertEquals\");\n}\n\n/**\n * Creates reusable {@link assertGuardEquals} function.\n *\n * Returns a strict assertion guard that rejects superfluous properties.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuardEquals<T>()` — otherwise compile\n * error. That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function\n * @danger You must configure the generic argument `T`\n */\nexport function createAssertGuardEquals(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): never;\n\n/**\n * Creates reusable {@link assertGuardEquals} function.\n *\n * Returns a strict assertion guard that rejects superfluous properties.\n *\n * TypeScript requirement: You must declare the variable type explicitly. `const\n * fn: AssertionGuard<T> = createAssertGuardEquals<T>()` — otherwise compile\n * error. That annotation is one parameter wide, so it also hides the call-time\n * `errorFactory`; annotate with `(input: unknown, errorFactory?: (props:\n * TypeGuardError.IProps) => Error) => asserts input is T` when you need it.\n *\n * @template T Target type for exact match\n * @param errorFactory Custom error factory receiving\n * {@link TypeGuardError.IProps}\n * @returns Reusable assertion guard function, whose own `errorFactory`\n * overrides this one for that single call\n */\nexport function createAssertGuardEquals<T>(\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T;\n\n/** @internal */\nexport function createAssertGuardEquals<T>(): (\n input: unknown,\n errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),\n) => asserts input is T {\n NoTransformConfigurationError(\"createAssertGuardEquals\");\n}\n\n/**\n * Creates reusable {@link equals} function.\n *\n * Returns a strict type guard that rejects superfluous properties. Can be\n * called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @returns Reusable type guard function `(input: unknown) => input is T`\n * @danger You must configure the generic argument `T`\n */\nexport function createEquals(): never;\n\n/**\n * Creates reusable {@link equals} function.\n *\n * Returns a strict type guard that rejects superfluous properties. Can be\n * called multiple times without recompilation.\n *\n * @template T Target type for exact match\n * @returns Reusable type guard function `(input: unknown) => input is T`\n */\nexport function createEquals<T>(): (input: unknown) => input is T;\n\n/** @internal */\nexport function createEquals<T>(): (input: unknown) => input is T {\n NoTransformConfigurationError(\"createEquals\");\n}\n\n/**\n * Creates reusable {@link validateEquals} function.\n *\n * Returns a strict validation function that rejects superfluous properties.\n * Also implements {@link StandardSchemaV1} interface for interoperability.\n *\n * @template T Target type for exact match\n * @returns Reusable validateEquals function `(input: unknown) =>\n * IValidation<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createValidateEquals(): never;\n\n/**\n * Creates reusable {@link validateEquals} function.\n *\n * Returns a strict validation function that rejects superfluous properties.\n * Also implements {@link StandardSchemaV1} interface for interoperability.\n *\n * @template T Target type for exact match\n * @returns Reusable validateEquals function `(input: unknown) =>\n * IValidation<T>`\n */\nexport function createValidateEquals<T>(): ((\n input: unknown,\n) => IValidation<T>) &\n StandardSchemaV1<T, T>;\n\n/** @internal */\nexport function createValidateEquals(): ((input: unknown) => IValidation) &\n StandardSchemaV1<unknown, unknown> {\n NoTransformConfigurationError(\"createValidateEquals\");\n}\n\n/**\n * Creates reusable {@link random} function.\n *\n * Returns a random data generator that can be called multiple times without\n * recompilation.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Reusable random function `() => Resolved<T>`\n * @danger You must configure the generic argument `T`\n */\nexport function createRandom(generator?: Partial<IRandomGenerator>): never;\n\n/**\n * Creates reusable {@link random} function.\n *\n * Returns a random data generator that can be called multiple times without\n * recompilation.\n *\n * @template T Type of data to generate\n * @param generator Custom random generator implementing {@link IRandomGenerator}\n * @returns Reusable random function `() => Resolved<T>`\n */\nexport function createRandom<T>(\n generator?: Partial<IRandomGenerator>,\n): () => Resolved<T>;\n\n/** @internal */\nexport function createRandom(): never {\n NoTransformConfigurationError(\"createRandom\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AA6DA,SAAgB,cAAqB;CACnC,8BAA8B,aAAa;AAC7C;;AA2CA,SAAgB,KAAY;CAC1B,8BAA8B,IAAI;AACpC;;AAiEA,SAAgB,UAAiB;CAC/B,8BAA8B,SAAS;AACzC;;AAqDA,SAAgB,WAAkB;CAChC,8BAA8B,UAAU;AAC1C;;AA0DA,SAAgB,eAAsB;CACpC,8BAA8B,cAAc;AAC9C;;AAqDA,SAAgB,oBAA2B;CACzC,8BAA8B,mBAAmB;AACnD;;AAyCA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AAmDA,SAAgB,iBAAwB;CACtC,8BAA8B,gBAAgB;AAChD;;AAiCA,SAAgB,SAAgB;CAC9B,8BAA8B,QAAQ;AACxC;;AAyCA,SAAgB,eAGT;CACL,8BAA8B,cAAc;AAC9C;;AAgDA,SAAgB,oBAGQ;CACtB,8BAA8B,mBAAmB;AACnD;;AA0BA,SAAgB,WAA8C;CAC5D,8BAA8B,UAAU;AAC1C;;AAgCA,SAAgB,gBAAmD;CACjE,8BAA8B,eAAe;AAC/C;;AA6BA,SAAgB,iBACqB;CACnC,8BAA8B,gBAAgB;AAChD;;AAuCA,SAAgB,qBAGT;CACL,8BAA8B,oBAAoB;AACpD;;AAgDA,SAAgB,0BAGQ;CACtB,8BAA8B,yBAAyB;AACzD;;AA0BA,SAAgB,eAAkD;CAChE,8BAA8B,cAAc;AAC9C;;AA+BA,SAAgB,uBACqB;CACnC,8BAA8B,sBAAsB;AACtD;;AA8BA,SAAgB,eAAsB;CACpC,8BAA8B,cAAc;AAC9C"}
@@ -1,2 +1,2 @@
1
- export type { AssertionGuard, IJsonParseResult, IValidation, IRandomGenerator, OpenApi, IJsonSchemaCollection, IJsonSchemaUnit, ILlmController, ILlmApplication, ILlmFunction, ILlmStructuredOutput, ILlmSchema, IMetadataSchema, IMetadataSchemaCollection, IMetadataSchemaUnit, IMetadataComponents, IMetadataTypeTag, IJsDocTagInfo, Classifiable, ClassifyResult, Primitive, Resolved, CamelCase, KebabCase, PascalCase, SnakeCase, IReadableURLSearchParams, } from "@typia/interface";
1
+ export type { AssertionGuard, IJsonParseResult, IValidation, IRandomGenerator, StandardSchemaV1, OpenApi, IJsonSchemaApplication, IJsonSchemaCollection, IJsonSchemaUnit, ILlmController, ILlmApplication, ILlmFunction, ILlmStructuredOutput, ILlmSchema, IMetadataSchema, IMetadataSchemaCollection, IMetadataSchemaUnit, IMetadataComponents, IMetadataTypeTag, IJsDocTagInfo, Atomic, Classifiable, ClassifyResult, Primitive, Resolved, CamelCase, KebabCase, PascalCase, SnakeCase, IReadableURLSearchParams, } from "@typia/interface";
2
2
  export { tags } from "@typia/interface";
@@ -1 +1 @@
1
- {"version":3,"file":"re-exports.js","sourceRoot":"","sources":["../src/re-exports.ts"],"names":[],"mappings":";;;AAoCA,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,mEAAmE;AACnE,sBAAsB;AACtB,8CAAwC;AAA/B,iGAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"re-exports.js","sourceRoot":"","sources":["../src/re-exports.ts"],"names":[],"mappings":";;;AAiDA,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,mEAAmE;AACnE,sBAAsB;AACtB,8CAAwC;AAA/B,iGAAA,IAAI,OAAA"}
@@ -6,13 +6,28 @@ function NoTransformConfigurationError(name) {
6
6
  throw new Error([
7
7
  `Error on typia.${name}(): no transform has been configured.`,
8
8
  "",
9
- "Read and follow https://typia.io/docs/setup please.",
9
+ [
10
+ "Build the project with `ttsc` (not stock `tsc`), run TypeScript",
11
+ "with `ttsx`, or configure `@ttsc/unplugin` for a bundler.",
12
+ "These toolchains discover typia's native transform automatically.",
13
+ ].join(" "),
14
+ "",
15
+ [
16
+ "If `ttsc` is missing, install it with",
17
+ "`npm i -D ttsc typescript`.",
18
+ ].join(" "),
10
19
  "",
11
20
  [
12
- "If you've already completed the setup, it means there's",
13
- "a bug in your code. Run `tsc` command so that check what",
14
- "is wrong with your code.",
21
+ "If setup is already complete, run `npx ttsc --noEmit` to",
22
+ "surface the underlying TypeScript or typia transform error.",
15
23
  ].join(" "),
24
+ "",
25
+ [
26
+ "Stock `tsc`, `ts-node`, `tsx`, Babel, and SWC do not load",
27
+ "typia's transform on their own.",
28
+ ].join(" "),
29
+ "",
30
+ "See https://typia.io/docs/setup for setup and bundler instructions.",
16
31
  ].join("\n"));
17
32
  }
18
33
  //# sourceMappingURL=NoTransformConfigurationError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NoTransformConfigurationError.js","sourceRoot":"","sources":["../../src/transformers/NoTransformConfigurationError.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,uCAA8C,IAAY;IACxD,MAAM,IAAI,KAAK,CACb;QACE,kBAAkB,IAAI,uCAAuC;QAC7D,EAAE;QACF,qDAAqD;QACrD,EAAE;QACF;YACE,yDAAyD;YACzD,0DAA0D;YAC1D,0BAA0B;SAC3B,CAAC,IAAI,CAAC,GAAG,CAAC;KACZ,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"NoTransformConfigurationError.js","sourceRoot":"","sources":["../../src/transformers/NoTransformConfigurationError.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,uCAA8C,IAAY;IACxD,MAAM,IAAI,KAAK,CACb;QACE,kBAAkB,IAAI,uCAAuC;QAC7D,EAAE;QACF;YACE,iEAAiE;YACjE,2DAA2D;YAC3D,mEAAmE;SACpE,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,EAAE;QACF;YACE,uCAAuC;YACvC,6BAA6B;SAC9B,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,EAAE;QACF;YACE,0DAA0D;YAC1D,6DAA6D;SAC9D,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,EAAE;QACF;YACE,2DAA2D;YAC3D,iCAAiC;SAClC,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,EAAE;QACF,qEAAqE;KACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
@@ -4,13 +4,19 @@ function NoTransformConfigurationError(name) {
4
4
  throw new Error([
5
5
  `Error on typia.${name}(): no transform has been configured.`,
6
6
  "",
7
- "Read and follow https://typia.io/docs/setup please.",
8
- "",
9
7
  [
10
- "If you've already completed the setup, it means there's",
11
- "a bug in your code. Run `tsc` command so that check what",
12
- "is wrong with your code."
13
- ].join(" ")
8
+ "Build the project with `ttsc` (not stock `tsc`), run TypeScript",
9
+ "with `ttsx`, or configure `@ttsc/unplugin` for a bundler.",
10
+ "These toolchains discover typia's native transform automatically."
11
+ ].join(" "),
12
+ "",
13
+ ["If `ttsc` is missing, install it with", "`npm i -D ttsc typescript`."].join(" "),
14
+ "",
15
+ ["If setup is already complete, run `npx ttsc --noEmit` to", "surface the underlying TypeScript or typia transform error."].join(" "),
16
+ "",
17
+ ["Stock `tsc`, `ts-node`, `tsx`, Babel, and SWC do not load", "typia's transform on their own."].join(" "),
18
+ "",
19
+ "See https://typia.io/docs/setup for setup and bundler instructions."
14
20
  ].join("\n"));
15
21
  }
16
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"NoTransformConfigurationError.mjs","names":[],"sources":["../../src/transformers/NoTransformConfigurationError.ts"],"sourcesContent":["/** @internal */\nexport function NoTransformConfigurationError(name: string): never {\n throw new Error(\n [\n `Error on typia.${name}(): no transform has been configured.`,\n \"\",\n \"Read and follow https://typia.io/docs/setup please.\",\n \"\",\n [\n \"If you've already completed the setup, it means there's\",\n \"a bug in your code. Run `tsc` command so that check what\",\n \"is wrong with your code.\",\n ].join(\" \"),\n ].join(\"\\n\"),\n );\n}\n"],"mappings":";;AACA,SAAgB,8BAA8B,MAAqB;CACjE,MAAM,IAAI,MACR;EACE,kBAAkB,KAAK;EACvB;EACA;EACA;EACA;GACE;GACA;GACA;EACF,CAAC,CAAC,KAAK,GAAG;CACZ,CAAC,CAAC,KAAK,IAAI,CACb;AACF"}
1
+ {"version":3,"file":"NoTransformConfigurationError.mjs","names":[],"sources":["../../src/transformers/NoTransformConfigurationError.ts"],"sourcesContent":["/** @internal */\nexport function NoTransformConfigurationError(name: string): never {\n throw new Error(\n [\n `Error on typia.${name}(): no transform has been configured.`,\n \"\",\n [\n \"Build the project with `ttsc` (not stock `tsc`), run TypeScript\",\n \"with `ttsx`, or configure `@ttsc/unplugin` for a bundler.\",\n \"These toolchains discover typia's native transform automatically.\",\n ].join(\" \"),\n \"\",\n [\n \"If `ttsc` is missing, install it with\",\n \"`npm i -D ttsc typescript`.\",\n ].join(\" \"),\n \"\",\n [\n \"If setup is already complete, run `npx ttsc --noEmit` to\",\n \"surface the underlying TypeScript or typia transform error.\",\n ].join(\" \"),\n \"\",\n [\n \"Stock `tsc`, `ts-node`, `tsx`, Babel, and SWC do not load\",\n \"typia's transform on their own.\",\n ].join(\" \"),\n \"\",\n \"See https://typia.io/docs/setup for setup and bundler instructions.\",\n ].join(\"\\n\"),\n );\n}\n"],"mappings":";;AACA,SAAgB,8BAA8B,MAAqB;CACjE,MAAM,IAAI,MACR;EACE,kBAAkB,KAAK;EACvB;EACA;GACE;GACA;GACA;EACF,CAAC,CAAC,KAAK,GAAG;EACV;EACA,CACE,yCACA,6BACF,CAAC,CAAC,KAAK,GAAG;EACV;EACA,CACE,4DACA,6DACF,CAAC,CAAC,KAAK,GAAG;EACV;EACA,CACE,6DACA,iCACF,CAAC,CAAC,KAAK,GAAG;EACV;EACA;CACF,CAAC,CAAC,KAAK,IAAI,CACb;AACF"}
@@ -120,8 +120,11 @@ const createAssertErrorFactorySentinel = "zzz"
120
120
  // never executed: the http, protobuf and notation members pull runtime helpers
121
121
  // this package stubs only for the emit it runs, so the executed fixture stays
122
122
  // on the module family.
123
- const createAssertErrorFactorySurfaceSource = `import { StandardSchemaV1 } from "@standard-schema/spec";
124
- import typia, { AssertionGuard, TypeGuardError } from "typia";
123
+ const createAssertErrorFactorySurfaceSource = `import typia, {
124
+ AssertionGuard,
125
+ StandardSchemaV1,
126
+ TypeGuardError,
127
+ } from "typia";
125
128
 
126
129
  interface User {
127
130
  id: number;
@@ -0,0 +1,52 @@
1
+ package main
2
+
3
+ import "testing"
4
+
5
+ // TestDependencyCollectorVirtualScheme verifies which dropped file still costs
6
+ // the current key its completeness declaration.
7
+ //
8
+ // The envelope reports no virtual URI source, because nothing can watch one. Two
9
+ // of them are not the same, though: `driver.NewTransformGraph` skips exactly
10
+ // `bundled:///`, so a bundled library is absent from the host-owned bound too
11
+ // and dropping it changes nothing, while a file under any other scheme is still
12
+ // a member of that bound. Narrowing to a list that cannot name it would stop
13
+ // watching an input the default bound watches, so the file that consulted it
14
+ // stays undeclared (samchon/typia#2357).
15
+ //
16
+ // The case is a collector probe rather than a fixture because no tsconfig this
17
+ // repository can write makes the compiler serve a non-bundled virtual source;
18
+ // the branch is reachable only from the listener side.
19
+ //
20
+ // 1. Report a `bundled:///` library against one key and a foreign-scheme source
21
+ // against another.
22
+ // 2. Render both sections.
23
+ // 3. Assert neither file reached `dependencies`.
24
+ // 4. Assert only the foreign-scheme key lost its completeness declaration.
25
+ func TestDependencyCollectorVirtualScheme(t *testing.T) {
26
+ collector := newTransformDependencyCollector("D:/project", func(string) bool { return false })
27
+
28
+ collector.Begin("src/bundled.ts")
29
+ collector.Touch("bundled:///lib.es5.d.ts")
30
+ collector.End()
31
+
32
+ collector.Begin("src/foreign.ts")
33
+ collector.Touch("vfs://memory/generated.d.ts")
34
+ collector.End()
35
+
36
+ if reported := collector.ToJSON(); reported != nil {
37
+ t.Fatalf("a virtual URI source is unwatchable and must never reach dependencies: %v", reported)
38
+ }
39
+ declared := map[string]bool{}
40
+ for _, key := range collector.ToCompleteJSON(map[string]string{
41
+ "src/bundled.ts": "",
42
+ "src/foreign.ts": "",
43
+ }) {
44
+ declared[key] = true
45
+ }
46
+ if !declared["src/bundled.ts"] {
47
+ t.Fatalf("the host graph drops bundled libraries too, so dropping one costs no declaration: %v", declared)
48
+ }
49
+ if declared["src/foreign.ts"] {
50
+ t.Fatalf("the host graph keeps a foreign scheme, so a file that consulted one must be withheld: %v", declared)
51
+ }
52
+ }
@@ -0,0 +1,80 @@
1
+ package main
2
+
3
+ import (
4
+ "os"
5
+ "path/filepath"
6
+ "strings"
7
+ "testing"
8
+ )
9
+
10
+ // TestJSONSchemaNonsensibleIntersectionDiagnostic verifies that ttsc reports
11
+ // the transform-time cause behind issue #2373.
12
+ //
13
+ // The runtime fallback cannot inspect a TypeScript type after transformation
14
+ // has been skipped. This regression therefore compiles the reporter's exact
15
+ // `Date & string` property through the real typia package and preserves the
16
+ // actionable native diagnostic at its actual compiler boundary.
17
+ //
18
+ // 1. Compile a `typia.json.schema` call for the nonsensible intersection.
19
+ // 2. Require the API diagnostic, property path, and intersection reason.
20
+ func TestJSONSchemaNonsensibleIntersectionDiagnostic(t *testing.T) {
21
+ project := jsonSchemaNonsensibleIntersectionDiagnosticProject(t)
22
+ stdout, stderr, code := ttscTypiaTestCapture(func() int {
23
+ return runTransform([]string{
24
+ "--cwd", project,
25
+ "--tsconfig", "tsconfig.json",
26
+ "--file", "src/main.ts",
27
+ "--output", "js",
28
+ })
29
+ })
30
+ if code != 3 {
31
+ t.Fatalf("expected transform diagnostic exit code 3, got %d\nstdout:\n%s\nstderr:\n%s", code, stdout, stderr)
32
+ }
33
+ for _, expected := range []string{
34
+ "error TS(typia.json.schema):",
35
+ "ProblematicType.test",
36
+ "nonsensible intersection",
37
+ } {
38
+ if !strings.Contains(stderr, expected) {
39
+ t.Fatalf("expected stderr to contain %q, got:\n%s", expected, stderr)
40
+ }
41
+ }
42
+ }
43
+
44
+ func jsonSchemaNonsensibleIntersectionDiagnosticProject(t *testing.T) string {
45
+ t.Helper()
46
+ root := ttscTypiaTestRepoRoot(t)
47
+ base := filepath.Join(root, "packages", "typia", "native", ".tmp-ttsc-typia-tests")
48
+ if err := os.MkdirAll(base, 0o755); err != nil {
49
+ t.Fatalf("create fixture base: %v", err)
50
+ }
51
+ project, err := os.MkdirTemp(base, "json-schema-nonsensible-intersection-")
52
+ if err != nil {
53
+ t.Fatalf("create fixture project: %v", err)
54
+ }
55
+ t.Cleanup(func() {
56
+ if err := os.RemoveAll(project); err != nil {
57
+ t.Errorf("remove fixture project: %v", err)
58
+ }
59
+ })
60
+ src := filepath.Join(project, "src")
61
+ if err := os.MkdirAll(src, 0o755); err != nil {
62
+ t.Fatalf("create fixture src: %v", err)
63
+ }
64
+ if err := os.WriteFile(filepath.Join(project, "tsconfig.json"), []byte(atomicIntersectionSchemaTSConfig), 0o644); err != nil {
65
+ t.Fatalf("write tsconfig: %v", err)
66
+ }
67
+ if err := os.WriteFile(filepath.Join(src, "main.ts"), []byte(jsonSchemaNonsensibleIntersectionDiagnosticSource), 0o644); err != nil {
68
+ t.Fatalf("write source: %v", err)
69
+ }
70
+ return project
71
+ }
72
+
73
+ const jsonSchemaNonsensibleIntersectionDiagnosticSource = `import typia from "typia";
74
+
75
+ type ProblematicType = {
76
+ test: Date & string;
77
+ };
78
+
79
+ export const schema = typia.json.schema<ProblematicType>();
80
+ `