Skip to content

Commit

Permalink
Enhancing typia.protobuf.message<T>() function
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Aug 11, 2023
1 parent 573cea2 commit dee197e
Show file tree
Hide file tree
Showing 259 changed files with 26,148 additions and 331 deletions.
4 changes: 1 addition & 3 deletions build/internal/TestMessageGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export namespace TestMessageGenerator {
"",
`export const test_protobuf_message_${s.name} = _test_protobuf_message(`,
` "${s.name}",`,
`)(`,
` typia.protobuf.message<${s.name}>(),`,
`);`,
`)(typia.protobuf.message<${s.name}>());`,
];
await fs.promises.writeFile(
`${__dirname}/../../test/features/protobuf.message/test_protobuf_message_${s.name}.ts`,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"jsdom": "^21.1.1",
"physical-cpu-count": "^2.0.0",
"prettier": "^2.6.2",
"protobufjs": "^7.2.4",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"sloc": "^0.2.1",
Expand All @@ -138,4 +139,4 @@
"src"
],
"private": true
}
}
2 changes: 1 addition & 1 deletion src/programmers/protobuf/ProtobufMessageProgrammer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export namespace ProtobufMessageProgrammer {
? ""
: !prop.value.isRequired() || prop.value.nullable
? "optional "
: "required"
: "required "
}${type} ${key} = ${++ptr.value};`;
})
.join("\n");
Expand Down
7 changes: 7 additions & 0 deletions test/features/assert/test_assert_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assert } from "../../internal/_test_assert";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_assert_ObjectJsonTag = _test_assert<ObjectJsonTag>(
ObjectJsonTag,
)((input) => typia.assert<ObjectJsonTag>(input));
7 changes: 7 additions & 0 deletions test/features/assert/test_assert_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assert } from "../../internal/_test_assert";
import { TagDefault } from "../../structures/TagDefault";

export const test_assert_TagDefault = _test_assert<TagDefault>(TagDefault)(
(input) => typia.assert<TagDefault>(input),
);
8 changes: 8 additions & 0 deletions test/features/assertEquals/test_assertEquals_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_assertEquals } from "../../internal/_test_assertEquals";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_assertEquals_ObjectJsonTag =
_test_assertEquals<ObjectJsonTag>(ObjectJsonTag)((input) =>
typia.assertEquals<ObjectJsonTag>(input),
);
7 changes: 7 additions & 0 deletions test/features/assertEquals/test_assertEquals_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assertEquals } from "../../internal/_test_assertEquals";
import { TagDefault } from "../../structures/TagDefault";

export const test_assertEquals_TagDefault = _test_assertEquals<TagDefault>(
TagDefault,
)((input) => typia.assertEquals<TagDefault>(input));
7 changes: 7 additions & 0 deletions test/features/createAssert/test_createAssert_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assert } from "../../internal/_test_assert";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_assert_ObjectJsonTag = _test_assert<ObjectJsonTag>(
ObjectJsonTag,
)(typia.createAssert<ObjectJsonTag>());
7 changes: 7 additions & 0 deletions test/features/createAssert/test_createAssert_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assert } from "../../internal/_test_assert";
import { TagDefault } from "../../structures/TagDefault";

export const test_assert_TagDefault = _test_assert<TagDefault>(TagDefault)(
typia.createAssert<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_assertEquals } from "../../internal/_test_assertEquals";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_assertEquals_ObjectJsonTag =
_test_assertEquals<ObjectJsonTag>(ObjectJsonTag)(
typia.createAssertEquals<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_assertEquals } from "../../internal/_test_assertEquals";
import { TagDefault } from "../../structures/TagDefault";

export const test_assertEquals_TagDefault = _test_assertEquals<TagDefault>(
TagDefault,
)(typia.createAssertEquals<TagDefault>());
7 changes: 7 additions & 0 deletions test/features/createEquals/test_createEquals_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_equals } from "../../internal/_test_equals";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_equals_ObjectJsonTag = _test_equals<ObjectJsonTag>(
ObjectJsonTag,
)(typia.createEquals<ObjectJsonTag>());
7 changes: 7 additions & 0 deletions test/features/createEquals/test_createEquals_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_equals } from "../../internal/_test_equals";
import { TagDefault } from "../../structures/TagDefault";

export const test_equals_TagDefault = _test_equals<TagDefault>(TagDefault)(
typia.createEquals<TagDefault>(),
);
7 changes: 7 additions & 0 deletions test/features/createIs/test_createIs_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_is } from "../../internal/_test_is";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_is_ObjectJsonTag = _test_is<ObjectJsonTag>(ObjectJsonTag)(
typia.createIs<ObjectJsonTag>(),
);
7 changes: 7 additions & 0 deletions test/features/createIs/test_createIs_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_is } from "../../internal/_test_is";
import { TagDefault } from "../../structures/TagDefault";

export const test_is_TagDefault = _test_is<TagDefault>(TagDefault)(
typia.createIs<TagDefault>(),
);
10 changes: 10 additions & 0 deletions test/features/createRandom/test_createRandom_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import typia from "../../../src";
import { _test_random } from "../../internal/_test_random";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_random_ObjectJsonTag = _test_random<ObjectJsonTag>(
ObjectJsonTag,
)({
random: typia.createRandom<ObjectJsonTag>(),
assert: typia.createAssert<ObjectJsonTag>(),
});
8 changes: 8 additions & 0 deletions test/features/createRandom/test_createRandom_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_random } from "../../internal/_test_random";
import { TagDefault } from "../../structures/TagDefault";

export const test_random_TagDefault = _test_random<TagDefault>(TagDefault)({
random: typia.createRandom<TagDefault>(),
assert: typia.createAssert<TagDefault>(),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_validate } from "../../internal/_test_validate";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_validate_ObjectJsonTag = _test_validate<ObjectJsonTag>(
ObjectJsonTag,
)(typia.createValidate<ObjectJsonTag>());
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_validate } from "../../internal/_test_validate";
import { TagDefault } from "../../structures/TagDefault";

export const test_validate_TagDefault = _test_validate<TagDefault>(TagDefault)(
typia.createValidate<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_validateEquals } from "../../internal/_test_validateEquals";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_validateEquals_ObjectJsonTag =
_test_validateEquals<ObjectJsonTag>(ObjectJsonTag)(
typia.createValidateEquals<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_validateEquals } from "../../internal/_test_validateEquals";
import { TagDefault } from "../../structures/TagDefault";

export const test_validateEquals_TagDefault = _test_validateEquals<TagDefault>(
TagDefault,
)(typia.createValidateEquals<TagDefault>());
7 changes: 7 additions & 0 deletions test/features/equals/test_equals_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_equals } from "../../internal/_test_equals";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_equals_ObjectJsonTag = _test_equals<ObjectJsonTag>(
ObjectJsonTag,
)((input) => typia.equals<ObjectJsonTag>(input));
7 changes: 7 additions & 0 deletions test/features/equals/test_equals_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_equals } from "../../internal/_test_equals";
import { TagDefault } from "../../structures/TagDefault";

export const test_equals_TagDefault = _test_equals<TagDefault>(TagDefault)(
(input) => typia.equals<TagDefault>(input),
);
7 changes: 7 additions & 0 deletions test/features/is/test_is_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_is } from "../../internal/_test_is";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_is_ObjectJsonTag = _test_is<ObjectJsonTag>(ObjectJsonTag)(
(input) => typia.is<ObjectJsonTag>(input),
);
7 changes: 7 additions & 0 deletions test/features/is/test_is_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_is } from "../../internal/_test_is";
import { TagDefault } from "../../structures/TagDefault";

export const test_is_TagDefault = _test_is<TagDefault>(TagDefault)((input) =>
typia.is<TagDefault>(input),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertParse } from "../../internal/_test_json_assertParse";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_assertParse_ObjectJsonTag =
_test_json_assertParse<ObjectJsonTag>(ObjectJsonTag)((input) =>
typia.json.assertParse<ObjectJsonTag>(input),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertParse } from "../../internal/_test_json_assertParse";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_assertParse_TagDefault =
_test_json_assertParse<TagDefault>(TagDefault)((input) =>
typia.json.assertParse<TagDefault>(input),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertStringify } from "../../internal/_test_json_assertStringify";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_assertStringify_ObjectJsonTag =
_test_json_assertStringify<ObjectJsonTag>(ObjectJsonTag)((input) =>
typia.json.assertStringify<ObjectJsonTag>(input),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertStringify } from "../../internal/_test_json_assertStringify";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_assertStringify_TagDefault =
_test_json_assertStringify<TagDefault>(TagDefault)((input) =>
typia.json.assertStringify<TagDefault>(input),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertParse } from "../../internal/_test_json_assertParse";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_assertParse_ObjectJsonTag =
_test_json_assertParse<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createAssertParse<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertParse } from "../../internal/_test_json_assertParse";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_assertParse_TagDefault =
_test_json_assertParse<TagDefault>(TagDefault)(
typia.json.createAssertParse<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertStringify } from "../../internal/_test_json_assertStringify";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_assertStringify_ObjectJsonTag =
_test_json_assertStringify<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createAssertStringify<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_assertStringify } from "../../internal/_test_json_assertStringify";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_assertStringify_TagDefault =
_test_json_assertStringify<TagDefault>(TagDefault)(
typia.json.createAssertStringify<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_isParse } from "../../internal/_test_json_isParse";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_isParse_ObjectJsonTag =
_test_json_isParse<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createIsParse<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_json_isParse } from "../../internal/_test_json_isParse";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_isParse_TagDefault = _test_json_isParse<TagDefault>(
TagDefault,
)(typia.json.createIsParse<TagDefault>());
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_isStringify } from "../../internal/_test_json_isStringify";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_isStringify_ObjectJsonTag =
_test_json_isStringify<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createIsStringify<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_isStringify } from "../../internal/_test_json_isStringify";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_isStringify_TagDefault =
_test_json_isStringify<TagDefault>(TagDefault)(
typia.json.createIsStringify<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_stringify } from "../../internal/_test_json_stringify";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_stringify_ObjectJsonTag =
_test_json_stringify<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createStringify<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_json_stringify } from "../../internal/_test_json_stringify";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_stringify_TagDefault = _test_json_stringify<TagDefault>(
TagDefault,
)(typia.json.createStringify<TagDefault>());
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_validateParse } from "../../internal/_test_json_validateParse";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_validateParse_ObjectJsonTag =
_test_json_validateParse<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createValidateParse<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_validateParse } from "../../internal/_test_json_validateParse";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_validateParse_TagDefault =
_test_json_validateParse<TagDefault>(TagDefault)(
typia.json.createValidateParse<TagDefault>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_validateStringify } from "../../internal/_test_json_validateStringify";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_validateStringify_ObjectJsonTag =
_test_json_validateStringify<ObjectJsonTag>(ObjectJsonTag)(
typia.json.createValidateStringify<ObjectJsonTag>(),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_validateStringify } from "../../internal/_test_json_validateStringify";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_validateStringify_TagDefault =
_test_json_validateStringify<TagDefault>(TagDefault)(
typia.json.createValidateStringify<TagDefault>(),
);
8 changes: 8 additions & 0 deletions test/features/json.isParse/test_json_isParse_ObjectJsonTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import typia from "../../../src";
import { _test_json_isParse } from "../../internal/_test_json_isParse";
import { ObjectJsonTag } from "../../structures/ObjectJsonTag";

export const test_json_isParse_ObjectJsonTag =
_test_json_isParse<ObjectJsonTag>(ObjectJsonTag)((input) =>
typia.json.isParse<ObjectJsonTag>(input),
);
7 changes: 7 additions & 0 deletions test/features/json.isParse/test_json_isParse_TagDefault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import typia from "../../../src";
import { _test_json_isParse } from "../../internal/_test_json_isParse";
import { TagDefault } from "../../structures/TagDefault";

export const test_json_isParse_TagDefault = _test_json_isParse<TagDefault>(
TagDefault,
)((input) => typia.json.isParse<TagDefault>(input));
Loading

0 comments on commit dee197e

Please sign in to comment.