From 3be8ef99f9dd866b086f1ab11d2cb2819ce8b88d Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sun, 11 Jun 2023 23:54:06 +0900 Subject: [PATCH] Fix #654 - support intersection type with `atomic & object` In TypeScript, intersection type combining atomic and object is possible. For an example, `numbe & { __value: string }` type is possible, even if it seems nonsensible. Therefore, enhanced `typia` to support such crazy type. However, much more crazy type combing atomic value and array like `number & string[]` would be prohibited. Also, combining only objects is possible, but combing both object and array would be blocked. --- package.json | 2 +- packages/typescript-json/package.json | 4 +- src/Primitive.ts | 8 +- .../internal/metadata/iterate_metadata.ts | 7 + .../metadata/iterate_metadata_intersection.ts | 86 +++++++++++ .../metadata/iterate_metadata_object.ts | 54 ++++--- src/metadata/Metadata.ts | 1 + ...test_application_ajv_AtomicIntersection.ts | 9 ++ ...st_application_ajv_ConstantIntersection.ts | 8 ++ ..._application_swagger_AtomicIntersection.ts | 8 ++ ...pplication_swagger_ConstantIntersection.ts | 11 ++ .../assert/test_assert_AtomicIntersection.ts | 10 ++ .../test_assert_ConstantIntersection.ts | 10 ++ .../test_assertClone_AtomicIntersection.ts | 10 ++ .../test_assertClone_ConstantIntersection.ts | 10 ++ .../test_assertEquals_AtomicIntersection.ts | 9 ++ .../test_assertEquals_ConstantIntersection.ts | 9 ++ .../test_assertParse_AtomicIntersection.ts | 10 ++ .../test_assertParse_ConstantIntersection.ts | 10 ++ .../test_assertPrune_AtomicIntersection.ts | 10 ++ .../test_assertPrune_ConstantIntersection.ts | 10 ++ ...test_assertStringify_AtomicIntersection.ts | 10 ++ ...st_assertStringify_ConstantIntersection.ts | 10 ++ .../clone/test_clone_AtomicIntersection.ts | 9 ++ .../clone/test_clone_ConstantIntersection.ts | 9 ++ .../test_createAssert_AtomicIntersection.ts | 10 ++ .../test_createAssert_ConstantIntersection.ts | 10 ++ ...st_createAssertClone_AtomicIntersection.ts | 10 ++ ..._createAssertClone_ConstantIntersection.ts | 10 ++ ...t_createAssertEquals_AtomicIntersection.ts | 9 ++ ...createAssertEquals_ConstantIntersection.ts | 9 ++ ...st_createAssertParse_AtomicIntersection.ts | 10 ++ ..._createAssertParse_ConstantIntersection.ts | 10 ++ ...st_createAssertPrune_AtomicIntersection.ts | 10 ++ ..._createAssertPrune_ConstantIntersection.ts | 10 ++ ...reateAssertStringify_AtomicIntersection.ts | 11 ++ ...ateAssertStringify_ConstantIntersection.ts | 11 ++ .../test_createClone_AtomicIntersection.ts | 9 ++ .../test_createClone_ConstantIntersection.ts | 9 ++ .../test_createEquals_AtomicIntersection.ts | 9 ++ .../test_createEquals_ConstantIntersection.ts | 9 ++ .../test_createIs_AtomicIntersection.ts | 10 ++ .../test_createIs_ConstantIntersection.ts | 10 ++ .../test_createIsClone_AtomicIntersection.ts | 10 ++ ...test_createIsClone_ConstantIntersection.ts | 10 ++ .../test_createIsParse_AtomicIntersection.ts | 10 ++ ...test_createIsParse_ConstantIntersection.ts | 10 ++ .../test_createIsPrune_AtomicIntersection.ts | 10 ++ ...test_createIsPrune_ConstantIntersection.ts | 10 ++ ...st_createIsStringify_AtomicIntersection.ts | 10 ++ ..._createIsStringify_ConstantIntersection.ts | 10 ++ .../test_createPrune_AtomicIntersection.ts | 9 ++ .../test_createPrune_ConstantIntersection.ts | 9 ++ .../test_createRandom_AtomicIntersection.ts | 9 ++ .../test_createRandom_ConstantIntersection.ts | 9 ++ ...test_createStringify_AtomicIntersection.ts | 9 ++ ...st_createStringify_ConstantIntersection.ts | 9 ++ .../test_createValidate_AtomicIntersection.ts | 10 ++ ...est_createValidate_ConstantIntersection.ts | 10 ++ ..._createValidateClone_AtomicIntersection.ts | 10 ++ ...reateValidateClone_ConstantIntersection.ts | 11 ++ ...createValidateEquals_AtomicIntersection.ts | 10 ++ ...eateValidateEquals_ConstantIntersection.ts | 10 ++ ..._createValidateParse_AtomicIntersection.ts | 10 ++ ...reateValidateParse_ConstantIntersection.ts | 11 ++ ..._createValidatePrune_AtomicIntersection.ts | 10 ++ ...reateValidatePrune_ConstantIntersection.ts | 11 ++ ...ateValidateStringify_AtomicIntersection.ts | 11 ++ ...eValidateStringify_ConstantIntersection.ts | 11 ++ .../equals/test_equals_AtomicIntersection.ts | 9 ++ .../test_equals_ConstantIntersection.ts | 9 ++ .../features/is/test_is_AtomicIntersection.ts | 10 ++ .../is/test_is_ConstantIntersection.ts | 10 ++ .../test_isClone_AtomicIntersection.ts | 10 ++ .../test_isClone_ConstantIntersection.ts | 10 ++ .../test_isParse_AtomicIntersection.ts | 10 ++ .../test_isParse_ConstantIntersection.ts | 10 ++ .../test_isPrune_AtomicIntersection.ts | 10 ++ .../test_isPrune_ConstantIntersection.ts | 10 ++ .../test_isStringify_AtomicIntersection.ts | 10 ++ .../test_isStringify_ConstantIntersection.ts | 10 ++ .../prune/test_prune_AtomicIntersection.ts | 9 ++ .../prune/test_prune_ConstantIntersection.ts | 9 ++ .../random/test_random_AtomicIntersection.ts | 9 ++ .../test_random_ConstantIntersection.ts | 9 ++ .../test_stringify_AtomicIntersection.ts | 9 ++ .../test_stringify_ConstantIntersection.ts | 9 ++ .../test_validate_AtomicIntersection.ts | 10 ++ .../test_validate_ConstantIntersection.ts | 10 ++ .../test_validateClone_AtomicIntersection.ts | 10 ++ ...test_validateClone_ConstantIntersection.ts | 10 ++ .../test_validateEquals_AtomicIntersection.ts | 9 ++ ...est_validateEquals_ConstantIntersection.ts | 9 ++ .../test_validateParse_AtomicIntersection.ts | 10 ++ ...test_validateParse_ConstantIntersection.ts | 10 ++ .../test_validatePrune_AtomicIntersection.ts | 10 ++ ...test_validatePrune_ConstantIntersection.ts | 10 ++ ...st_validateStringify_AtomicIntersection.ts | 11 ++ ..._validateStringify_ConstantIntersection.ts | 11 ++ ...test_application_ajv_AtomicIntersection.ts | 9 ++ ...st_application_ajv_ConstantIntersection.ts | 8 ++ ..._application_swagger_AtomicIntersection.ts | 8 ++ ...pplication_swagger_ConstantIntersection.ts | 11 ++ .../assert/test_assert_AtomicIntersection.ts | 85 +++++++++++ .../test_assert_ConstantIntersection.ts | 83 +++++++++++ .../test_assertClone_AtomicIntersection.ts | 123 ++++++++++++++++ .../test_assertClone_ConstantIntersection.ts | 121 ++++++++++++++++ .../test_assertEquals_AtomicIntersection.ts | 85 +++++++++++ .../test_assertEquals_ConstantIntersection.ts | 83 +++++++++++ .../test_assertParse_AtomicIntersection.ts | 73 ++++++++++ .../test_assertParse_ConstantIntersection.ts | 71 +++++++++ .../test_assertPrune_AtomicIntersection.ts | 103 +++++++++++++ .../test_assertPrune_ConstantIntersection.ts | 101 +++++++++++++ ...test_assertStringify_AtomicIntersection.ts | 101 +++++++++++++ ...st_assertStringify_ConstantIntersection.ts | 106 ++++++++++++++ .../clone/test_clone_AtomicIntersection.ts | 30 ++++ .../clone/test_clone_ConstantIntersection.ts | 30 ++++ .../test_createAssert_AtomicIntersection.ts | 68 +++++++++ .../test_createAssert_ConstantIntersection.ts | 66 +++++++++ ...st_createAssertClone_AtomicIntersection.ts | 84 +++++++++++ ..._createAssertClone_ConstantIntersection.ts | 82 +++++++++++ ...t_createAssertEquals_AtomicIntersection.ts | 70 +++++++++ ...createAssertEquals_ConstantIntersection.ts | 68 +++++++++ ...st_createAssertParse_AtomicIntersection.ts | 72 ++++++++++ ..._createAssertParse_ConstantIntersection.ts | 70 +++++++++ ...st_createAssertPrune_AtomicIntersection.ts | 74 ++++++++++ ..._createAssertPrune_ConstantIntersection.ts | 72 ++++++++++ ...reateAssertStringify_AtomicIntersection.ts | 80 +++++++++++ ...ateAssertStringify_ConstantIntersection.ts | 85 +++++++++++ .../test_createClone_AtomicIntersection.ts | 17 +++ .../test_createClone_ConstantIntersection.ts | 17 +++ .../test_createEquals_AtomicIntersection.ts | 21 +++ .../test_createEquals_ConstantIntersection.ts | 20 +++ .../test_createIs_AtomicIntersection.ts | 19 +++ .../test_createIs_ConstantIntersection.ts | 18 +++ .../test_createIsClone_AtomicIntersection.ts | 35 +++++ ...test_createIsClone_ConstantIntersection.ts | 34 +++++ .../test_createIsParse_AtomicIntersection.ts | 23 +++ ...test_createIsParse_ConstantIntersection.ts | 22 +++ .../test_createIsPrune_AtomicIntersection.ts | 25 ++++ ...test_createIsPrune_ConstantIntersection.ts | 24 ++++ ...st_createIsStringify_AtomicIntersection.ts | 27 ++++ ..._createIsStringify_ConstantIntersection.ts | 34 +++++ .../test_createPrune_AtomicIntersection.ts | 9 ++ .../test_createPrune_ConstantIntersection.ts | 9 ++ .../test_createRandom_AtomicIntersection.ts | 80 +++++++++++ .../test_createRandom_ConstantIntersection.ts | 71 +++++++++ ...test_createStringify_AtomicIntersection.ts | 13 ++ ...st_createStringify_ConstantIntersection.ts | 21 +++ .../test_createValidate_AtomicIntersection.ts | 76 ++++++++++ ...est_createValidate_ConstantIntersection.ts | 74 ++++++++++ ..._createValidateClone_AtomicIntersection.ts | 94 ++++++++++++ ...reateValidateClone_ConstantIntersection.ts | 101 +++++++++++++ ...createValidateEquals_AtomicIntersection.ts | 79 ++++++++++ ...eateValidateEquals_ConstantIntersection.ts | 77 ++++++++++ ..._createValidateParse_AtomicIntersection.ts | 83 +++++++++++ ...reateValidateParse_ConstantIntersection.ts | 86 +++++++++++ ..._createValidatePrune_AtomicIntersection.ts | 84 +++++++++++ ...reateValidatePrune_ConstantIntersection.ts | 85 +++++++++++ ...ateValidateStringify_AtomicIntersection.ts | 93 ++++++++++++ ...eValidateStringify_ConstantIntersection.ts | 98 +++++++++++++ .../equals/test_equals_AtomicIntersection.ts | 26 ++++ .../test_equals_ConstantIntersection.ts | 25 ++++ .../output/is/test_is_AtomicIntersection.ts | 26 ++++ .../output/is/test_is_ConstantIntersection.ts | 25 ++++ .../test_isClone_AtomicIntersection.ts | 64 +++++++++ .../test_isClone_ConstantIntersection.ts | 63 ++++++++ .../test_isParse_AtomicIntersection.ts | 24 ++++ .../test_isParse_ConstantIntersection.ts | 23 +++ .../test_isPrune_AtomicIntersection.ts | 44 ++++++ .../test_isPrune_ConstantIntersection.ts | 43 ++++++ .../test_isStringify_AtomicIntersection.ts | 48 +++++++ .../test_isStringify_ConstantIntersection.ts | 54 +++++++ .../prune/test_prune_AtomicIntersection.ts | 16 +++ .../prune/test_prune_ConstantIntersection.ts | 16 +++ .../random/test_random_AtomicIntersection.ts | 81 +++++++++++ .../test_random_ConstantIntersection.ts | 72 ++++++++++ .../test_stringify_AtomicIntersection.ts | 20 +++ .../test_stringify_ConstantIntersection.ts | 28 ++++ .../test_validate_AtomicIntersection.ts | 95 ++++++++++++ .../test_validate_ConstantIntersection.ts | 93 ++++++++++++ .../test_validateClone_AtomicIntersection.ts | 135 ++++++++++++++++++ ...test_validateClone_ConstantIntersection.ts | 133 +++++++++++++++++ .../test_validateEquals_AtomicIntersection.ts | 95 ++++++++++++ ...est_validateEquals_ConstantIntersection.ts | 93 ++++++++++++ .../test_validateParse_AtomicIntersection.ts | 86 +++++++++++ ...test_validateParse_ConstantIntersection.ts | 84 +++++++++++ .../test_validatePrune_AtomicIntersection.ts | 115 +++++++++++++++ ...test_validatePrune_ConstantIntersection.ts | 113 +++++++++++++++ ...st_validateStringify_AtomicIntersection.ts | 123 ++++++++++++++++ ..._validateStringify_ConstantIntersection.ts | 128 +++++++++++++++++ test/issues/intersection.ts | 4 + test/schemas/json/ajv/AtomicIntersection.json | 39 +++++ .../json/ajv/ConstantIntersection.json | 48 +++++++ .../json/swagger/AtomicIntersection.json | 51 +++++++ .../json/swagger/ConstantIntersection.json | 60 ++++++++ test/structures/AtomicIntersection.ts | 33 +++++ test/structures/ConstantIntersection.ts | 33 +++++ 198 files changed, 6984 insertions(+), 27 deletions(-) create mode 100644 src/factories/internal/metadata/iterate_metadata_intersection.ts create mode 100644 test/features/application/ajv/test_application_ajv_AtomicIntersection.ts create mode 100644 test/features/application/ajv/test_application_ajv_ConstantIntersection.ts create mode 100644 test/features/application/swagger/test_application_swagger_AtomicIntersection.ts create mode 100644 test/features/application/swagger/test_application_swagger_ConstantIntersection.ts create mode 100644 test/features/assert/test_assert_AtomicIntersection.ts create mode 100644 test/features/assert/test_assert_ConstantIntersection.ts create mode 100644 test/features/assertClone/test_assertClone_AtomicIntersection.ts create mode 100644 test/features/assertClone/test_assertClone_ConstantIntersection.ts create mode 100644 test/features/assertEquals/test_assertEquals_AtomicIntersection.ts create mode 100644 test/features/assertEquals/test_assertEquals_ConstantIntersection.ts create mode 100644 test/features/assertParse/test_assertParse_AtomicIntersection.ts create mode 100644 test/features/assertParse/test_assertParse_ConstantIntersection.ts create mode 100644 test/features/assertPrune/test_assertPrune_AtomicIntersection.ts create mode 100644 test/features/assertPrune/test_assertPrune_ConstantIntersection.ts create mode 100644 test/features/assertStringify/test_assertStringify_AtomicIntersection.ts create mode 100644 test/features/assertStringify/test_assertStringify_ConstantIntersection.ts create mode 100644 test/features/clone/test_clone_AtomicIntersection.ts create mode 100644 test/features/clone/test_clone_ConstantIntersection.ts create mode 100644 test/features/createAssert/test_createAssert_AtomicIntersection.ts create mode 100644 test/features/createAssert/test_createAssert_ConstantIntersection.ts create mode 100644 test/features/createAssertClone/test_createAssertClone_AtomicIntersection.ts create mode 100644 test/features/createAssertClone/test_createAssertClone_ConstantIntersection.ts create mode 100644 test/features/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts create mode 100644 test/features/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts create mode 100644 test/features/createAssertParse/test_createAssertParse_AtomicIntersection.ts create mode 100644 test/features/createAssertParse/test_createAssertParse_ConstantIntersection.ts create mode 100644 test/features/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts create mode 100644 test/features/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts create mode 100644 test/features/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts create mode 100644 test/features/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts create mode 100644 test/features/createClone/test_createClone_AtomicIntersection.ts create mode 100644 test/features/createClone/test_createClone_ConstantIntersection.ts create mode 100644 test/features/createEquals/test_createEquals_AtomicIntersection.ts create mode 100644 test/features/createEquals/test_createEquals_ConstantIntersection.ts create mode 100644 test/features/createIs/test_createIs_AtomicIntersection.ts create mode 100644 test/features/createIs/test_createIs_ConstantIntersection.ts create mode 100644 test/features/createIsClone/test_createIsClone_AtomicIntersection.ts create mode 100644 test/features/createIsClone/test_createIsClone_ConstantIntersection.ts create mode 100644 test/features/createIsParse/test_createIsParse_AtomicIntersection.ts create mode 100644 test/features/createIsParse/test_createIsParse_ConstantIntersection.ts create mode 100644 test/features/createIsPrune/test_createIsPrune_AtomicIntersection.ts create mode 100644 test/features/createIsPrune/test_createIsPrune_ConstantIntersection.ts create mode 100644 test/features/createIsStringify/test_createIsStringify_AtomicIntersection.ts create mode 100644 test/features/createIsStringify/test_createIsStringify_ConstantIntersection.ts create mode 100644 test/features/createPrune/test_createPrune_AtomicIntersection.ts create mode 100644 test/features/createPrune/test_createPrune_ConstantIntersection.ts create mode 100644 test/features/createRandom/test_createRandom_AtomicIntersection.ts create mode 100644 test/features/createRandom/test_createRandom_ConstantIntersection.ts create mode 100644 test/features/createStringify/test_createStringify_AtomicIntersection.ts create mode 100644 test/features/createStringify/test_createStringify_ConstantIntersection.ts create mode 100644 test/features/createValidate/test_createValidate_AtomicIntersection.ts create mode 100644 test/features/createValidate/test_createValidate_ConstantIntersection.ts create mode 100644 test/features/createValidateClone/test_createValidateClone_AtomicIntersection.ts create mode 100644 test/features/createValidateClone/test_createValidateClone_ConstantIntersection.ts create mode 100644 test/features/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts create mode 100644 test/features/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts create mode 100644 test/features/createValidateParse/test_createValidateParse_AtomicIntersection.ts create mode 100644 test/features/createValidateParse/test_createValidateParse_ConstantIntersection.ts create mode 100644 test/features/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts create mode 100644 test/features/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts create mode 100644 test/features/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts create mode 100644 test/features/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts create mode 100644 test/features/equals/test_equals_AtomicIntersection.ts create mode 100644 test/features/equals/test_equals_ConstantIntersection.ts create mode 100644 test/features/is/test_is_AtomicIntersection.ts create mode 100644 test/features/is/test_is_ConstantIntersection.ts create mode 100644 test/features/isClone/test_isClone_AtomicIntersection.ts create mode 100644 test/features/isClone/test_isClone_ConstantIntersection.ts create mode 100644 test/features/isParse/test_isParse_AtomicIntersection.ts create mode 100644 test/features/isParse/test_isParse_ConstantIntersection.ts create mode 100644 test/features/isPrune/test_isPrune_AtomicIntersection.ts create mode 100644 test/features/isPrune/test_isPrune_ConstantIntersection.ts create mode 100644 test/features/isStringify/test_isStringify_AtomicIntersection.ts create mode 100644 test/features/isStringify/test_isStringify_ConstantIntersection.ts create mode 100644 test/features/prune/test_prune_AtomicIntersection.ts create mode 100644 test/features/prune/test_prune_ConstantIntersection.ts create mode 100644 test/features/random/test_random_AtomicIntersection.ts create mode 100644 test/features/random/test_random_ConstantIntersection.ts create mode 100644 test/features/stringify/test_stringify_AtomicIntersection.ts create mode 100644 test/features/stringify/test_stringify_ConstantIntersection.ts create mode 100644 test/features/validate/test_validate_AtomicIntersection.ts create mode 100644 test/features/validate/test_validate_ConstantIntersection.ts create mode 100644 test/features/validateClone/test_validateClone_AtomicIntersection.ts create mode 100644 test/features/validateClone/test_validateClone_ConstantIntersection.ts create mode 100644 test/features/validateEquals/test_validateEquals_AtomicIntersection.ts create mode 100644 test/features/validateEquals/test_validateEquals_ConstantIntersection.ts create mode 100644 test/features/validateParse/test_validateParse_AtomicIntersection.ts create mode 100644 test/features/validateParse/test_validateParse_ConstantIntersection.ts create mode 100644 test/features/validatePrune/test_validatePrune_AtomicIntersection.ts create mode 100644 test/features/validatePrune/test_validatePrune_ConstantIntersection.ts create mode 100644 test/features/validateStringify/test_validateStringify_AtomicIntersection.ts create mode 100644 test/features/validateStringify/test_validateStringify_ConstantIntersection.ts create mode 100644 test/generated/output/application/ajv/test_application_ajv_AtomicIntersection.ts create mode 100644 test/generated/output/application/ajv/test_application_ajv_ConstantIntersection.ts create mode 100644 test/generated/output/application/swagger/test_application_swagger_AtomicIntersection.ts create mode 100644 test/generated/output/application/swagger/test_application_swagger_ConstantIntersection.ts create mode 100644 test/generated/output/assert/test_assert_AtomicIntersection.ts create mode 100644 test/generated/output/assert/test_assert_ConstantIntersection.ts create mode 100644 test/generated/output/assertClone/test_assertClone_AtomicIntersection.ts create mode 100644 test/generated/output/assertClone/test_assertClone_ConstantIntersection.ts create mode 100644 test/generated/output/assertEquals/test_assertEquals_AtomicIntersection.ts create mode 100644 test/generated/output/assertEquals/test_assertEquals_ConstantIntersection.ts create mode 100644 test/generated/output/assertParse/test_assertParse_AtomicIntersection.ts create mode 100644 test/generated/output/assertParse/test_assertParse_ConstantIntersection.ts create mode 100644 test/generated/output/assertPrune/test_assertPrune_AtomicIntersection.ts create mode 100644 test/generated/output/assertPrune/test_assertPrune_ConstantIntersection.ts create mode 100644 test/generated/output/assertStringify/test_assertStringify_AtomicIntersection.ts create mode 100644 test/generated/output/assertStringify/test_assertStringify_ConstantIntersection.ts create mode 100644 test/generated/output/clone/test_clone_AtomicIntersection.ts create mode 100644 test/generated/output/clone/test_clone_ConstantIntersection.ts create mode 100644 test/generated/output/createAssert/test_createAssert_AtomicIntersection.ts create mode 100644 test/generated/output/createAssert/test_createAssert_ConstantIntersection.ts create mode 100644 test/generated/output/createAssertClone/test_createAssertClone_AtomicIntersection.ts create mode 100644 test/generated/output/createAssertClone/test_createAssertClone_ConstantIntersection.ts create mode 100644 test/generated/output/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts create mode 100644 test/generated/output/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts create mode 100644 test/generated/output/createAssertParse/test_createAssertParse_AtomicIntersection.ts create mode 100644 test/generated/output/createAssertParse/test_createAssertParse_ConstantIntersection.ts create mode 100644 test/generated/output/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts create mode 100644 test/generated/output/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts create mode 100644 test/generated/output/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts create mode 100644 test/generated/output/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts create mode 100644 test/generated/output/createClone/test_createClone_AtomicIntersection.ts create mode 100644 test/generated/output/createClone/test_createClone_ConstantIntersection.ts create mode 100644 test/generated/output/createEquals/test_createEquals_AtomicIntersection.ts create mode 100644 test/generated/output/createEquals/test_createEquals_ConstantIntersection.ts create mode 100644 test/generated/output/createIs/test_createIs_AtomicIntersection.ts create mode 100644 test/generated/output/createIs/test_createIs_ConstantIntersection.ts create mode 100644 test/generated/output/createIsClone/test_createIsClone_AtomicIntersection.ts create mode 100644 test/generated/output/createIsClone/test_createIsClone_ConstantIntersection.ts create mode 100644 test/generated/output/createIsParse/test_createIsParse_AtomicIntersection.ts create mode 100644 test/generated/output/createIsParse/test_createIsParse_ConstantIntersection.ts create mode 100644 test/generated/output/createIsPrune/test_createIsPrune_AtomicIntersection.ts create mode 100644 test/generated/output/createIsPrune/test_createIsPrune_ConstantIntersection.ts create mode 100644 test/generated/output/createIsStringify/test_createIsStringify_AtomicIntersection.ts create mode 100644 test/generated/output/createIsStringify/test_createIsStringify_ConstantIntersection.ts create mode 100644 test/generated/output/createPrune/test_createPrune_AtomicIntersection.ts create mode 100644 test/generated/output/createPrune/test_createPrune_ConstantIntersection.ts create mode 100644 test/generated/output/createRandom/test_createRandom_AtomicIntersection.ts create mode 100644 test/generated/output/createRandom/test_createRandom_ConstantIntersection.ts create mode 100644 test/generated/output/createStringify/test_createStringify_AtomicIntersection.ts create mode 100644 test/generated/output/createStringify/test_createStringify_ConstantIntersection.ts create mode 100644 test/generated/output/createValidate/test_createValidate_AtomicIntersection.ts create mode 100644 test/generated/output/createValidate/test_createValidate_ConstantIntersection.ts create mode 100644 test/generated/output/createValidateClone/test_createValidateClone_AtomicIntersection.ts create mode 100644 test/generated/output/createValidateClone/test_createValidateClone_ConstantIntersection.ts create mode 100644 test/generated/output/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts create mode 100644 test/generated/output/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts create mode 100644 test/generated/output/createValidateParse/test_createValidateParse_AtomicIntersection.ts create mode 100644 test/generated/output/createValidateParse/test_createValidateParse_ConstantIntersection.ts create mode 100644 test/generated/output/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts create mode 100644 test/generated/output/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts create mode 100644 test/generated/output/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts create mode 100644 test/generated/output/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts create mode 100644 test/generated/output/equals/test_equals_AtomicIntersection.ts create mode 100644 test/generated/output/equals/test_equals_ConstantIntersection.ts create mode 100644 test/generated/output/is/test_is_AtomicIntersection.ts create mode 100644 test/generated/output/is/test_is_ConstantIntersection.ts create mode 100644 test/generated/output/isClone/test_isClone_AtomicIntersection.ts create mode 100644 test/generated/output/isClone/test_isClone_ConstantIntersection.ts create mode 100644 test/generated/output/isParse/test_isParse_AtomicIntersection.ts create mode 100644 test/generated/output/isParse/test_isParse_ConstantIntersection.ts create mode 100644 test/generated/output/isPrune/test_isPrune_AtomicIntersection.ts create mode 100644 test/generated/output/isPrune/test_isPrune_ConstantIntersection.ts create mode 100644 test/generated/output/isStringify/test_isStringify_AtomicIntersection.ts create mode 100644 test/generated/output/isStringify/test_isStringify_ConstantIntersection.ts create mode 100644 test/generated/output/prune/test_prune_AtomicIntersection.ts create mode 100644 test/generated/output/prune/test_prune_ConstantIntersection.ts create mode 100644 test/generated/output/random/test_random_AtomicIntersection.ts create mode 100644 test/generated/output/random/test_random_ConstantIntersection.ts create mode 100644 test/generated/output/stringify/test_stringify_AtomicIntersection.ts create mode 100644 test/generated/output/stringify/test_stringify_ConstantIntersection.ts create mode 100644 test/generated/output/validate/test_validate_AtomicIntersection.ts create mode 100644 test/generated/output/validate/test_validate_ConstantIntersection.ts create mode 100644 test/generated/output/validateClone/test_validateClone_AtomicIntersection.ts create mode 100644 test/generated/output/validateClone/test_validateClone_ConstantIntersection.ts create mode 100644 test/generated/output/validateEquals/test_validateEquals_AtomicIntersection.ts create mode 100644 test/generated/output/validateEquals/test_validateEquals_ConstantIntersection.ts create mode 100644 test/generated/output/validateParse/test_validateParse_AtomicIntersection.ts create mode 100644 test/generated/output/validateParse/test_validateParse_ConstantIntersection.ts create mode 100644 test/generated/output/validatePrune/test_validatePrune_AtomicIntersection.ts create mode 100644 test/generated/output/validatePrune/test_validatePrune_ConstantIntersection.ts create mode 100644 test/generated/output/validateStringify/test_validateStringify_AtomicIntersection.ts create mode 100644 test/generated/output/validateStringify/test_validateStringify_ConstantIntersection.ts create mode 100644 test/issues/intersection.ts create mode 100644 test/schemas/json/ajv/AtomicIntersection.json create mode 100644 test/schemas/json/ajv/ConstantIntersection.json create mode 100644 test/schemas/json/swagger/AtomicIntersection.json create mode 100644 test/schemas/json/swagger/ConstantIntersection.json create mode 100644 test/structures/AtomicIntersection.ts create mode 100644 test/structures/ConstantIntersection.ts diff --git a/package.json b/package.json index 6a52d58953..a32c6c692d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typia", - "version": "4.0.5", + "version": "4.0.6-dev.20230611", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/packages/typescript-json/package.json b/packages/typescript-json/package.json index 0219c2cb40..d79c398109 100644 --- a/packages/typescript-json/package.json +++ b/packages/typescript-json/package.json @@ -1,6 +1,6 @@ { "name": "typescript-json", - "version": "4.0.5", + "version": "4.0.6-dev.20230611", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -68,7 +68,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "typia": "4.0.5" + "typia": "4.0.6-dev.20230611" }, "peerDependencies": { "typescript": ">= 4.5.2" diff --git a/src/Primitive.ts b/src/Primitive.ts index 9c4ddf0c77..349cdbc3bb 100644 --- a/src/Primitive.ts +++ b/src/Primitive.ts @@ -34,7 +34,13 @@ export type Primitive = Equal> extends true type Equal = X extends Y ? (Y extends X ? true : false) : false; -type PrimitiveMain = ValueOf extends object +type PrimitiveMain = ValueOf extends + | boolean + | number + | bigint + | string + ? ValueOf + : ValueOf extends object ? Instance extends object ? Instance extends NativeClass ? {} diff --git a/src/factories/internal/metadata/iterate_metadata.ts b/src/factories/internal/metadata/iterate_metadata.ts index c43129f82b..02b78b7268 100644 --- a/src/factories/internal/metadata/iterate_metadata.ts +++ b/src/factories/internal/metadata/iterate_metadata.ts @@ -10,6 +10,7 @@ import { iterate_metadata_atomic } from "./iterate_metadata_atomic"; import { iterate_metadata_coalesce } from "./iterate_metadata_coalesce"; import { iterate_metadata_constant } from "./iterate_metadata_constant"; import { iterate_metadata_definition } from "./iterate_metadata_definition"; +import { iterate_metadata_intersection } from "./iterate_metadata_intersection"; import { iterate_metadata_map } from "./iterate_metadata_map"; import { iterate_metadata_native } from "./iterate_metadata_native"; import { iterate_metadata_object } from "./iterate_metadata_object"; @@ -40,6 +41,12 @@ export const iterate_metadata = meta, type, )) || + iterate_metadata_intersection(checker)(options)(collection)( + meta, + type, + parentResolved, + aliased, + ) || iterate_metadata_union(checker)(options)(collection)( meta, type, diff --git a/src/factories/internal/metadata/iterate_metadata_intersection.ts b/src/factories/internal/metadata/iterate_metadata_intersection.ts new file mode 100644 index 0000000000..fdf6a1517a --- /dev/null +++ b/src/factories/internal/metadata/iterate_metadata_intersection.ts @@ -0,0 +1,86 @@ +import ts from "typescript"; + +import { Metadata } from "../../../metadata/Metadata"; + +import { MetadataCollection } from "../../MetadataCollection"; +import { MetadataFactory } from "../../MetadataFactory"; +import { explore_metadata } from "./explore_metadata"; +import { iterate_metadata } from "./iterate_metadata"; +import { iterate_metadata_object } from "./iterate_metadata_object"; + +export const iterate_metadata_intersection = + (checker: ts.TypeChecker) => + (options: MetadataFactory.IOptions) => + (collection: MetadataCollection) => + ( + meta: Metadata, + type: ts.Type, + resolved: boolean, + aliased: boolean, + ): boolean => { + if (!type.isIntersection()) return false; + + // COSTRUCT FAKE METADATA LIST + const fakeCollection: MetadataCollection = new MetadataCollection(); + const children: Metadata[] = [ + ...new Map( + type.types.map((t) => { + const m: Metadata = explore_metadata(checker)(options)( + fakeCollection, + )(t, resolved); + return [m.getName(), m] as const; + }), + ).values(), + ]; + + // ONLY ONE CHILD AFTER REMOVING DUPLICATES + if (children.length === 1) { + iterate_metadata(checker)(options)(collection)( + meta, + type.types[0]!, + resolved, + aliased, + ); + return true; + } + + // ONLY OBJECT TYPES -> MERGE + const object: boolean = children.every( + (c) => c.objects.length && c.objects.length === c.size(), + ); + if (object) + return iterate_metadata_object(checker)(options)(collection)( + meta, + type, + resolved, + true, + ); + + // ABSORB TO ATOMIC (OR CONSTANT) TYPE + const atomics: Metadata[] = children.filter( + (c) => + (c.atomics.length ? 1 : 0 + c.constants.length ? 1 : 0) === + c.bucket(), + ); + const objects: Metadata[] = children.filter( + (c) => c.objects.length && c.objects.length === c.size(), + ); + if ( + atomics.length === 0 || + atomics.length + objects.length !== children.length + ) + throw new Error(message(children)); + + const least: Metadata = atomics.reduce((x, y) => { + if (Metadata.covers(x, y)) return y; + else if (Metadata.covers(y, x)) return x; + throw new Error(message(children)); + }); + Object.assign(meta, Metadata.merge(meta, least)); + return true; + }; + +const message = (children: Metadata[]) => + `Error on typia.MetadataFactory.analyze(): nonsensibl intersection type detected - ${children + .map((c) => c.getName()) + .join(" & ")}.`; diff --git a/src/factories/internal/metadata/iterate_metadata_object.ts b/src/factories/internal/metadata/iterate_metadata_object.ts index bc8185ab0b..16c30ae8ff 100644 --- a/src/factories/internal/metadata/iterate_metadata_object.ts +++ b/src/factories/internal/metadata/iterate_metadata_object.ts @@ -14,31 +14,39 @@ export const iterate_metadata_object = (checker: ts.TypeChecker) => (options: MetadataFactory.IOptions) => (collection: MetadataCollection) => - (meta: Metadata, type: ts.Type, parentResolved: boolean): boolean => { - const filter = (flag: ts.TypeFlags) => (type.getFlags() & flag) !== 0; - if ( - !filter(ts.TypeFlags.Object) && - !type.isIntersection() && - (type as any).intrinsicName !== "object" - ) - return false; - else if (type.isIntersection()) { - const fakeCollection = new MetadataCollection(); - const fakeSchema: Metadata = Metadata.initialize(); - - type.types.forEach((t) => - iterate_metadata(checker)(options)(fakeCollection)( - fakeSchema, - t, - parentResolved, - false, - ), - ); + ( + meta: Metadata, + type: ts.Type, + parentResolved: boolean, + ensure: boolean = false, + ): boolean => { + if (ensure === false) { + const filter = (flag: ts.TypeFlags) => + (type.getFlags() & flag) !== 0; if ( - fakeSchema.objects.length === 0 || - fakeSchema.objects.length !== fakeSchema.size() + !filter(ts.TypeFlags.Object) && + !type.isIntersection() && + (type as any).intrinsicName !== "object" ) - return true; + return false; + else if (type.isIntersection()) { + const fakeCollection = new MetadataCollection(); + const fakeSchema: Metadata = Metadata.initialize(); + + type.types.forEach((t) => + iterate_metadata(checker)(options)(fakeCollection)( + fakeSchema, + t, + parentResolved, + false, + ), + ); + if ( + fakeSchema.objects.length === 0 || + fakeSchema.objects.length !== fakeSchema.size() + ) + return false; + } } const obj: MetadataObject = emplace_metadata_object(checker)(options)( diff --git a/src/metadata/Metadata.ts b/src/metadata/Metadata.ts index 7672a71fc4..7b822caa13 100644 --- a/src/metadata/Metadata.ts +++ b/src/metadata/Metadata.ts @@ -449,6 +449,7 @@ export namespace Metadata { // CONSTANTS for (const yc of y.constants) { + if (x.atomics.some((type) => yc.type === type)) continue; const xc: MetadataConstant | undefined = x.constants.find( (elem) => elem.type === yc.type, ); diff --git a/test/features/application/ajv/test_application_ajv_AtomicIntersection.ts b/test/features/application/ajv/test_application_ajv_AtomicIntersection.ts new file mode 100644 index 0000000000..56f8453f6a --- /dev/null +++ b/test/features/application/ajv/test_application_ajv_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "typia"; + +import { _test_application } from "../../../internal/_test_application"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_application_ajv_AtomicIntersection = _test_application("ajv")( + "AtomicIntersection", + typia.application<[AtomicIntersection], "ajv">(), +); diff --git a/test/features/application/ajv/test_application_ajv_ConstantIntersection.ts b/test/features/application/ajv/test_application_ajv_ConstantIntersection.ts new file mode 100644 index 0000000000..1f322a49be --- /dev/null +++ b/test/features/application/ajv/test_application_ajv_ConstantIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_application } from "../../../internal/_test_application"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_application_ajv_ConstantIntersection = _test_application( + "ajv", +)("ConstantIntersection", typia.application<[ConstantIntersection], "ajv">()); diff --git a/test/features/application/swagger/test_application_swagger_AtomicIntersection.ts b/test/features/application/swagger/test_application_swagger_AtomicIntersection.ts new file mode 100644 index 0000000000..27ede8dae9 --- /dev/null +++ b/test/features/application/swagger/test_application_swagger_AtomicIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_application } from "../../../internal/_test_application"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_application_swagger_AtomicIntersection = _test_application( + "swagger", +)("AtomicIntersection", typia.application<[AtomicIntersection], "swagger">()); diff --git a/test/features/application/swagger/test_application_swagger_ConstantIntersection.ts b/test/features/application/swagger/test_application_swagger_ConstantIntersection.ts new file mode 100644 index 0000000000..bd7bea1d6c --- /dev/null +++ b/test/features/application/swagger/test_application_swagger_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "typia"; + +import { _test_application } from "../../../internal/_test_application"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_application_swagger_ConstantIntersection = _test_application( + "swagger", +)( + "ConstantIntersection", + typia.application<[ConstantIntersection], "swagger">(), +); diff --git a/test/features/assert/test_assert_AtomicIntersection.ts b/test/features/assert/test_assert_AtomicIntersection.ts new file mode 100644 index 0000000000..c2f1fcdbfa --- /dev/null +++ b/test/features/assert/test_assert_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assert } from "../../internal/_test_assert"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assert_AtomicIntersection = _test_assert( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assert(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/assert/test_assert_ConstantIntersection.ts b/test/features/assert/test_assert_ConstantIntersection.ts new file mode 100644 index 0000000000..90aaa4dc0c --- /dev/null +++ b/test/features/assert/test_assert_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assert } from "../../internal/_test_assert"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assert_ConstantIntersection = _test_assert( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assert(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/assertClone/test_assertClone_AtomicIntersection.ts b/test/features/assertClone/test_assertClone_AtomicIntersection.ts new file mode 100644 index 0000000000..85f1e25757 --- /dev/null +++ b/test/features/assertClone/test_assertClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertClone } from "../../internal/_test_assertClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assertClone_AtomicIntersection = _test_assertClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assertClone(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/assertClone/test_assertClone_ConstantIntersection.ts b/test/features/assertClone/test_assertClone_ConstantIntersection.ts new file mode 100644 index 0000000000..ce13ebdacd --- /dev/null +++ b/test/features/assertClone/test_assertClone_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertClone } from "../../internal/_test_assertClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assertClone_ConstantIntersection = _test_assertClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assertClone(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/assertEquals/test_assertEquals_AtomicIntersection.ts b/test/features/assertEquals/test_assertEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..673e338694 --- /dev/null +++ b/test/features/assertEquals/test_assertEquals_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_assertEquals } from "../../internal/_test_assertEquals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assertEquals_AtomicIntersection = _test_assertEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assertEquals(input), +); diff --git a/test/features/assertEquals/test_assertEquals_ConstantIntersection.ts b/test/features/assertEquals/test_assertEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..ca8a8c5e12 --- /dev/null +++ b/test/features/assertEquals/test_assertEquals_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_assertEquals } from "../../internal/_test_assertEquals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assertEquals_ConstantIntersection = _test_assertEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assertEquals(input), +); diff --git a/test/features/assertParse/test_assertParse_AtomicIntersection.ts b/test/features/assertParse/test_assertParse_AtomicIntersection.ts new file mode 100644 index 0000000000..478ad37630 --- /dev/null +++ b/test/features/assertParse/test_assertParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertParse } from "../../internal/_test_assertParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assertParse_AtomicIntersection = _test_assertParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assertParse(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/assertParse/test_assertParse_ConstantIntersection.ts b/test/features/assertParse/test_assertParse_ConstantIntersection.ts new file mode 100644 index 0000000000..ee1a95bc8e --- /dev/null +++ b/test/features/assertParse/test_assertParse_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertParse } from "../../internal/_test_assertParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assertParse_ConstantIntersection = _test_assertParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assertParse(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/assertPrune/test_assertPrune_AtomicIntersection.ts b/test/features/assertPrune/test_assertPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..edd9c2ad9f --- /dev/null +++ b/test/features/assertPrune/test_assertPrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertPrune } from "../../internal/_test_assertPrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assertPrune_AtomicIntersection = _test_assertPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assertPrune(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/assertPrune/test_assertPrune_ConstantIntersection.ts b/test/features/assertPrune/test_assertPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..527f05690d --- /dev/null +++ b/test/features/assertPrune/test_assertPrune_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertPrune } from "../../internal/_test_assertPrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assertPrune_ConstantIntersection = _test_assertPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assertPrune(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/assertStringify/test_assertStringify_AtomicIntersection.ts b/test/features/assertStringify/test_assertStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..674614d763 --- /dev/null +++ b/test/features/assertStringify/test_assertStringify_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertStringify } from "../../internal/_test_assertStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_assertStringify_AtomicIntersection = _test_assertStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.assertStringify(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/assertStringify/test_assertStringify_ConstantIntersection.ts b/test/features/assertStringify/test_assertStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..ec720f35f2 --- /dev/null +++ b/test/features/assertStringify/test_assertStringify_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertStringify } from "../../internal/_test_assertStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_assertStringify_ConstantIntersection = _test_assertStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.assertStringify(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/clone/test_clone_AtomicIntersection.ts b/test/features/clone/test_clone_AtomicIntersection.ts new file mode 100644 index 0000000000..0fd965c400 --- /dev/null +++ b/test/features/clone/test_clone_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_clone } from "../../internal/_test_clone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_clone_AtomicIntersection = _test_clone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.clone(input), +); diff --git a/test/features/clone/test_clone_ConstantIntersection.ts b/test/features/clone/test_clone_ConstantIntersection.ts new file mode 100644 index 0000000000..4f257d5b21 --- /dev/null +++ b/test/features/clone/test_clone_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_clone } from "../../internal/_test_clone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_clone_ConstantIntersection = _test_clone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.clone(input), +); diff --git a/test/features/createAssert/test_createAssert_AtomicIntersection.ts b/test/features/createAssert/test_createAssert_AtomicIntersection.ts new file mode 100644 index 0000000000..e1268a33ed --- /dev/null +++ b/test/features/createAssert/test_createAssert_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assert } from "../../internal/_test_assert"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssert_AtomicIntersection = _test_assert( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssert(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createAssert/test_createAssert_ConstantIntersection.ts b/test/features/createAssert/test_createAssert_ConstantIntersection.ts new file mode 100644 index 0000000000..f3c3c63497 --- /dev/null +++ b/test/features/createAssert/test_createAssert_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assert } from "../../internal/_test_assert"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssert_ConstantIntersection = _test_assert( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssert(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createAssertClone/test_createAssertClone_AtomicIntersection.ts b/test/features/createAssertClone/test_createAssertClone_AtomicIntersection.ts new file mode 100644 index 0000000000..2f11435f0a --- /dev/null +++ b/test/features/createAssertClone/test_createAssertClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertClone } from "../../internal/_test_assertClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssertClone_AtomicIntersection = _test_assertClone( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssertClone(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createAssertClone/test_createAssertClone_ConstantIntersection.ts b/test/features/createAssertClone/test_createAssertClone_ConstantIntersection.ts new file mode 100644 index 0000000000..7b8c1b43e6 --- /dev/null +++ b/test/features/createAssertClone/test_createAssertClone_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertClone } from "../../internal/_test_assertClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssertClone_ConstantIntersection = _test_assertClone( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssertClone(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts b/test/features/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..fee0af819a --- /dev/null +++ b/test/features/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_assertEquals } from "../../internal/_test_assertEquals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssertEquals_AtomicIntersection = _test_assertEquals( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssertEquals(), +); diff --git a/test/features/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts b/test/features/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..9c69c9a3f0 --- /dev/null +++ b/test/features/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_assertEquals } from "../../internal/_test_assertEquals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssertEquals_ConstantIntersection = _test_assertEquals( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssertEquals(), +); diff --git a/test/features/createAssertParse/test_createAssertParse_AtomicIntersection.ts b/test/features/createAssertParse/test_createAssertParse_AtomicIntersection.ts new file mode 100644 index 0000000000..729e2483aa --- /dev/null +++ b/test/features/createAssertParse/test_createAssertParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertParse } from "../../internal/_test_assertParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssertParse_AtomicIntersection = _test_assertParse( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssertParse(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createAssertParse/test_createAssertParse_ConstantIntersection.ts b/test/features/createAssertParse/test_createAssertParse_ConstantIntersection.ts new file mode 100644 index 0000000000..d142436d27 --- /dev/null +++ b/test/features/createAssertParse/test_createAssertParse_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertParse } from "../../internal/_test_assertParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssertParse_ConstantIntersection = _test_assertParse( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssertParse(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts b/test/features/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..f111a95d89 --- /dev/null +++ b/test/features/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertPrune } from "../../internal/_test_assertPrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssertPrune_AtomicIntersection = _test_assertPrune( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssertPrune(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts b/test/features/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..abc245c970 --- /dev/null +++ b/test/features/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_assertPrune } from "../../internal/_test_assertPrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssertPrune_ConstantIntersection = _test_assertPrune( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssertPrune(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts b/test/features/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..02014e98bc --- /dev/null +++ b/test/features/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_assertStringify } from "../../internal/_test_assertStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createAssertStringify_AtomicIntersection = + _test_assertStringify( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createAssertStringify(), + AtomicIntersection.SPOILERS, + ); diff --git a/test/features/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts b/test/features/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..4951623a32 --- /dev/null +++ b/test/features/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_assertStringify } from "../../internal/_test_assertStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createAssertStringify_ConstantIntersection = + _test_assertStringify( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createAssertStringify(), + ConstantIntersection.SPOILERS, + ); diff --git a/test/features/createClone/test_createClone_AtomicIntersection.ts b/test/features/createClone/test_createClone_AtomicIntersection.ts new file mode 100644 index 0000000000..ca7b5eec1b --- /dev/null +++ b/test/features/createClone/test_createClone_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_clone } from "../../internal/_test_clone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createClone_AtomicIntersection = _test_clone( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createClone(), +); diff --git a/test/features/createClone/test_createClone_ConstantIntersection.ts b/test/features/createClone/test_createClone_ConstantIntersection.ts new file mode 100644 index 0000000000..b885f15026 --- /dev/null +++ b/test/features/createClone/test_createClone_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_clone } from "../../internal/_test_clone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createClone_ConstantIntersection = _test_clone( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createClone(), +); diff --git a/test/features/createEquals/test_createEquals_AtomicIntersection.ts b/test/features/createEquals/test_createEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..709efc1410 --- /dev/null +++ b/test/features/createEquals/test_createEquals_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_equals } from "../../internal/_test_equals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createEquals_AtomicIntersection = _test_equals( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createEquals(), +); diff --git a/test/features/createEquals/test_createEquals_ConstantIntersection.ts b/test/features/createEquals/test_createEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..0c81a89a11 --- /dev/null +++ b/test/features/createEquals/test_createEquals_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_equals } from "../../internal/_test_equals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createEquals_ConstantIntersection = _test_equals( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createEquals(), +); diff --git a/test/features/createIs/test_createIs_AtomicIntersection.ts b/test/features/createIs/test_createIs_AtomicIntersection.ts new file mode 100644 index 0000000000..d8941d9bd4 --- /dev/null +++ b/test/features/createIs/test_createIs_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_is } from "../../internal/_test_is"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createIs_AtomicIntersection = _test_is( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createIs(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createIs/test_createIs_ConstantIntersection.ts b/test/features/createIs/test_createIs_ConstantIntersection.ts new file mode 100644 index 0000000000..fc25c1dece --- /dev/null +++ b/test/features/createIs/test_createIs_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_is } from "../../internal/_test_is"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createIs_ConstantIntersection = _test_is( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createIs(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createIsClone/test_createIsClone_AtomicIntersection.ts b/test/features/createIsClone/test_createIsClone_AtomicIntersection.ts new file mode 100644 index 0000000000..c0ab175ad5 --- /dev/null +++ b/test/features/createIsClone/test_createIsClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isClone } from "../../internal/_test_isClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createIsClone_AtomicIntersection = _test_isClone( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createIsClone(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createIsClone/test_createIsClone_ConstantIntersection.ts b/test/features/createIsClone/test_createIsClone_ConstantIntersection.ts new file mode 100644 index 0000000000..0128742e85 --- /dev/null +++ b/test/features/createIsClone/test_createIsClone_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isClone } from "../../internal/_test_isClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createIsClone_ConstantIntersection = _test_isClone( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createIsClone(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createIsParse/test_createIsParse_AtomicIntersection.ts b/test/features/createIsParse/test_createIsParse_AtomicIntersection.ts new file mode 100644 index 0000000000..bff3817b96 --- /dev/null +++ b/test/features/createIsParse/test_createIsParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isParse } from "../../internal/_test_isParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createIsParse_AtomicIntersection = _test_isParse( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createIsParse(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createIsParse/test_createIsParse_ConstantIntersection.ts b/test/features/createIsParse/test_createIsParse_ConstantIntersection.ts new file mode 100644 index 0000000000..1cfd179f6a --- /dev/null +++ b/test/features/createIsParse/test_createIsParse_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isParse } from "../../internal/_test_isParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createIsParse_ConstantIntersection = _test_isParse( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createIsParse(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createIsPrune/test_createIsPrune_AtomicIntersection.ts b/test/features/createIsPrune/test_createIsPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..59fee61071 --- /dev/null +++ b/test/features/createIsPrune/test_createIsPrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isPrune } from "../../internal/_test_isPrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createIsPrune_AtomicIntersection = _test_isPrune( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createIsPrune(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createIsPrune/test_createIsPrune_ConstantIntersection.ts b/test/features/createIsPrune/test_createIsPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..57ac91d469 --- /dev/null +++ b/test/features/createIsPrune/test_createIsPrune_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isPrune } from "../../internal/_test_isPrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createIsPrune_ConstantIntersection = _test_isPrune( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createIsPrune(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createIsStringify/test_createIsStringify_AtomicIntersection.ts b/test/features/createIsStringify/test_createIsStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..05737d7fb8 --- /dev/null +++ b/test/features/createIsStringify/test_createIsStringify_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isStringify } from "../../internal/_test_isStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createIsStringify_AtomicIntersection = _test_isStringify( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createIsStringify(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createIsStringify/test_createIsStringify_ConstantIntersection.ts b/test/features/createIsStringify/test_createIsStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..40d4ee5328 --- /dev/null +++ b/test/features/createIsStringify/test_createIsStringify_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isStringify } from "../../internal/_test_isStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createIsStringify_ConstantIntersection = _test_isStringify( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createIsStringify(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createPrune/test_createPrune_AtomicIntersection.ts b/test/features/createPrune/test_createPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..7774600354 --- /dev/null +++ b/test/features/createPrune/test_createPrune_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_prune } from "../../internal/_test_prune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createPrune_AtomicIntersection = _test_prune( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createPrune(), +); diff --git a/test/features/createPrune/test_createPrune_ConstantIntersection.ts b/test/features/createPrune/test_createPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..7dca9cd6b5 --- /dev/null +++ b/test/features/createPrune/test_createPrune_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_prune } from "../../internal/_test_prune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createPrune_ConstantIntersection = _test_prune( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createPrune(), +); diff --git a/test/features/createRandom/test_createRandom_AtomicIntersection.ts b/test/features/createRandom/test_createRandom_AtomicIntersection.ts new file mode 100644 index 0000000000..6479e439b2 --- /dev/null +++ b/test/features/createRandom/test_createRandom_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_random } from "../../internal/_test_random"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createRandom_AtomicIntersection = _test_random( + "AtomicIntersection", + typia.createRandom(), + typia.createAssert>(), +); diff --git a/test/features/createRandom/test_createRandom_ConstantIntersection.ts b/test/features/createRandom/test_createRandom_ConstantIntersection.ts new file mode 100644 index 0000000000..3c7c2bdaa6 --- /dev/null +++ b/test/features/createRandom/test_createRandom_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_random } from "../../internal/_test_random"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createRandom_ConstantIntersection = _test_random( + "ConstantIntersection", + typia.createRandom(), + typia.createAssert>(), +); diff --git a/test/features/createStringify/test_createStringify_AtomicIntersection.ts b/test/features/createStringify/test_createStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..e043ad9107 --- /dev/null +++ b/test/features/createStringify/test_createStringify_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_stringify } from "../../internal/_test_stringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createStringify_AtomicIntersection = _test_stringify( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createStringify(), +); diff --git a/test/features/createStringify/test_createStringify_ConstantIntersection.ts b/test/features/createStringify/test_createStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..7e5a23c18b --- /dev/null +++ b/test/features/createStringify/test_createStringify_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_stringify } from "../../internal/_test_stringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createStringify_ConstantIntersection = _test_stringify( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createStringify(), +); diff --git a/test/features/createValidate/test_createValidate_AtomicIntersection.ts b/test/features/createValidate/test_createValidate_AtomicIntersection.ts new file mode 100644 index 0000000000..cd754bba3a --- /dev/null +++ b/test/features/createValidate/test_createValidate_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validate } from "../../internal/_test_validate"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidate_AtomicIntersection = _test_validate( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidate(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createValidate/test_createValidate_ConstantIntersection.ts b/test/features/createValidate/test_createValidate_ConstantIntersection.ts new file mode 100644 index 0000000000..88c46f9b1a --- /dev/null +++ b/test/features/createValidate/test_createValidate_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validate } from "../../internal/_test_validate"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidate_ConstantIntersection = _test_validate( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidate(), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/createValidateClone/test_createValidateClone_AtomicIntersection.ts b/test/features/createValidateClone/test_createValidateClone_AtomicIntersection.ts new file mode 100644 index 0000000000..4dd326b667 --- /dev/null +++ b/test/features/createValidateClone/test_createValidateClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateClone } from "../../internal/_test_validateClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidateClone_AtomicIntersection = _test_validateClone( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidateClone(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createValidateClone/test_createValidateClone_ConstantIntersection.ts b/test/features/createValidateClone/test_createValidateClone_ConstantIntersection.ts new file mode 100644 index 0000000000..c1524a65b7 --- /dev/null +++ b/test/features/createValidateClone/test_createValidateClone_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateClone } from "../../internal/_test_validateClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidateClone_ConstantIntersection = + _test_validateClone( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidateClone(), + ConstantIntersection.SPOILERS, + ); diff --git a/test/features/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts b/test/features/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..649f9a25cd --- /dev/null +++ b/test/features/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateEquals } from "../../internal/_test_validateEquals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidateEquals_AtomicIntersection = + _test_validateEquals( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidateEquals(), + ); diff --git a/test/features/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts b/test/features/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..fe8efb615d --- /dev/null +++ b/test/features/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateEquals } from "../../internal/_test_validateEquals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidateEquals_ConstantIntersection = + _test_validateEquals( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidateEquals(), + ); diff --git a/test/features/createValidateParse/test_createValidateParse_AtomicIntersection.ts b/test/features/createValidateParse/test_createValidateParse_AtomicIntersection.ts new file mode 100644 index 0000000000..8a60ce032e --- /dev/null +++ b/test/features/createValidateParse/test_createValidateParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateParse } from "../../internal/_test_validateParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidateParse_AtomicIntersection = _test_validateParse( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidateParse(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createValidateParse/test_createValidateParse_ConstantIntersection.ts b/test/features/createValidateParse/test_createValidateParse_ConstantIntersection.ts new file mode 100644 index 0000000000..36cc2398ab --- /dev/null +++ b/test/features/createValidateParse/test_createValidateParse_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateParse } from "../../internal/_test_validateParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidateParse_ConstantIntersection = + _test_validateParse( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidateParse(), + ConstantIntersection.SPOILERS, + ); diff --git a/test/features/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts b/test/features/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts new file mode 100644 index 0000000000..92bd1a96f0 --- /dev/null +++ b/test/features/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validatePrune } from "../../internal/_test_validatePrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidatePrune_AtomicIntersection = _test_validatePrune( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidatePrune(), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts b/test/features/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts new file mode 100644 index 0000000000..d4397448d2 --- /dev/null +++ b/test/features/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validatePrune } from "../../internal/_test_validatePrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidatePrune_ConstantIntersection = + _test_validatePrune( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidatePrune(), + ConstantIntersection.SPOILERS, + ); diff --git a/test/features/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts b/test/features/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..17a41ad052 --- /dev/null +++ b/test/features/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateStringify } from "../../internal/_test_validateStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_createValidateStringify_AtomicIntersection = + _test_validateStringify( + "AtomicIntersection", + AtomicIntersection.generate, + typia.createValidateStringify(), + AtomicIntersection.SPOILERS, + ); diff --git a/test/features/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts b/test/features/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..dd4fffd1a6 --- /dev/null +++ b/test/features/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateStringify } from "../../internal/_test_validateStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_createValidateStringify_ConstantIntersection = + _test_validateStringify( + "ConstantIntersection", + ConstantIntersection.generate, + typia.createValidateStringify(), + ConstantIntersection.SPOILERS, + ); diff --git a/test/features/equals/test_equals_AtomicIntersection.ts b/test/features/equals/test_equals_AtomicIntersection.ts new file mode 100644 index 0000000000..063ed57368 --- /dev/null +++ b/test/features/equals/test_equals_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_equals } from "../../internal/_test_equals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_equals_AtomicIntersection = _test_equals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.equals(input), +); diff --git a/test/features/equals/test_equals_ConstantIntersection.ts b/test/features/equals/test_equals_ConstantIntersection.ts new file mode 100644 index 0000000000..60473b7470 --- /dev/null +++ b/test/features/equals/test_equals_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_equals } from "../../internal/_test_equals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_equals_ConstantIntersection = _test_equals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.equals(input), +); diff --git a/test/features/is/test_is_AtomicIntersection.ts b/test/features/is/test_is_AtomicIntersection.ts new file mode 100644 index 0000000000..4a7aacd434 --- /dev/null +++ b/test/features/is/test_is_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_is } from "../../internal/_test_is"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_is_AtomicIntersection = _test_is( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.is(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/is/test_is_ConstantIntersection.ts b/test/features/is/test_is_ConstantIntersection.ts new file mode 100644 index 0000000000..d3766a111c --- /dev/null +++ b/test/features/is/test_is_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_is } from "../../internal/_test_is"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_is_ConstantIntersection = _test_is( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.is(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/isClone/test_isClone_AtomicIntersection.ts b/test/features/isClone/test_isClone_AtomicIntersection.ts new file mode 100644 index 0000000000..cf27a3e14d --- /dev/null +++ b/test/features/isClone/test_isClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isClone } from "../../internal/_test_isClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_isClone_AtomicIntersection = _test_isClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.isClone(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/isClone/test_isClone_ConstantIntersection.ts b/test/features/isClone/test_isClone_ConstantIntersection.ts new file mode 100644 index 0000000000..f8d65968b1 --- /dev/null +++ b/test/features/isClone/test_isClone_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isClone } from "../../internal/_test_isClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_isClone_ConstantIntersection = _test_isClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.isClone(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/isParse/test_isParse_AtomicIntersection.ts b/test/features/isParse/test_isParse_AtomicIntersection.ts new file mode 100644 index 0000000000..af1d802eac --- /dev/null +++ b/test/features/isParse/test_isParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isParse } from "../../internal/_test_isParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_isParse_AtomicIntersection = _test_isParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.isParse(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/isParse/test_isParse_ConstantIntersection.ts b/test/features/isParse/test_isParse_ConstantIntersection.ts new file mode 100644 index 0000000000..8630af3f7b --- /dev/null +++ b/test/features/isParse/test_isParse_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isParse } from "../../internal/_test_isParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_isParse_ConstantIntersection = _test_isParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.isParse(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/isPrune/test_isPrune_AtomicIntersection.ts b/test/features/isPrune/test_isPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..db8e49c287 --- /dev/null +++ b/test/features/isPrune/test_isPrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isPrune } from "../../internal/_test_isPrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_isPrune_AtomicIntersection = _test_isPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.isPrune(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/isPrune/test_isPrune_ConstantIntersection.ts b/test/features/isPrune/test_isPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..d125b2ffcb --- /dev/null +++ b/test/features/isPrune/test_isPrune_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isPrune } from "../../internal/_test_isPrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_isPrune_ConstantIntersection = _test_isPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.isPrune(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/isStringify/test_isStringify_AtomicIntersection.ts b/test/features/isStringify/test_isStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..91ed72722b --- /dev/null +++ b/test/features/isStringify/test_isStringify_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isStringify } from "../../internal/_test_isStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_isStringify_AtomicIntersection = _test_isStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.isStringify(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/isStringify/test_isStringify_ConstantIntersection.ts b/test/features/isStringify/test_isStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..7edd22477d --- /dev/null +++ b/test/features/isStringify/test_isStringify_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_isStringify } from "../../internal/_test_isStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_isStringify_ConstantIntersection = _test_isStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.isStringify(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/prune/test_prune_AtomicIntersection.ts b/test/features/prune/test_prune_AtomicIntersection.ts new file mode 100644 index 0000000000..468659c59d --- /dev/null +++ b/test/features/prune/test_prune_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_prune } from "../../internal/_test_prune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_prune_AtomicIntersection = _test_prune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.prune(input), +); diff --git a/test/features/prune/test_prune_ConstantIntersection.ts b/test/features/prune/test_prune_ConstantIntersection.ts new file mode 100644 index 0000000000..851df0b5fa --- /dev/null +++ b/test/features/prune/test_prune_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_prune } from "../../internal/_test_prune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_prune_ConstantIntersection = _test_prune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.prune(input), +); diff --git a/test/features/random/test_random_AtomicIntersection.ts b/test/features/random/test_random_AtomicIntersection.ts new file mode 100644 index 0000000000..12fcc84213 --- /dev/null +++ b/test/features/random/test_random_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_random } from "../../internal/_test_random"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_random_AtomicIntersection = _test_random( + "AtomicIntersection", + () => typia.random(), + typia.createAssert>(), +); diff --git a/test/features/random/test_random_ConstantIntersection.ts b/test/features/random/test_random_ConstantIntersection.ts new file mode 100644 index 0000000000..61370ab5af --- /dev/null +++ b/test/features/random/test_random_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_random } from "../../internal/_test_random"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_random_ConstantIntersection = _test_random( + "ConstantIntersection", + () => typia.random(), + typia.createAssert>(), +); diff --git a/test/features/stringify/test_stringify_AtomicIntersection.ts b/test/features/stringify/test_stringify_AtomicIntersection.ts new file mode 100644 index 0000000000..c8d96b8555 --- /dev/null +++ b/test/features/stringify/test_stringify_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_stringify } from "../../internal/_test_stringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_stringify_AtomicIntersection = _test_stringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.stringify(input), +); diff --git a/test/features/stringify/test_stringify_ConstantIntersection.ts b/test/features/stringify/test_stringify_ConstantIntersection.ts new file mode 100644 index 0000000000..f3291d2d04 --- /dev/null +++ b/test/features/stringify/test_stringify_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_stringify } from "../../internal/_test_stringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_stringify_ConstantIntersection = _test_stringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.stringify(input), +); diff --git a/test/features/validate/test_validate_AtomicIntersection.ts b/test/features/validate/test_validate_AtomicIntersection.ts new file mode 100644 index 0000000000..fb34ff8a83 --- /dev/null +++ b/test/features/validate/test_validate_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validate } from "../../internal/_test_validate"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validate_AtomicIntersection = _test_validate( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validate(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/validate/test_validate_ConstantIntersection.ts b/test/features/validate/test_validate_ConstantIntersection.ts new file mode 100644 index 0000000000..a6ae1c18e7 --- /dev/null +++ b/test/features/validate/test_validate_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validate } from "../../internal/_test_validate"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validate_ConstantIntersection = _test_validate( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validate(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/validateClone/test_validateClone_AtomicIntersection.ts b/test/features/validateClone/test_validateClone_AtomicIntersection.ts new file mode 100644 index 0000000000..a892c59942 --- /dev/null +++ b/test/features/validateClone/test_validateClone_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateClone } from "../../internal/_test_validateClone"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validateClone_AtomicIntersection = _test_validateClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validateClone(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/validateClone/test_validateClone_ConstantIntersection.ts b/test/features/validateClone/test_validateClone_ConstantIntersection.ts new file mode 100644 index 0000000000..7bcc9d07db --- /dev/null +++ b/test/features/validateClone/test_validateClone_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateClone } from "../../internal/_test_validateClone"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validateClone_ConstantIntersection = _test_validateClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validateClone(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/validateEquals/test_validateEquals_AtomicIntersection.ts b/test/features/validateEquals/test_validateEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..068539aa10 --- /dev/null +++ b/test/features/validateEquals/test_validateEquals_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_validateEquals } from "../../internal/_test_validateEquals"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validateEquals_AtomicIntersection = _test_validateEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validateEquals(input), +); diff --git a/test/features/validateEquals/test_validateEquals_ConstantIntersection.ts b/test/features/validateEquals/test_validateEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..95b26f0986 --- /dev/null +++ b/test/features/validateEquals/test_validateEquals_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../src"; +import { _test_validateEquals } from "../../internal/_test_validateEquals"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validateEquals_ConstantIntersection = _test_validateEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validateEquals(input), +); diff --git a/test/features/validateParse/test_validateParse_AtomicIntersection.ts b/test/features/validateParse/test_validateParse_AtomicIntersection.ts new file mode 100644 index 0000000000..56894354b0 --- /dev/null +++ b/test/features/validateParse/test_validateParse_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateParse } from "../../internal/_test_validateParse"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validateParse_AtomicIntersection = _test_validateParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validateParse(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/validateParse/test_validateParse_ConstantIntersection.ts b/test/features/validateParse/test_validateParse_ConstantIntersection.ts new file mode 100644 index 0000000000..dfda8f67cb --- /dev/null +++ b/test/features/validateParse/test_validateParse_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validateParse } from "../../internal/_test_validateParse"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validateParse_ConstantIntersection = _test_validateParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validateParse(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/validatePrune/test_validatePrune_AtomicIntersection.ts b/test/features/validatePrune/test_validatePrune_AtomicIntersection.ts new file mode 100644 index 0000000000..87baaf43c3 --- /dev/null +++ b/test/features/validatePrune/test_validatePrune_AtomicIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validatePrune } from "../../internal/_test_validatePrune"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validatePrune_AtomicIntersection = _test_validatePrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validatePrune(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/features/validatePrune/test_validatePrune_ConstantIntersection.ts b/test/features/validatePrune/test_validatePrune_ConstantIntersection.ts new file mode 100644 index 0000000000..6d8aab2c01 --- /dev/null +++ b/test/features/validatePrune/test_validatePrune_ConstantIntersection.ts @@ -0,0 +1,10 @@ +import typia from "../../../src"; +import { _test_validatePrune } from "../../internal/_test_validatePrune"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validatePrune_ConstantIntersection = _test_validatePrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validatePrune(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/features/validateStringify/test_validateStringify_AtomicIntersection.ts b/test/features/validateStringify/test_validateStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..ae5c5beaaf --- /dev/null +++ b/test/features/validateStringify/test_validateStringify_AtomicIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateStringify } from "../../internal/_test_validateStringify"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_validateStringify_AtomicIntersection = + _test_validateStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => typia.validateStringify(input), + AtomicIntersection.SPOILERS, + ); diff --git a/test/features/validateStringify/test_validateStringify_ConstantIntersection.ts b/test/features/validateStringify/test_validateStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..839c78ea1f --- /dev/null +++ b/test/features/validateStringify/test_validateStringify_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "../../../src"; +import { _test_validateStringify } from "../../internal/_test_validateStringify"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_validateStringify_ConstantIntersection = + _test_validateStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => typia.validateStringify(input), + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/application/ajv/test_application_ajv_AtomicIntersection.ts b/test/generated/output/application/ajv/test_application_ajv_AtomicIntersection.ts new file mode 100644 index 0000000000..ed783f508d --- /dev/null +++ b/test/generated/output/application/ajv/test_application_ajv_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "typia"; + +import { _test_application } from "../../../../internal/_test_application"; +import { AtomicIntersection } from "../../../../structures/AtomicIntersection"; + +export const test_application_ajv_AtomicIntersection = _test_application("ajv")( + "AtomicIntersection", + typia.application<[AtomicIntersection], "ajv">(), +); diff --git a/test/generated/output/application/ajv/test_application_ajv_ConstantIntersection.ts b/test/generated/output/application/ajv/test_application_ajv_ConstantIntersection.ts new file mode 100644 index 0000000000..e530f4a913 --- /dev/null +++ b/test/generated/output/application/ajv/test_application_ajv_ConstantIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_application } from "../../../../internal/_test_application"; +import { ConstantIntersection } from "../../../../structures/ConstantIntersection"; + +export const test_application_ajv_ConstantIntersection = _test_application( + "ajv", +)("ConstantIntersection", typia.application<[ConstantIntersection], "ajv">()); diff --git a/test/generated/output/application/swagger/test_application_swagger_AtomicIntersection.ts b/test/generated/output/application/swagger/test_application_swagger_AtomicIntersection.ts new file mode 100644 index 0000000000..2727d409b1 --- /dev/null +++ b/test/generated/output/application/swagger/test_application_swagger_AtomicIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_application } from "../../../../internal/_test_application"; +import { AtomicIntersection } from "../../../../structures/AtomicIntersection"; + +export const test_application_swagger_AtomicIntersection = _test_application( + "swagger", +)("AtomicIntersection", typia.application<[AtomicIntersection], "swagger">()); diff --git a/test/generated/output/application/swagger/test_application_swagger_ConstantIntersection.ts b/test/generated/output/application/swagger/test_application_swagger_ConstantIntersection.ts new file mode 100644 index 0000000000..bc3df21a92 --- /dev/null +++ b/test/generated/output/application/swagger/test_application_swagger_ConstantIntersection.ts @@ -0,0 +1,11 @@ +import typia from "typia"; + +import { _test_application } from "../../../../internal/_test_application"; +import { ConstantIntersection } from "../../../../structures/ConstantIntersection"; + +export const test_application_swagger_ConstantIntersection = _test_application( + "swagger", +)( + "ConstantIntersection", + typia.application<[ConstantIntersection], "swagger">(), +); diff --git a/test/generated/output/assert/test_assert_AtomicIntersection.ts b/test/generated/output/assert/test_assert_AtomicIntersection.ts new file mode 100644 index 0000000000..eedc3f25e0 --- /dev/null +++ b/test/generated/output/assert/test_assert_AtomicIntersection.ts @@ -0,0 +1,85 @@ +import typia from "../../../../src"; +import { _test_assert } from "../../../internal/_test_assert"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assert_AtomicIntersection = _test_assert( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const $guard = (typia.assert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/assert/test_assert_ConstantIntersection.ts b/test/generated/output/assert/test_assert_ConstantIntersection.ts new file mode 100644 index 0000000000..7cba98d6c3 --- /dev/null +++ b/test/generated/output/assert/test_assert_ConstantIntersection.ts @@ -0,0 +1,83 @@ +import typia from "../../../../src"; +import { _test_assert } from "../../../internal/_test_assert"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assert_ConstantIntersection = _test_assert( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const $guard = (typia.assert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/assertClone/test_assertClone_AtomicIntersection.ts b/test/generated/output/assertClone/test_assertClone_AtomicIntersection.ts new file mode 100644 index 0000000000..18cdbf1958 --- /dev/null +++ b/test/generated/output/assertClone/test_assertClone_AtomicIntersection.ts @@ -0,0 +1,123 @@ +import typia from "../../../../src"; +import { _test_assertClone } from "../../../internal/_test_assertClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assertClone_AtomicIntersection = _test_assertClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const assert = ( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const $guard = (typia.assertClone as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const clone = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + assert(input); + const output = clone(input); + return output; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/assertClone/test_assertClone_ConstantIntersection.ts b/test/generated/output/assertClone/test_assertClone_ConstantIntersection.ts new file mode 100644 index 0000000000..f7ba42d9c2 --- /dev/null +++ b/test/generated/output/assertClone/test_assertClone_ConstantIntersection.ts @@ -0,0 +1,121 @@ +import typia from "../../../../src"; +import { _test_assertClone } from "../../../internal/_test_assertClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assertClone_ConstantIntersection = _test_assertClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const assert = ( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const $guard = (typia.assertClone as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const clone = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + assert(input); + const output = clone(input); + return output; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/assertEquals/test_assertEquals_AtomicIntersection.ts b/test/generated/output/assertEquals/test_assertEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..21f50d8e69 --- /dev/null +++ b/test/generated/output/assertEquals/test_assertEquals_AtomicIntersection.ts @@ -0,0 +1,85 @@ +import typia from "../../../../src"; +import { _test_assertEquals } from "../../../internal/_test_assertEquals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assertEquals_AtomicIntersection = _test_assertEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const $guard = (typia.assertEquals as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + })(input), +); diff --git a/test/generated/output/assertEquals/test_assertEquals_ConstantIntersection.ts b/test/generated/output/assertEquals/test_assertEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..5c096d0227 --- /dev/null +++ b/test/generated/output/assertEquals/test_assertEquals_ConstantIntersection.ts @@ -0,0 +1,83 @@ +import typia from "../../../../src"; +import { _test_assertEquals } from "../../../internal/_test_assertEquals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assertEquals_ConstantIntersection = _test_assertEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const $guard = (typia.assertEquals as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + })(input), +); diff --git a/test/generated/output/assertParse/test_assertParse_AtomicIntersection.ts b/test/generated/output/assertParse/test_assertParse_AtomicIntersection.ts new file mode 100644 index 0000000000..d580acf1c0 --- /dev/null +++ b/test/generated/output/assertParse/test_assertParse_AtomicIntersection.ts @@ -0,0 +1,73 @@ +import typia from "../../../../src"; +import { _test_assertParse } from "../../../internal/_test_assertParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assertParse_AtomicIntersection = _test_assertParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + ((input: string): typia.Primitive => { + const assert = (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.assertParse as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + input = JSON.parse(input); + return assert(input) as any; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/assertParse/test_assertParse_ConstantIntersection.ts b/test/generated/output/assertParse/test_assertParse_ConstantIntersection.ts new file mode 100644 index 0000000000..fe5258797c --- /dev/null +++ b/test/generated/output/assertParse/test_assertParse_ConstantIntersection.ts @@ -0,0 +1,71 @@ +import typia from "../../../../src"; +import { _test_assertParse } from "../../../internal/_test_assertParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assertParse_ConstantIntersection = _test_assertParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + ((input: string): typia.Primitive => { + const assert = (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.assertParse as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + input = JSON.parse(input); + return assert(input) as any; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/assertPrune/test_assertPrune_AtomicIntersection.ts b/test/generated/output/assertPrune/test_assertPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..1aace61d61 --- /dev/null +++ b/test/generated/output/assertPrune/test_assertPrune_AtomicIntersection.ts @@ -0,0 +1,103 @@ +import typia from "../../../../src"; +import { _test_assertPrune } from "../../../internal/_test_assertPrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assertPrune_AtomicIntersection = _test_assertPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const assert = ( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const $guard = (typia.assertPrune as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const prune = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): void => {}; + assert(input); + prune(input); + return input; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/assertPrune/test_assertPrune_ConstantIntersection.ts b/test/generated/output/assertPrune/test_assertPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..e57c670c65 --- /dev/null +++ b/test/generated/output/assertPrune/test_assertPrune_ConstantIntersection.ts @@ -0,0 +1,101 @@ +import typia from "../../../../src"; +import { _test_assertPrune } from "../../../internal/_test_assertPrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assertPrune_ConstantIntersection = _test_assertPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const assert = ( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const $guard = (typia.assertPrune as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const prune = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): void => {}; + assert(input); + prune(input); + return input; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/assertStringify/test_assertStringify_AtomicIntersection.ts b/test/generated/output/assertStringify/test_assertStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..48fbff06d1 --- /dev/null +++ b/test/generated/output/assertStringify/test_assertStringify_AtomicIntersection.ts @@ -0,0 +1,101 @@ +import typia from "../../../../src"; +import { _test_assertStringify } from "../../../internal/_test_assertStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_assertStringify_AtomicIntersection = _test_assertStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + ((input: any): string => { + const assert = ( + input: any, + ): [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const $guard = (typia.assertStringify as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const stringify = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): string => { + const $number = (typia.assertStringify as any).number; + const $string = (typia.assertStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string( + input[2], + )}]`; + }; + return stringify(assert(input)); + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/assertStringify/test_assertStringify_ConstantIntersection.ts b/test/generated/output/assertStringify/test_assertStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..979fafa208 --- /dev/null +++ b/test/generated/output/assertStringify/test_assertStringify_ConstantIntersection.ts @@ -0,0 +1,106 @@ +import typia from "../../../../src"; +import { _test_assertStringify } from "../../../internal/_test_assertStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_assertStringify_ConstantIntersection = _test_assertStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + ((input: any): string => { + const assert = ( + input: any, + ): [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const $guard = (typia.assertStringify as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const stringify = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): string => { + const $number = (typia.assertStringify as any).number; + const $string = (typia.assertStringify as any).string; + const $throws = (typia.assertStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) + return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + return stringify(assert(input)); + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/clone/test_clone_AtomicIntersection.ts b/test/generated/output/clone/test_clone_AtomicIntersection.ts new file mode 100644 index 0000000000..34d5d0559f --- /dev/null +++ b/test/generated/output/clone/test_clone_AtomicIntersection.ts @@ -0,0 +1,30 @@ +import typia from "../../../../src"; +import { _test_clone } from "../../../internal/_test_clone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_clone_AtomicIntersection = _test_clone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + })(input), +); diff --git a/test/generated/output/clone/test_clone_ConstantIntersection.ts b/test/generated/output/clone/test_clone_ConstantIntersection.ts new file mode 100644 index 0000000000..0251a67afa --- /dev/null +++ b/test/generated/output/clone/test_clone_ConstantIntersection.ts @@ -0,0 +1,30 @@ +import typia from "../../../../src"; +import { _test_clone } from "../../../internal/_test_clone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_clone_ConstantIntersection = _test_clone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + })(input), +); diff --git a/test/generated/output/createAssert/test_createAssert_AtomicIntersection.ts b/test/generated/output/createAssert/test_createAssert_AtomicIntersection.ts new file mode 100644 index 0000000000..c04521b4eb --- /dev/null +++ b/test/generated/output/createAssert/test_createAssert_AtomicIntersection.ts @@ -0,0 +1,68 @@ +import typia from "../../../../src"; +import { _test_assert } from "../../../internal/_test_assert"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssert_AtomicIntersection = _test_assert( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssert/test_createAssert_ConstantIntersection.ts b/test/generated/output/createAssert/test_createAssert_ConstantIntersection.ts new file mode 100644 index 0000000000..2e6e6d4aa0 --- /dev/null +++ b/test/generated/output/createAssert/test_createAssert_ConstantIntersection.ts @@ -0,0 +1,66 @@ +import typia from "../../../../src"; +import { _test_assert } from "../../../internal/_test_assert"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssert_ConstantIntersection = _test_assert( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertClone/test_createAssertClone_AtomicIntersection.ts b/test/generated/output/createAssertClone/test_createAssertClone_AtomicIntersection.ts new file mode 100644 index 0000000000..14b44cb572 --- /dev/null +++ b/test/generated/output/createAssertClone/test_createAssertClone_AtomicIntersection.ts @@ -0,0 +1,84 @@ +import typia from "../../../../src"; +import { _test_assertClone } from "../../../internal/_test_assertClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssertClone_AtomicIntersection = _test_assertClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.Primitive => { + const assert = (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssertClone as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const clone = ( + input: AtomicIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }; + assert(input); + const output = clone(input); + return output; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertClone/test_createAssertClone_ConstantIntersection.ts b/test/generated/output/createAssertClone/test_createAssertClone_ConstantIntersection.ts new file mode 100644 index 0000000000..a27b9ac6c6 --- /dev/null +++ b/test/generated/output/createAssertClone/test_createAssertClone_ConstantIntersection.ts @@ -0,0 +1,82 @@ +import typia from "../../../../src"; +import { _test_assertClone } from "../../../internal/_test_assertClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssertClone_ConstantIntersection = _test_assertClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.Primitive => { + const assert = (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssertClone as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const clone = ( + input: ConstantIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }; + assert(input); + const output = clone(input); + return output; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts b/test/generated/output/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..9ef5c75532 --- /dev/null +++ b/test/generated/output/createAssertEquals/test_createAssertEquals_AtomicIntersection.ts @@ -0,0 +1,70 @@ +import typia from "../../../../src"; +import { _test_assertEquals } from "../../../internal/_test_assertEquals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssertEquals_AtomicIntersection = _test_assertEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): AtomicIntersection => { + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssertEquals as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts b/test/generated/output/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..41629624d2 --- /dev/null +++ b/test/generated/output/createAssertEquals/test_createAssertEquals_ConstantIntersection.ts @@ -0,0 +1,68 @@ +import typia from "../../../../src"; +import { _test_assertEquals } from "../../../internal/_test_assertEquals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssertEquals_ConstantIntersection = _test_assertEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): ConstantIntersection => { + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssertEquals as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/createAssertParse/test_createAssertParse_AtomicIntersection.ts b/test/generated/output/createAssertParse/test_createAssertParse_AtomicIntersection.ts new file mode 100644 index 0000000000..f23ac0ff3d --- /dev/null +++ b/test/generated/output/createAssertParse/test_createAssertParse_AtomicIntersection.ts @@ -0,0 +1,72 @@ +import typia from "../../../../src"; +import { _test_assertParse } from "../../../internal/_test_assertParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssertParse_AtomicIntersection = _test_assertParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input: string): typia.Primitive => { + const assert = (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssertParse as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + input = JSON.parse(input); + return assert(input) as any; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertParse/test_createAssertParse_ConstantIntersection.ts b/test/generated/output/createAssertParse/test_createAssertParse_ConstantIntersection.ts new file mode 100644 index 0000000000..302e425f1e --- /dev/null +++ b/test/generated/output/createAssertParse/test_createAssertParse_ConstantIntersection.ts @@ -0,0 +1,70 @@ +import typia from "../../../../src"; +import { _test_assertParse } from "../../../internal/_test_assertParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssertParse_ConstantIntersection = _test_assertParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input: string): typia.Primitive => { + const assert = (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssertParse as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + input = JSON.parse(input); + return assert(input) as any; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts b/test/generated/output/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..c15fee7ff8 --- /dev/null +++ b/test/generated/output/createAssertPrune/test_createAssertPrune_AtomicIntersection.ts @@ -0,0 +1,74 @@ +import typia from "../../../../src"; +import { _test_assertPrune } from "../../../internal/_test_assertPrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssertPrune_AtomicIntersection = _test_assertPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): AtomicIntersection => { + const assert = (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssertPrune as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const prune = (input: AtomicIntersection): void => {}; + assert(input); + prune(input); + return input; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts b/test/generated/output/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..12a67a9b84 --- /dev/null +++ b/test/generated/output/createAssertPrune/test_createAssertPrune_ConstantIntersection.ts @@ -0,0 +1,72 @@ +import typia from "../../../../src"; +import { _test_assertPrune } from "../../../internal/_test_assertPrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssertPrune_ConstantIntersection = _test_assertPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): ConstantIntersection => { + const assert = (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssertPrune as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const prune = (input: ConstantIntersection): void => {}; + assert(input); + prune(input); + return input; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts b/test/generated/output/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..db4ac199f6 --- /dev/null +++ b/test/generated/output/createAssertStringify/test_createAssertStringify_AtomicIntersection.ts @@ -0,0 +1,80 @@ +import typia from "../../../../src"; +import { _test_assertStringify } from "../../../internal/_test_assertStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createAssertStringify_AtomicIntersection = + _test_assertStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): string => { + const assert = (input: any): AtomicIntersection => { + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + const $guard = (typia.createAssertStringify as any) + .guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const stringify = (input: AtomicIntersection): string => { + const $number = (typia.createAssertStringify as any).number; + const $string = (typia.createAssertStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string( + input[2], + )}]`; + }; + return stringify(assert(input)); + }, + AtomicIntersection.SPOILERS, + ); diff --git a/test/generated/output/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts b/test/generated/output/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..65c5fe3d73 --- /dev/null +++ b/test/generated/output/createAssertStringify/test_createAssertStringify_ConstantIntersection.ts @@ -0,0 +1,85 @@ +import typia from "../../../../src"; +import { _test_assertStringify } from "../../../internal/_test_assertStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createAssertStringify_ConstantIntersection = + _test_assertStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): string => { + const assert = (input: any): ConstantIntersection => { + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + const $guard = (typia.createAssertStringify as any) + .guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }; + const stringify = (input: ConstantIntersection): string => { + const $number = (typia.createAssertStringify as any).number; + const $string = (typia.createAssertStringify as any).string; + const $throws = (typia.createAssertStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) + return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + return stringify(assert(input)); + }, + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/createClone/test_createClone_AtomicIntersection.ts b/test/generated/output/createClone/test_createClone_AtomicIntersection.ts new file mode 100644 index 0000000000..342270b88e --- /dev/null +++ b/test/generated/output/createClone/test_createClone_AtomicIntersection.ts @@ -0,0 +1,17 @@ +import typia from "../../../../src"; +import { _test_clone } from "../../../internal/_test_clone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createClone_AtomicIntersection = _test_clone( + "AtomicIntersection", + AtomicIntersection.generate, + (input: AtomicIntersection): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }, +); diff --git a/test/generated/output/createClone/test_createClone_ConstantIntersection.ts b/test/generated/output/createClone/test_createClone_ConstantIntersection.ts new file mode 100644 index 0000000000..0b6c0aab5a --- /dev/null +++ b/test/generated/output/createClone/test_createClone_ConstantIntersection.ts @@ -0,0 +1,17 @@ +import typia from "../../../../src"; +import { _test_clone } from "../../../internal/_test_clone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createClone_ConstantIntersection = _test_clone( + "ConstantIntersection", + ConstantIntersection.generate, + (input: ConstantIntersection): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }, +); diff --git a/test/generated/output/createEquals/test_createEquals_AtomicIntersection.ts b/test/generated/output/createEquals/test_createEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..a83ac966c4 --- /dev/null +++ b/test/generated/output/createEquals/test_createEquals_AtomicIntersection.ts @@ -0,0 +1,21 @@ +import typia from "../../../../src"; +import { _test_equals } from "../../../internal/_test_equals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createEquals_AtomicIntersection = _test_equals( + "AtomicIntersection", + AtomicIntersection.generate, + ( + input: any, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }, +); diff --git a/test/generated/output/createEquals/test_createEquals_ConstantIntersection.ts b/test/generated/output/createEquals/test_createEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..56bfddc689 --- /dev/null +++ b/test/generated/output/createEquals/test_createEquals_ConstantIntersection.ts @@ -0,0 +1,20 @@ +import typia from "../../../../src"; +import { _test_equals } from "../../../internal/_test_equals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createEquals_ConstantIntersection = _test_equals( + "ConstantIntersection", + ConstantIntersection.generate, + ( + input: any, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }, +); diff --git a/test/generated/output/createIs/test_createIs_AtomicIntersection.ts b/test/generated/output/createIs/test_createIs_AtomicIntersection.ts new file mode 100644 index 0000000000..95eb245b73 --- /dev/null +++ b/test/generated/output/createIs/test_createIs_AtomicIntersection.ts @@ -0,0 +1,19 @@ +import typia from "../../../../src"; +import { _test_is } from "../../../internal/_test_is"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createIs_AtomicIntersection = _test_is( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createIs/test_createIs_ConstantIntersection.ts b/test/generated/output/createIs/test_createIs_ConstantIntersection.ts new file mode 100644 index 0000000000..e24d6659b6 --- /dev/null +++ b/test/generated/output/createIs/test_createIs_ConstantIntersection.ts @@ -0,0 +1,18 @@ +import typia from "../../../../src"; +import { _test_is } from "../../../internal/_test_is"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createIs_ConstantIntersection = _test_is( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsClone/test_createIsClone_AtomicIntersection.ts b/test/generated/output/createIsClone/test_createIsClone_AtomicIntersection.ts new file mode 100644 index 0000000000..c2d91418e6 --- /dev/null +++ b/test/generated/output/createIsClone/test_createIsClone_AtomicIntersection.ts @@ -0,0 +1,35 @@ +import typia from "../../../../src"; +import { _test_isClone } from "../../../internal/_test_isClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createIsClone_AtomicIntersection = _test_isClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.Primitive | null => { + const is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const clone = ( + input: AtomicIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }; + if (!is(input)) return null; + const output = clone(input); + return output; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsClone/test_createIsClone_ConstantIntersection.ts b/test/generated/output/createIsClone/test_createIsClone_ConstantIntersection.ts new file mode 100644 index 0000000000..afb6ea6dbc --- /dev/null +++ b/test/generated/output/createIsClone/test_createIsClone_ConstantIntersection.ts @@ -0,0 +1,34 @@ +import typia from "../../../../src"; +import { _test_isClone } from "../../../internal/_test_isClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createIsClone_ConstantIntersection = _test_isClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.Primitive | null => { + const is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const clone = ( + input: ConstantIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }; + if (!is(input)) return null; + const output = clone(input); + return output; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsParse/test_createIsParse_AtomicIntersection.ts b/test/generated/output/createIsParse/test_createIsParse_AtomicIntersection.ts new file mode 100644 index 0000000000..26db442ce4 --- /dev/null +++ b/test/generated/output/createIsParse/test_createIsParse_AtomicIntersection.ts @@ -0,0 +1,23 @@ +import typia from "../../../../src"; +import { _test_isParse } from "../../../internal/_test_isParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createIsParse_AtomicIntersection = _test_isParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.Primitive => { + const is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + input = JSON.parse(input); + return is(input) ? (input as any) : null; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsParse/test_createIsParse_ConstantIntersection.ts b/test/generated/output/createIsParse/test_createIsParse_ConstantIntersection.ts new file mode 100644 index 0000000000..e2f0ff62b6 --- /dev/null +++ b/test/generated/output/createIsParse/test_createIsParse_ConstantIntersection.ts @@ -0,0 +1,22 @@ +import typia from "../../../../src"; +import { _test_isParse } from "../../../internal/_test_isParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createIsParse_ConstantIntersection = _test_isParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.Primitive => { + const is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + input = JSON.parse(input); + return is(input) ? (input as any) : null; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsPrune/test_createIsPrune_AtomicIntersection.ts b/test/generated/output/createIsPrune/test_createIsPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..dff3cbaff9 --- /dev/null +++ b/test/generated/output/createIsPrune/test_createIsPrune_AtomicIntersection.ts @@ -0,0 +1,25 @@ +import typia from "../../../../src"; +import { _test_isPrune } from "../../../internal/_test_isPrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createIsPrune_AtomicIntersection = _test_isPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): input is AtomicIntersection => { + const is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const prune = (input: AtomicIntersection): void => {}; + if (!is(input)) return false; + prune(input); + return true; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsPrune/test_createIsPrune_ConstantIntersection.ts b/test/generated/output/createIsPrune/test_createIsPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..872a7a0882 --- /dev/null +++ b/test/generated/output/createIsPrune/test_createIsPrune_ConstantIntersection.ts @@ -0,0 +1,24 @@ +import typia from "../../../../src"; +import { _test_isPrune } from "../../../internal/_test_isPrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createIsPrune_ConstantIntersection = _test_isPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): input is ConstantIntersection => { + const is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const prune = (input: ConstantIntersection): void => {}; + if (!is(input)) return false; + prune(input); + return true; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsStringify/test_createIsStringify_AtomicIntersection.ts b/test/generated/output/createIsStringify/test_createIsStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..a413ea32b1 --- /dev/null +++ b/test/generated/output/createIsStringify/test_createIsStringify_AtomicIntersection.ts @@ -0,0 +1,27 @@ +import typia from "../../../../src"; +import { _test_isStringify } from "../../../internal/_test_isStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createIsStringify_AtomicIntersection = _test_isStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input: AtomicIntersection): string | null => { + const is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const stringify = (input: AtomicIntersection): string => { + const $number = (typia.createIsStringify as any).number; + const $string = (typia.createIsStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string(input[2])}]`; + }; + return is(input) ? stringify(input) : null; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createIsStringify/test_createIsStringify_ConstantIntersection.ts b/test/generated/output/createIsStringify/test_createIsStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..943574b723 --- /dev/null +++ b/test/generated/output/createIsStringify/test_createIsStringify_ConstantIntersection.ts @@ -0,0 +1,34 @@ +import typia from "../../../../src"; +import { _test_isStringify } from "../../../internal/_test_isStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createIsStringify_ConstantIntersection = _test_isStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input: ConstantIntersection): string | null => { + const is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const stringify = (input: ConstantIntersection): string => { + const $number = (typia.createIsStringify as any).number; + const $string = (typia.createIsStringify as any).string; + const $throws = (typia.createIsStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + return is(input) ? stringify(input) : null; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createPrune/test_createPrune_AtomicIntersection.ts b/test/generated/output/createPrune/test_createPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..ce4fe6dc80 --- /dev/null +++ b/test/generated/output/createPrune/test_createPrune_AtomicIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../../src"; +import { _test_prune } from "../../../internal/_test_prune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createPrune_AtomicIntersection = _test_prune( + "AtomicIntersection", + AtomicIntersection.generate, + (input: AtomicIntersection): void => {}, +); diff --git a/test/generated/output/createPrune/test_createPrune_ConstantIntersection.ts b/test/generated/output/createPrune/test_createPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..651e98a423 --- /dev/null +++ b/test/generated/output/createPrune/test_createPrune_ConstantIntersection.ts @@ -0,0 +1,9 @@ +import typia from "../../../../src"; +import { _test_prune } from "../../../internal/_test_prune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createPrune_ConstantIntersection = _test_prune( + "ConstantIntersection", + ConstantIntersection.generate, + (input: ConstantIntersection): void => {}, +); diff --git a/test/generated/output/createRandom/test_createRandom_AtomicIntersection.ts b/test/generated/output/createRandom/test_createRandom_AtomicIntersection.ts new file mode 100644 index 0000000000..f533d0715a --- /dev/null +++ b/test/generated/output/createRandom/test_createRandom_AtomicIntersection.ts @@ -0,0 +1,80 @@ +import typia from "../../../../src"; +import { _test_random } from "../../../internal/_test_random"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createRandom_AtomicIntersection = _test_random( + "AtomicIntersection", + ( + generator?: Partial, + ): typia.Primitive => { + const $generator = (typia.createRandom as any).generator; + return [ + (generator?.boolean ?? $generator.boolean)(), + (generator?.customs ?? $generator.customs)?.number?.([]) ?? + (generator?.number ?? $generator.number)(0, 100), + (generator?.customs ?? $generator.customs)?.string?.([]) ?? + (generator?.string ?? $generator.string)(), + ]; + }, + (input: any): typia.Primitive => { + const __is = ( + input: any, + ): input is typia.Primitive => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is typia.Primitive => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/createRandom/test_createRandom_ConstantIntersection.ts b/test/generated/output/createRandom/test_createRandom_ConstantIntersection.ts new file mode 100644 index 0000000000..7d1acf1ecc --- /dev/null +++ b/test/generated/output/createRandom/test_createRandom_ConstantIntersection.ts @@ -0,0 +1,71 @@ +import typia from "../../../../src"; +import { _test_random } from "../../../internal/_test_random"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createRandom_ConstantIntersection = _test_random( + "ConstantIntersection", + ( + generator?: Partial, + ): typia.Primitive => { + return [false, 1, "two"]; + }, + (input: any): typia.Primitive => { + const __is = ( + input: any, + ): input is typia.Primitive => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is typia.Primitive => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/createStringify/test_createStringify_AtomicIntersection.ts b/test/generated/output/createStringify/test_createStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..d05c79c590 --- /dev/null +++ b/test/generated/output/createStringify/test_createStringify_AtomicIntersection.ts @@ -0,0 +1,13 @@ +import typia from "../../../../src"; +import { _test_stringify } from "../../../internal/_test_stringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createStringify_AtomicIntersection = _test_stringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input: AtomicIntersection): string => { + const $number = (typia.createStringify as any).number; + const $string = (typia.createStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string(input[2])}]`; + }, +); diff --git a/test/generated/output/createStringify/test_createStringify_ConstantIntersection.ts b/test/generated/output/createStringify/test_createStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..687b35991f --- /dev/null +++ b/test/generated/output/createStringify/test_createStringify_ConstantIntersection.ts @@ -0,0 +1,21 @@ +import typia from "../../../../src"; +import { _test_stringify } from "../../../internal/_test_stringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createStringify_ConstantIntersection = _test_stringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input: ConstantIntersection): string => { + const $number = (typia.createStringify as any).number; + const $string = (typia.createStringify as any).string; + const $throws = (typia.createStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }, +); diff --git a/test/generated/output/createValidate/test_createValidate_AtomicIntersection.ts b/test/generated/output/createValidate/test_createValidate_AtomicIntersection.ts new file mode 100644 index 0000000000..cef2e76883 --- /dev/null +++ b/test/generated/output/createValidate/test_createValidate_AtomicIntersection.ts @@ -0,0 +1,76 @@ +import typia from "../../../../src"; +import { _test_validate } from "../../../internal/_test_validate"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidate_AtomicIntersection = _test_validate( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidate as any).report(errors); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createValidate/test_createValidate_ConstantIntersection.ts b/test/generated/output/createValidate/test_createValidate_ConstantIntersection.ts new file mode 100644 index 0000000000..5810039049 --- /dev/null +++ b/test/generated/output/createValidate/test_createValidate_ConstantIntersection.ts @@ -0,0 +1,74 @@ +import typia from "../../../../src"; +import { _test_validate } from "../../../internal/_test_validate"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidate_ConstantIntersection = _test_validate( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidate as any).report(errors); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }, + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/createValidateClone/test_createValidateClone_AtomicIntersection.ts b/test/generated/output/createValidateClone/test_createValidateClone_AtomicIntersection.ts new file mode 100644 index 0000000000..2bb843b395 --- /dev/null +++ b/test/generated/output/createValidateClone/test_createValidateClone_AtomicIntersection.ts @@ -0,0 +1,94 @@ +import typia from "../../../../src"; +import { _test_validateClone } from "../../../internal/_test_validateClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidateClone_AtomicIntersection = _test_validateClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateClone as any).report(errors); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const clone = ( + input: AtomicIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([input[0] as any, input[1] as any, input[2] as any] as any) + : (input as any); + }; + const output = validate(input) as any; + if (output.success) output.data = clone(input); + return output; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createValidateClone/test_createValidateClone_ConstantIntersection.ts b/test/generated/output/createValidateClone/test_createValidateClone_ConstantIntersection.ts new file mode 100644 index 0000000000..eb92b78a42 --- /dev/null +++ b/test/generated/output/createValidateClone/test_createValidateClone_ConstantIntersection.ts @@ -0,0 +1,101 @@ +import typia from "../../../../src"; +import { _test_validateClone } from "../../../internal/_test_validateClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidateClone_ConstantIntersection = + _test_validateClone( + "ConstantIntersection", + ConstantIntersection.generate, + ( + input: any, + ): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateClone as any).report( + errors, + ); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const clone = ( + input: ConstantIntersection, + ): typia.Primitive => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + const output = validate(input) as any; + if (output.success) output.data = clone(input); + return output; + }, + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts b/test/generated/output/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..e6b4a169c5 --- /dev/null +++ b/test/generated/output/createValidateEquals/test_createValidateEquals_AtomicIntersection.ts @@ -0,0 +1,79 @@ +import typia from "../../../../src"; +import { _test_validateEquals } from "../../../internal/_test_validateEquals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidateEquals_AtomicIntersection = + _test_validateEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateEquals as any).report(errors); + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }, + ); diff --git a/test/generated/output/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts b/test/generated/output/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..abba0c378b --- /dev/null +++ b/test/generated/output/createValidateEquals/test_createValidateEquals_ConstantIntersection.ts @@ -0,0 +1,77 @@ +import typia from "../../../../src"; +import { _test_validateEquals } from "../../../internal/_test_validateEquals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidateEquals_ConstantIntersection = + _test_validateEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateEquals as any).report(errors); + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }, + ); diff --git a/test/generated/output/createValidateParse/test_createValidateParse_AtomicIntersection.ts b/test/generated/output/createValidateParse/test_createValidateParse_AtomicIntersection.ts new file mode 100644 index 0000000000..7c05f81298 --- /dev/null +++ b/test/generated/output/createValidateParse/test_createValidateParse_AtomicIntersection.ts @@ -0,0 +1,83 @@ +import typia from "../../../../src"; +import { _test_validateParse } from "../../../internal/_test_validateParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidateParse_AtomicIntersection = _test_validateParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input: string): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateParse as any).report(errors); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + input = JSON.parse(input); + const output = validate(input); + return output as any; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createValidateParse/test_createValidateParse_ConstantIntersection.ts b/test/generated/output/createValidateParse/test_createValidateParse_ConstantIntersection.ts new file mode 100644 index 0000000000..9cd38e3c47 --- /dev/null +++ b/test/generated/output/createValidateParse/test_createValidateParse_ConstantIntersection.ts @@ -0,0 +1,86 @@ +import typia from "../../../../src"; +import { _test_validateParse } from "../../../internal/_test_validateParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidateParse_ConstantIntersection = + _test_validateParse( + "ConstantIntersection", + ConstantIntersection.generate, + ( + input: string, + ): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateParse as any).report( + errors, + ); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + input = JSON.parse(input); + const output = validate(input); + return output as any; + }, + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts b/test/generated/output/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts new file mode 100644 index 0000000000..827b364db0 --- /dev/null +++ b/test/generated/output/createValidatePrune/test_createValidatePrune_AtomicIntersection.ts @@ -0,0 +1,84 @@ +import typia from "../../../../src"; +import { _test_validatePrune } from "../../../internal/_test_validatePrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidatePrune_AtomicIntersection = _test_validatePrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input: any): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidatePrune as any).report(errors); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const prune = (input: AtomicIntersection): void => {}; + const output = validate(input); + if (output.success) prune(input); + return output; + }, + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts b/test/generated/output/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts new file mode 100644 index 0000000000..99b8655865 --- /dev/null +++ b/test/generated/output/createValidatePrune/test_createValidatePrune_ConstantIntersection.ts @@ -0,0 +1,85 @@ +import typia from "../../../../src"; +import { _test_validatePrune } from "../../../internal/_test_validatePrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidatePrune_ConstantIntersection = + _test_validatePrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input: any): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidatePrune as any).report( + errors, + ); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const prune = (input: ConstantIntersection): void => {}; + const output = validate(input); + if (output.success) prune(input); + return output; + }, + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts b/test/generated/output/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..df766500e9 --- /dev/null +++ b/test/generated/output/createValidateStringify/test_createValidateStringify_AtomicIntersection.ts @@ -0,0 +1,93 @@ +import typia from "../../../../src"; +import { _test_validateStringify } from "../../../internal/_test_validateStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_createValidateStringify_AtomicIntersection = + _test_validateStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input: AtomicIntersection): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateStringify as any).report( + errors, + ); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const stringify = (input: AtomicIntersection): string => { + const $number = (typia.createValidateStringify as any).number; + const $string = (typia.createValidateStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string( + input[2], + )}]`; + }; + const output = validate(input) as any; + if (output.success) output.data = stringify(input); + return output; + }, + AtomicIntersection.SPOILERS, + ); diff --git a/test/generated/output/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts b/test/generated/output/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..b9591d65b2 --- /dev/null +++ b/test/generated/output/createValidateStringify/test_createValidateStringify_ConstantIntersection.ts @@ -0,0 +1,98 @@ +import typia from "../../../../src"; +import { _test_validateStringify } from "../../../internal/_test_validateStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_createValidateStringify_ConstantIntersection = + _test_validateStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input: ConstantIntersection): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.createValidateStringify as any).report( + errors, + ); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const stringify = (input: ConstantIntersection): string => { + const $number = (typia.createValidateStringify as any).number; + const $string = (typia.createValidateStringify as any).string; + const $throws = (typia.createValidateStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) + return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + const output = validate(input) as any; + if (output.success) output.data = stringify(input); + return output; + }, + ConstantIntersection.SPOILERS, + ); diff --git a/test/generated/output/equals/test_equals_AtomicIntersection.ts b/test/generated/output/equals/test_equals_AtomicIntersection.ts new file mode 100644 index 0000000000..5367147e81 --- /dev/null +++ b/test/generated/output/equals/test_equals_AtomicIntersection.ts @@ -0,0 +1,26 @@ +import typia from "../../../../src"; +import { _test_equals } from "../../../internal/_test_equals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_equals_AtomicIntersection = _test_equals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + })(input), +); diff --git a/test/generated/output/equals/test_equals_ConstantIntersection.ts b/test/generated/output/equals/test_equals_ConstantIntersection.ts new file mode 100644 index 0000000000..472bef95c3 --- /dev/null +++ b/test/generated/output/equals/test_equals_ConstantIntersection.ts @@ -0,0 +1,25 @@ +import typia from "../../../../src"; +import { _test_equals } from "../../../internal/_test_equals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_equals_ConstantIntersection = _test_equals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + })(input), +); diff --git a/test/generated/output/is/test_is_AtomicIntersection.ts b/test/generated/output/is/test_is_AtomicIntersection.ts new file mode 100644 index 0000000000..2effa58b7e --- /dev/null +++ b/test/generated/output/is/test_is_AtomicIntersection.ts @@ -0,0 +1,26 @@ +import typia from "../../../../src"; +import { _test_is } from "../../../internal/_test_is"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_is_AtomicIntersection = _test_is( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/is/test_is_ConstantIntersection.ts b/test/generated/output/is/test_is_ConstantIntersection.ts new file mode 100644 index 0000000000..a07413af7b --- /dev/null +++ b/test/generated/output/is/test_is_ConstantIntersection.ts @@ -0,0 +1,25 @@ +import typia from "../../../../src"; +import { _test_is } from "../../../internal/_test_is"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_is_ConstantIntersection = _test_is( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/isClone/test_isClone_AtomicIntersection.ts b/test/generated/output/isClone/test_isClone_AtomicIntersection.ts new file mode 100644 index 0000000000..002862ddd6 --- /dev/null +++ b/test/generated/output/isClone/test_isClone_AtomicIntersection.ts @@ -0,0 +1,64 @@ +import typia from "../../../../src"; +import { _test_isClone } from "../../../internal/_test_isClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_isClone_AtomicIntersection = _test_isClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > | null => { + const is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const clone = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + if (!is(input)) return null; + const output = clone(input); + return output; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/isClone/test_isClone_ConstantIntersection.ts b/test/generated/output/isClone/test_isClone_ConstantIntersection.ts new file mode 100644 index 0000000000..2b780accc0 --- /dev/null +++ b/test/generated/output/isClone/test_isClone_ConstantIntersection.ts @@ -0,0 +1,63 @@ +import typia from "../../../../src"; +import { _test_isClone } from "../../../internal/_test_isClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_isClone_ConstantIntersection = _test_isClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > | null => { + const is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const clone = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + if (!is(input)) return null; + const output = clone(input); + return output; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/isParse/test_isParse_AtomicIntersection.ts b/test/generated/output/isParse/test_isParse_AtomicIntersection.ts new file mode 100644 index 0000000000..7ab561f25f --- /dev/null +++ b/test/generated/output/isParse/test_isParse_AtomicIntersection.ts @@ -0,0 +1,24 @@ +import typia from "../../../../src"; +import { _test_isParse } from "../../../internal/_test_isParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_isParse_AtomicIntersection = _test_isParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + ((input: any): typia.Primitive => { + const is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + input = JSON.parse(input); + return is(input) ? (input as any) : null; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/isParse/test_isParse_ConstantIntersection.ts b/test/generated/output/isParse/test_isParse_ConstantIntersection.ts new file mode 100644 index 0000000000..9f432210ed --- /dev/null +++ b/test/generated/output/isParse/test_isParse_ConstantIntersection.ts @@ -0,0 +1,23 @@ +import typia from "../../../../src"; +import { _test_isParse } from "../../../internal/_test_isParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_isParse_ConstantIntersection = _test_isParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + ((input: any): typia.Primitive => { + const is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + input = JSON.parse(input); + return is(input) ? (input as any) : null; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/isPrune/test_isPrune_AtomicIntersection.ts b/test/generated/output/isPrune/test_isPrune_AtomicIntersection.ts new file mode 100644 index 0000000000..e462c0e7d2 --- /dev/null +++ b/test/generated/output/isPrune/test_isPrune_AtomicIntersection.ts @@ -0,0 +1,44 @@ +import typia from "../../../../src"; +import { _test_isPrune } from "../../../internal/_test_isPrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_isPrune_AtomicIntersection = _test_isPrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + const is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const prune = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): void => {}; + if (!is(input)) return false; + prune(input); + return true; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/isPrune/test_isPrune_ConstantIntersection.ts b/test/generated/output/isPrune/test_isPrune_ConstantIntersection.ts new file mode 100644 index 0000000000..23838f2416 --- /dev/null +++ b/test/generated/output/isPrune/test_isPrune_ConstantIntersection.ts @@ -0,0 +1,43 @@ +import typia from "../../../../src"; +import { _test_isPrune } from "../../../internal/_test_isPrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_isPrune_ConstantIntersection = _test_isPrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + const is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const prune = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): void => {}; + if (!is(input)) return false; + prune(input); + return true; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/isStringify/test_isStringify_AtomicIntersection.ts b/test/generated/output/isStringify/test_isStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..3cf1190ebe --- /dev/null +++ b/test/generated/output/isStringify/test_isStringify_AtomicIntersection.ts @@ -0,0 +1,48 @@ +import typia from "../../../../src"; +import { _test_isStringify } from "../../../internal/_test_isStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_isStringify_AtomicIntersection = _test_isStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): string | null => { + const is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + const stringify = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): string => { + const $number = (typia.isStringify as any).number; + const $string = (typia.isStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string( + input[2], + )}]`; + }; + return is(input) ? stringify(input) : null; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/isStringify/test_isStringify_ConstantIntersection.ts b/test/generated/output/isStringify/test_isStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..5662a20861 --- /dev/null +++ b/test/generated/output/isStringify/test_isStringify_ConstantIntersection.ts @@ -0,0 +1,54 @@ +import typia from "../../../../src"; +import { _test_isStringify } from "../../../internal/_test_isStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_isStringify_ConstantIntersection = _test_isStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): string | null => { + const is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + const stringify = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): string => { + const $number = (typia.isStringify as any).number; + const $string = (typia.isStringify as any).string; + const $throws = (typia.isStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) + return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + return is(input) ? stringify(input) : null; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/prune/test_prune_AtomicIntersection.ts b/test/generated/output/prune/test_prune_AtomicIntersection.ts new file mode 100644 index 0000000000..42f3163d6d --- /dev/null +++ b/test/generated/output/prune/test_prune_AtomicIntersection.ts @@ -0,0 +1,16 @@ +import typia from "../../../../src"; +import { _test_prune } from "../../../internal/_test_prune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_prune_AtomicIntersection = _test_prune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): void => {})(input), +); diff --git a/test/generated/output/prune/test_prune_ConstantIntersection.ts b/test/generated/output/prune/test_prune_ConstantIntersection.ts new file mode 100644 index 0000000000..57dad55356 --- /dev/null +++ b/test/generated/output/prune/test_prune_ConstantIntersection.ts @@ -0,0 +1,16 @@ +import typia from "../../../../src"; +import { _test_prune } from "../../../internal/_test_prune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_prune_ConstantIntersection = _test_prune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): void => {})(input), +); diff --git a/test/generated/output/random/test_random_AtomicIntersection.ts b/test/generated/output/random/test_random_AtomicIntersection.ts new file mode 100644 index 0000000000..26ba3afaa2 --- /dev/null +++ b/test/generated/output/random/test_random_AtomicIntersection.ts @@ -0,0 +1,81 @@ +import typia from "../../../../src"; +import { _test_random } from "../../../internal/_test_random"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_random_AtomicIntersection = _test_random( + "AtomicIntersection", + () => + (( + generator?: Partial, + ): typia.Primitive => { + const $generator = (typia.random as any).generator; + return [ + (generator?.boolean ?? $generator.boolean)(), + (generator?.customs ?? $generator.customs)?.number?.([]) ?? + (generator?.number ?? $generator.number)(0, 100), + (generator?.customs ?? $generator.customs)?.string?.([]) ?? + (generator?.string ?? $generator.string)(), + ]; + })(), + (input: any): typia.Primitive => { + const __is = ( + input: any, + ): input is typia.Primitive => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is typia.Primitive => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + ("boolean" === typeof input[0] || + $guard(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + })) && + (("number" === typeof input[1] && + Number.isFinite(input[1])) || + $guard(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + })) && + ("string" === typeof input[2] || + $guard(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/random/test_random_ConstantIntersection.ts b/test/generated/output/random/test_random_ConstantIntersection.ts new file mode 100644 index 0000000000..a5c1583f27 --- /dev/null +++ b/test/generated/output/random/test_random_ConstantIntersection.ts @@ -0,0 +1,72 @@ +import typia from "../../../../src"; +import { _test_random } from "../../../internal/_test_random"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_random_ConstantIntersection = _test_random( + "ConstantIntersection", + () => + (( + generator?: Partial, + ): typia.Primitive => { + return [false, 1, "two"]; + })(), + (input: any): typia.Primitive => { + const __is = ( + input: any, + ): input is typia.Primitive => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is typia.Primitive => { + const $guard = (typia.createAssert as any).guard; + return ( + ((Array.isArray(input) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $guard(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + (false === input[0] || + $guard(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + })) && + (1 === input[1] || + $guard(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + })) && + ("two" === input[2] || + $guard(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }))) || + $guard(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + return input; + }, +); diff --git a/test/generated/output/stringify/test_stringify_AtomicIntersection.ts b/test/generated/output/stringify/test_stringify_AtomicIntersection.ts new file mode 100644 index 0000000000..d33c5b889d --- /dev/null +++ b/test/generated/output/stringify/test_stringify_AtomicIntersection.ts @@ -0,0 +1,20 @@ +import typia from "../../../../src"; +import { _test_stringify } from "../../../internal/_test_stringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_stringify_AtomicIntersection = _test_stringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): string => { + const $number = (typia.stringify as any).number; + const $string = (typia.stringify as any).string; + return `[${input[0]},${$number(input[1])},${$string(input[2])}]`; + })(input), +); diff --git a/test/generated/output/stringify/test_stringify_ConstantIntersection.ts b/test/generated/output/stringify/test_stringify_ConstantIntersection.ts new file mode 100644 index 0000000000..965358ecfe --- /dev/null +++ b/test/generated/output/stringify/test_stringify_ConstantIntersection.ts @@ -0,0 +1,28 @@ +import typia from "../../../../src"; +import { _test_stringify } from "../../../internal/_test_stringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_stringify_ConstantIntersection = _test_stringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): string => { + const $number = (typia.stringify as any).number; + const $string = (typia.stringify as any).string; + const $throws = (typia.stringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) return $string(input[2]); + if ("string" === typeof input[2]) return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + })(input), +); diff --git a/test/generated/output/validate/test_validate_AtomicIntersection.ts b/test/generated/output/validate/test_validate_AtomicIntersection.ts new file mode 100644 index 0000000000..a0e9e7087a --- /dev/null +++ b/test/generated/output/validate/test_validate_AtomicIntersection.ts @@ -0,0 +1,95 @@ +import typia from "../../../../src"; +import { _test_validate } from "../../../internal/_test_validate"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validate_AtomicIntersection = _test_validate( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validate as any).report(errors); + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/validate/test_validate_ConstantIntersection.ts b/test/generated/output/validate/test_validate_ConstantIntersection.ts new file mode 100644 index 0000000000..3cae20008d --- /dev/null +++ b/test/generated/output/validate/test_validate_ConstantIntersection.ts @@ -0,0 +1,93 @@ +import typia from "../../../../src"; +import { _test_validate } from "../../../internal/_test_validate"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validate_ConstantIntersection = _test_validate( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validate as any).report(errors); + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/validateClone/test_validateClone_AtomicIntersection.ts b/test/generated/output/validateClone/test_validateClone_AtomicIntersection.ts new file mode 100644 index 0000000000..3f2abe8161 --- /dev/null +++ b/test/generated/output/validateClone/test_validateClone_AtomicIntersection.ts @@ -0,0 +1,135 @@ +import typia from "../../../../src"; +import { _test_validateClone } from "../../../internal/_test_validateClone"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validateClone_AtomicIntersection = _test_validateClone( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > + > => { + const validate = ( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateClone as any).report(errors); + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const clone = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): typia.Primitive< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + "string" === typeof input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + const output = validate(input) as any; + if (output.success) output.data = clone(input); + return output; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/validateClone/test_validateClone_ConstantIntersection.ts b/test/generated/output/validateClone/test_validateClone_ConstantIntersection.ts new file mode 100644 index 0000000000..27c87c3892 --- /dev/null +++ b/test/generated/output/validateClone/test_validateClone_ConstantIntersection.ts @@ -0,0 +1,133 @@ +import typia from "../../../../src"; +import { _test_validateClone } from "../../../internal/_test_validateClone"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validateClone_ConstantIntersection = _test_validateClone( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > + > => { + const validate = ( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateClone as any).report(errors); + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const clone = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): typia.Primitive< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + return Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ? ([ + input[0] as any, + input[1] as any, + input[2] as any, + ] as any) + : (input as any); + }; + const output = validate(input) as any; + if (output.success) output.data = clone(input); + return output; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/validateEquals/test_validateEquals_AtomicIntersection.ts b/test/generated/output/validateEquals/test_validateEquals_AtomicIntersection.ts new file mode 100644 index 0000000000..67f5fd1376 --- /dev/null +++ b/test/generated/output/validateEquals/test_validateEquals_AtomicIntersection.ts @@ -0,0 +1,95 @@ +import typia from "../../../../src"; +import { _test_validateEquals } from "../../../internal/_test_validateEquals"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validateEquals_AtomicIntersection = _test_validateEquals( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateEquals as any).report(errors); + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + })(input), +); diff --git a/test/generated/output/validateEquals/test_validateEquals_ConstantIntersection.ts b/test/generated/output/validateEquals/test_validateEquals_ConstantIntersection.ts new file mode 100644 index 0000000000..34718dc51f --- /dev/null +++ b/test/generated/output/validateEquals/test_validateEquals_ConstantIntersection.ts @@ -0,0 +1,93 @@ +import typia from "../../../../src"; +import { _test_validateEquals } from "../../../internal/_test_validateEquals"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validateEquals_ConstantIntersection = _test_validateEquals( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateEquals as any).report(errors); + const __is = ( + input: any, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + })(input), +); diff --git a/test/generated/output/validateParse/test_validateParse_AtomicIntersection.ts b/test/generated/output/validateParse/test_validateParse_AtomicIntersection.ts new file mode 100644 index 0000000000..4281a78a91 --- /dev/null +++ b/test/generated/output/validateParse/test_validateParse_AtomicIntersection.ts @@ -0,0 +1,86 @@ +import typia from "../../../../src"; +import { _test_validateParse } from "../../../internal/_test_validateParse"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validateParse_AtomicIntersection = _test_validateParse( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: string, + ): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.validateParse as any).report(errors); + const __is = (input: any): input is AtomicIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is AtomicIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + input = JSON.parse(input); + const output = validate(input); + return output as any; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/validateParse/test_validateParse_ConstantIntersection.ts b/test/generated/output/validateParse/test_validateParse_ConstantIntersection.ts new file mode 100644 index 0000000000..a167654cfd --- /dev/null +++ b/test/generated/output/validateParse/test_validateParse_ConstantIntersection.ts @@ -0,0 +1,84 @@ +import typia from "../../../../src"; +import { _test_validateParse } from "../../../internal/_test_validateParse"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validateParse_ConstantIntersection = _test_validateParse( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: string, + ): typia.IValidation> => { + const validate = ( + input: any, + ): typia.IValidation => { + const errors = [] as any[]; + const $report = (typia.validateParse as any).report(errors); + const __is = (input: any): input is ConstantIntersection => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is ConstantIntersection => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + input = JSON.parse(input); + const output = validate(input); + return output as any; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/validatePrune/test_validatePrune_AtomicIntersection.ts b/test/generated/output/validatePrune/test_validatePrune_AtomicIntersection.ts new file mode 100644 index 0000000000..2e0b986096 --- /dev/null +++ b/test/generated/output/validatePrune/test_validatePrune_AtomicIntersection.ts @@ -0,0 +1,115 @@ +import typia from "../../../../src"; +import { _test_validatePrune } from "../../../internal/_test_validatePrune"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validatePrune_AtomicIntersection = _test_validatePrune( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const validate = ( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validatePrune as any).report(errors); + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const prune = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): void => {}; + const output = validate(input); + if (output.success) prune(input); + return output; + })(input), + AtomicIntersection.SPOILERS, +); diff --git a/test/generated/output/validatePrune/test_validatePrune_ConstantIntersection.ts b/test/generated/output/validatePrune/test_validatePrune_ConstantIntersection.ts new file mode 100644 index 0000000000..0362d5dcdf --- /dev/null +++ b/test/generated/output/validatePrune/test_validatePrune_ConstantIntersection.ts @@ -0,0 +1,113 @@ +import typia from "../../../../src"; +import { _test_validatePrune } from "../../../internal/_test_validatePrune"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validatePrune_ConstantIntersection = _test_validatePrune( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const validate = ( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validatePrune as any).report(errors); + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const prune = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): void => {}; + const output = validate(input); + if (output.success) prune(input); + return output; + })(input), + ConstantIntersection.SPOILERS, +); diff --git a/test/generated/output/validateStringify/test_validateStringify_AtomicIntersection.ts b/test/generated/output/validateStringify/test_validateStringify_AtomicIntersection.ts new file mode 100644 index 0000000000..fb7605afb2 --- /dev/null +++ b/test/generated/output/validateStringify/test_validateStringify_AtomicIntersection.ts @@ -0,0 +1,123 @@ +import typia from "../../../../src"; +import { _test_validateStringify } from "../../../internal/_test_validateStringify"; +import { AtomicIntersection } from "../../../structures/AtomicIntersection"; + +export const test_validateStringify_AtomicIntersection = + _test_validateStringify( + "AtomicIntersection", + AtomicIntersection.generate, + (input) => + (( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation< + [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateStringify as any).report( + errors, + ); + const __is = ( + input: any, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + "boolean" === typeof input[0] && + "number" === typeof input[1] && + Number.isFinite(input[1]) && + "string" === typeof input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: + "[boolean, number, string]", + value: input, + })) && + [ + "boolean" === typeof input[0] || + $report(true, { + path: _path + "[0]", + expected: "boolean", + value: input[0], + }), + ("number" === typeof input[1] && + Number.isFinite(input[1])) || + $report(true, { + path: _path + "[1]", + expected: "number", + value: input[1], + }), + "string" === typeof input[2] || + $report(true, { + path: _path + "[2]", + expected: "string", + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "AtomicIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const stringify = ( + input: [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + ], + ): string => { + const $number = (typia.validateStringify as any).number; + const $string = (typia.validateStringify as any).string; + return `[${input[0]},${$number(input[1])},${$string( + input[2], + )}]`; + }; + const output = validate(input) as any; + if (output.success) output.data = stringify(input); + return output; + })(input), + AtomicIntersection.SPOILERS, + ); diff --git a/test/generated/output/validateStringify/test_validateStringify_ConstantIntersection.ts b/test/generated/output/validateStringify/test_validateStringify_ConstantIntersection.ts new file mode 100644 index 0000000000..0d8e8682ad --- /dev/null +++ b/test/generated/output/validateStringify/test_validateStringify_ConstantIntersection.ts @@ -0,0 +1,128 @@ +import typia from "../../../../src"; +import { _test_validateStringify } from "../../../internal/_test_validateStringify"; +import { ConstantIntersection } from "../../../structures/ConstantIntersection"; + +export const test_validateStringify_ConstantIntersection = + _test_validateStringify( + "ConstantIntersection", + ConstantIntersection.generate, + (input) => + (( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): typia.IValidation => { + const validate = ( + input: any, + ): typia.IValidation< + [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] + > => { + const errors = [] as any[]; + const $report = (typia.validateStringify as any).report( + errors, + ); + const __is = ( + input: any, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + Array.isArray(input) && + input.length === 3 && + false === input[0] && + 1 === input[1] && + "two" === input[2] + ); + }; + if (false === __is(input)) + (( + input: any, + _path: string, + _exceptionable: boolean = true, + ): input is [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ] => { + return ( + ((Array.isArray(input) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + })) && + (input.length === 3 || + $report(true, { + path: _path + "", + expected: '[false, 1, "two"]', + value: input, + })) && + [ + false === input[0] || + $report(true, { + path: _path + "[0]", + expected: "false", + value: input[0], + }), + 1 === input[1] || + $report(true, { + path: _path + "[1]", + expected: "1", + value: input[1], + }), + "two" === input[2] || + $report(true, { + path: _path + "[2]", + expected: '"two"', + value: input[2], + }), + ].every((flag: boolean) => flag)) || + $report(true, { + path: _path + "", + expected: "ConstantIntersection", + value: input, + }) + ); + })(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined, + } as any; + }; + const stringify = ( + input: [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, + ], + ): string => { + const $number = (typia.validateStringify as any).number; + const $string = (typia.validateStringify as any).string; + const $throws = (typia.validateStringify as any).throws; + return `[${input[0]},${$number(input[1])},${(() => { + if ("string" === typeof input[2]) + return $string(input[2]); + if ("string" === typeof input[2]) + return '"' + input[2] + '"'; + $throws({ + expected: '"two"', + value: input[2], + }); + })()}]`; + }; + const output = validate(input) as any; + if (output.success) output.data = stringify(input); + return output; + })(input), + ConstantIntersection.SPOILERS, + ); diff --git a/test/issues/intersection.ts b/test/issues/intersection.ts new file mode 100644 index 0000000000..2b86b08cb0 --- /dev/null +++ b/test/issues/intersection.ts @@ -0,0 +1,4 @@ +import typia from "typia"; + +type Intersection = typia.Primitive; +console.log(typia.createIs().toString()); diff --git a/test/schemas/json/ajv/AtomicIntersection.json b/test/schemas/json/ajv/AtomicIntersection.json new file mode 100644 index 0000000000..4d17fa43da --- /dev/null +++ b/test/schemas/json/ajv/AtomicIntersection.json @@ -0,0 +1,39 @@ +{ + "schemas": [ + { + "$ref": "#/components/schemas/AtomicIntersection" + } + ], + "components": { + "schemas": { + "AtomicIntersection": { + "$id": "#/components/schemas/AtomicIntersection", + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_boolean_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_number_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_string_gt_" + } + ] + }, + "AtomicIntersection.Wrapper_lt_boolean_gt_": { + "$id": "#/components/schemas/AtomicIntersection.Wrapper_lt_boolean_gt_", + "type": "boolean" + }, + "AtomicIntersection.Wrapper_lt_number_gt_": { + "$id": "#/components/schemas/AtomicIntersection.Wrapper_lt_number_gt_", + "type": "number" + }, + "AtomicIntersection.Wrapper_lt_string_gt_": { + "$id": "#/components/schemas/AtomicIntersection.Wrapper_lt_string_gt_", + "type": "string" + } + } + }, + "purpose": "ajv" +} \ No newline at end of file diff --git a/test/schemas/json/ajv/ConstantIntersection.json b/test/schemas/json/ajv/ConstantIntersection.json new file mode 100644 index 0000000000..024926b815 --- /dev/null +++ b/test/schemas/json/ajv/ConstantIntersection.json @@ -0,0 +1,48 @@ +{ + "schemas": [ + { + "$ref": "#/components/schemas/ConstantIntersection" + } + ], + "components": { + "schemas": { + "ConstantIntersection": { + "$id": "#/components/schemas/ConstantIntersection", + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_false_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_1_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_" + } + ] + }, + "ConstantIntersection.Wrapper_lt_false_gt_": { + "$id": "#/components/schemas/ConstantIntersection.Wrapper_lt_false_gt_", + "type": "boolean", + "enum": [ + false + ] + }, + "ConstantIntersection.Wrapper_lt_1_gt_": { + "$id": "#/components/schemas/ConstantIntersection.Wrapper_lt_1_gt_", + "type": "number", + "enum": [ + 1 + ] + }, + "ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_": { + "$id": "#/components/schemas/ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_", + "type": "string", + "enum": [ + "two" + ] + } + } + }, + "purpose": "ajv" +} \ No newline at end of file diff --git a/test/schemas/json/swagger/AtomicIntersection.json b/test/schemas/json/swagger/AtomicIntersection.json new file mode 100644 index 0000000000..3c37e1a53d --- /dev/null +++ b/test/schemas/json/swagger/AtomicIntersection.json @@ -0,0 +1,51 @@ +{ + "schemas": [ + { + "$ref": "#/components/schemas/AtomicIntersection" + } + ], + "components": { + "schemas": { + "AtomicIntersection": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_boolean_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_number_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_string_gt_" + } + ] + }, + "x-typia-tuple": { + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_boolean_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_number_gt_" + }, + { + "$ref": "#/components/schemas/AtomicIntersection.Wrapper_lt_string_gt_" + } + ] + } + }, + "AtomicIntersection.Wrapper_lt_boolean_gt_": { + "type": "boolean" + }, + "AtomicIntersection.Wrapper_lt_number_gt_": { + "type": "number" + }, + "AtomicIntersection.Wrapper_lt_string_gt_": { + "type": "string" + } + } + }, + "purpose": "swagger" +} \ No newline at end of file diff --git a/test/schemas/json/swagger/ConstantIntersection.json b/test/schemas/json/swagger/ConstantIntersection.json new file mode 100644 index 0000000000..77dbc4e2cf --- /dev/null +++ b/test/schemas/json/swagger/ConstantIntersection.json @@ -0,0 +1,60 @@ +{ + "schemas": [ + { + "$ref": "#/components/schemas/ConstantIntersection" + } + ], + "components": { + "schemas": { + "ConstantIntersection": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_false_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_1_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_" + } + ] + }, + "x-typia-tuple": { + "type": "array", + "items": [ + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_false_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt_1_gt_" + }, + { + "$ref": "#/components/schemas/ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_" + } + ] + } + }, + "ConstantIntersection.Wrapper_lt_false_gt_": { + "type": "boolean", + "enum": [ + false + ] + }, + "ConstantIntersection.Wrapper_lt_1_gt_": { + "type": "number", + "enum": [ + 1 + ] + }, + "ConstantIntersection.Wrapper_lt__doublequote_two_doublequote__gt_": { + "type": "string", + "enum": [ + "two" + ] + } + } + }, + "purpose": "swagger" +} \ No newline at end of file diff --git a/test/structures/AtomicIntersection.ts b/test/structures/AtomicIntersection.ts new file mode 100644 index 0000000000..3fe9694622 --- /dev/null +++ b/test/structures/AtomicIntersection.ts @@ -0,0 +1,33 @@ +import { Spoiler } from "../helpers/Spoiler"; + +export type AtomicIntersection = [ + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, + AtomicIntersection.Wrapper, +]; +export namespace AtomicIntersection { + export type Wrapper = T & { __meta?: object }; + + export function generate(): AtomicIntersection { + return [false, 1, "two"]; + } + + export const SPOILERS: Spoiler[] = [ + (input) => { + input[0] = 0 as any; + return ["$input[0]"]; + }, + (input) => { + input[1] = "one" as any; + return ["$input[1]"]; + }, + (input) => { + input[2] = 2 as any; + return ["$input[2]"]; + }, + ...new Array(3).fill(0).map((_, i) => (input: AtomicIntersection) => { + input[i] = { __meta: {} } as any; + return [`$input[${i}]`]; + }), + ]; +} diff --git a/test/structures/ConstantIntersection.ts b/test/structures/ConstantIntersection.ts new file mode 100644 index 0000000000..2a135d18ed --- /dev/null +++ b/test/structures/ConstantIntersection.ts @@ -0,0 +1,33 @@ +import { Spoiler } from "../helpers/Spoiler"; + +export type ConstantIntersection = [ + ConstantIntersection.Wrapper, + ConstantIntersection.Wrapper<1>, + ConstantIntersection.Wrapper<"two">, +]; +export namespace ConstantIntersection { + export type Wrapper = T & { __meta?: object }; + + export function generate(): ConstantIntersection { + return [false, 1, "two"]; + } + + export const SPOILERS: Spoiler[] = [ + (input) => { + input[0] = 0 as any; + return ["$input[0]"]; + }, + (input) => { + input[1] = "one" as any; + return ["$input[1]"]; + }, + (input) => { + input[2] = 2 as any; + return ["$input[2]"]; + }, + ...new Array(3).fill(0).map((_, i) => (input: ConstantIntersection) => { + input[i] = { __meta: {} } as any; + return [`$input[${i}]`]; + }), + ]; +}