-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #1172: enhance notations' types and functions.
- Loading branch information
Showing
88 changed files
with
166 additions
and
934 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import typia from "typia"; | ||
|
||
interface Something { | ||
something: string; | ||
SOMETHING: string; | ||
|
||
somethingMusic: string; | ||
SomethingMusic: string; | ||
something_music: string; | ||
SOMETHING_MUSIC: string; | ||
|
||
x__y__z__and__something: string; | ||
} | ||
interface SomethingOfCamel { | ||
something: string; | ||
somethingMusic: string; | ||
xYZAndSomething: string; | ||
} | ||
interface SomethingOfPascal { | ||
Something: string; | ||
SOMETHING: string; | ||
SomethingMusic: string; | ||
XYZAndSomething: string; | ||
} | ||
interface SomethingOfSnake { | ||
something: string; | ||
something_music: string; | ||
x__y__z__and__something: string; | ||
} | ||
|
||
const something: Something = typia.random<Something>(); | ||
const x = typia.notations.camel(something); | ||
const y = typia.notations.pascal(something); | ||
const z = typia.notations.snake(something); | ||
|
||
console.log(x); | ||
typia.assertEquals<SomethingOfCamel>(x); | ||
|
||
console.log(y); | ||
typia.assertEquals<SomethingOfPascal>(y); | ||
|
||
console.log(z); | ||
typia.assertEquals<SomethingOfSnake>(z); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,6 @@ | |
"typescript": "^5.3.2" | ||
}, | ||
"dependencies": { | ||
"typia": "../typia-6.5.2.tgz" | ||
"typia": "../typia-6.5.3.tgz" | ||
} | ||
} |
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
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
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
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 |
---|---|---|
|
@@ -36,6 +36,6 @@ | |
"typescript": "^5.4.5" | ||
}, | ||
"dependencies": { | ||
"typia": "../typia-6.5.2.tgz" | ||
"typia": "../typia-6.5.3.tgz" | ||
} | ||
} |
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
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
40 changes: 40 additions & 0 deletions
40
test/src/features/issues/test_issue_1172_upper_cased_snake_case.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,40 @@ | ||
import typia, { CamelCase, PascalCase, SnakeCase } from "typia"; | ||
|
||
export const test_issue_1172_upper_cased_snake_case = (): void => { | ||
const something: Something = typia.random<Something>(); | ||
const x: CamelCase<Something> = typia.notations.camel(something); | ||
const y: PascalCase<Something> = typia.notations.pascal(something); | ||
const z: SnakeCase<Something> = typia.notations.snake(something); | ||
|
||
typia.assertEquals<SomethingOfCamel>(x); | ||
typia.assertEquals<SomethingOfPascal>(y); | ||
typia.assertEquals<SomethingOfSnake>(z); | ||
}; | ||
|
||
interface Something { | ||
something: string; | ||
SOMETHING: string; | ||
|
||
somethingMusic: string; | ||
SomethingMusic: string; | ||
something_music: string; | ||
SOMETHING_MUSIC: string; | ||
|
||
x__y__z__and__something: string; | ||
} | ||
interface SomethingOfCamel { | ||
something: string; | ||
somethingMusic: string; | ||
xYZAndSomething: string; | ||
} | ||
interface SomethingOfPascal { | ||
Something: string; | ||
SOMETHING: string; | ||
SomethingMusic: string; | ||
XYZAndSomething: string; | ||
} | ||
interface SomethingOfSnake { | ||
something: string; | ||
something_music: string; | ||
x__y__z__and__something: string; | ||
} |
12 changes: 0 additions & 12 deletions
12
test/src/features/notation.camel/test_notation_camel_DynamicArray.ts
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
test/src/features/notation.camel/test_notation_camel_DynamicComposite.ts
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
test/src/features/notation.camel/test_notation_camel_DynamicConstant.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.