-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from samchon/v3.3
Close #241 - ignore `@internal` tagged properties
- Loading branch information
Showing
11 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
test/features/application/test_application_object_internal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_application } from "./_test_application"; | ||
|
||
export const test_application_object_internal = _test_application( | ||
"internal object", | ||
TSON.application<[ObjectInternal]>(), | ||
{ | ||
schemas: [ | ||
{ | ||
$ref: "#/components/schemas/ObjectInternal", | ||
}, | ||
], | ||
components: { | ||
schemas: { | ||
ObjectInternal: { | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
nullable: false, | ||
}, | ||
name: { | ||
type: "string", | ||
nullable: false, | ||
}, | ||
}, | ||
nullable: false, | ||
required: ["id", "name"], | ||
jsDocTags: [], | ||
}, | ||
}, | ||
}, | ||
purpose: "swagger", | ||
prefix: "#/components/schemas", | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_assert } from "./_test_assert"; | ||
|
||
export const test_assert_object_internal = _test_assert( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.assertType(input), | ||
[ | ||
(input) => { | ||
input.name = false as any; | ||
return "$input.name"; | ||
}, | ||
(input) => { | ||
input.id = 1 as any; | ||
return "$input.id"; | ||
}, | ||
], | ||
); |
9 changes: 9 additions & 0 deletions
9
test/features/assert_equals/test_assert_equals_object_internal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_assert_equals } from "./_test_assert_equals"; | ||
|
||
export const test_assert_equals_object_internal = _test_assert_equals( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.assertEquals(input), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_equals } from "./_test_equals"; | ||
|
||
export const test_equals_object_internal = _test_equals( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.equals(input), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_is } from "./_test_is"; | ||
|
||
export const test_is_object_internal = _test_is( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.is(input), | ||
[(elem) => (elem.id = false as any), (elem) => (elem.name = 1 as any)], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_stringify } from "./_test_stringify"; | ||
|
||
export const test_stringify_object_internal = _test_stringify( | ||
"object internal", | ||
ObjectInternal.generate(), | ||
(input) => TSON.stringify(input), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_validate } from "./_test_validate"; | ||
|
||
export const test_validate_object_internal = _test_validate( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.validate(input), | ||
[ | ||
(input) => { | ||
input.name = false as any; | ||
return ["$input.name"]; | ||
}, | ||
(input) => { | ||
input.id = 1 as any; | ||
return ["$input.id"]; | ||
}, | ||
], | ||
); |
9 changes: 9 additions & 0 deletions
9
test/features/validate_equals/test_validate_equals_object_internal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TSON from "../../../src"; | ||
import { ObjectInternal } from "../../structures/ObjectInternal"; | ||
import { _test_validate_equals } from "./_test_validate_equals"; | ||
|
||
export const test_validate_equals_object_internal = _test_validate_equals( | ||
"object internal", | ||
ObjectInternal.generate, | ||
(input) => TSON.validateEquals(input), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface ObjectInternal { | ||
id: string; | ||
name: string; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
__age: number; | ||
} | ||
export namespace ObjectInternal { | ||
export function generate(): ObjectInternal { | ||
return { | ||
id: "id", | ||
name: "name", | ||
} as ObjectInternal; | ||
} | ||
} |