Skip to content

Commit

Permalink
Merge pull request #1465 from ryoppippi/feature/typo
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
samchon authored Jan 24, 2025
2 parents 4b4525c + 3ae1ea5 commit b00ec46
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 39 deletions.
30 changes: 15 additions & 15 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { TypeGuardError } from "./TypeGuardError";
*
* By the way, as `FormData` is not enough to express complex data structures,
* `typia.http.formData()` function has some limitations. If target type `T` is
* not following those restrictions, compilation errors would be occured.
* not following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand All @@ -34,7 +34,7 @@ import { TypeGuardError } from "./TypeGuardError";
*
* Also, `typia.http.formData()` function does not perform validation about the
* decoded value. Therefore, if you can't sure that input data is following the
* `T` type, it would better to call one of below functions intead.
* `T` type, it would better to call one of below functions instead.
*
* @template T Expected type of decoded value
* @param input FormData instance
Expand Down Expand Up @@ -66,7 +66,7 @@ export function formData(): never {
*
* By the way, as `FormData` is not enough to express complex data structures,
* `typia.http.assertFormData()` function has some limitations. If target type `T`
* is not following those restrictions, compilation errors would be occured.
* is not following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -106,7 +106,7 @@ export function assertFormData(): never {
*
* By the way, as `FormData` is not enough to express complex data structures,
* `typia.http.isFormData()` function has some limitations. If target type `T` is
* not following those restrictions, compilation errors would be occured.
* not following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -146,7 +146,7 @@ export function isFormData(): never {
*
* By the way, as `FormData` is not enough to express complex data structures,
* `typia.http.validateFormData()` function has some limitations. If target type
* `T` is not following those restrictions, compilation errors would be occured.
* `T` is not following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -183,7 +183,7 @@ export function validateFormData(): never {
*
* By the way, as URL query is not enough to express complex data structures,
* `typia.http.query()` function has some limitations. If target type `T` is not
* following those restrictions, compilation errors would be occured.
* following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand All @@ -192,7 +192,7 @@ export function validateFormData(): never {
*
* Also, `typia.http.query()` function does not perform validation about the decoded
* value. Therefore, if you can't sure that input data is following the `T` type,
* it would better to call one of below functions intead.
* it would better to call one of below functions instead.
*
* - {@link assertQuery}
* - {@link isQuery}
Expand Down Expand Up @@ -230,7 +230,7 @@ export function query(): never {
*
* By the way, as URL query is not enough to express complex data structures,
* `typia.http.assertQuery()` function has some limitations. If target type `T` is
* notfollowing those restrictions, compilation errors would be occured.
* notfollowing those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -270,7 +270,7 @@ export function assertQuery(): never {
*
* By the way, as URL query is not enough to express complex data structures,
* `typia.http.isQuery()` function has some limitations. If target type `T` is
* notfollowing those restrictions, compilation errors would be occured.
* notfollowing those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -309,7 +309,7 @@ export function isQuery(): never {
*
* By the way, as URL query is not enough to express complex data structures,
* `typia.http.validateQuery()` function has some limitations. If target type `T` is
* notfollowing those restrictions, compilation errors would be occured.
* notfollowing those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -345,7 +345,7 @@ export function validateQuery(): never {
*
* By the way, as HTTP headers are not enough to express complex data structures,
* `typia.http.headers()` function has some limitations. If target type `T` is not
* following those restrictions, compilation errors would be occured.
* following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -376,7 +376,7 @@ export function validateQuery(): never {
*
* Also, `typia.http.headers()` function does not perform validation about the decoded
* value. Therefore, if you can't sure that input data is following the `T` type,
* it would better to call one of below functions intead.
* it would better to call one of below functions instead.
*
* - {@link assertHeaders}
* - {@link isHeaders}
Expand Down Expand Up @@ -414,7 +414,7 @@ export function headers(): never {
*
* By the way, as HTTP headers are not enough to express complex data structures,
* `typia.http.headers()` function has some limitations. If target type `T` is not
* following those restrictions, compilation errors would be occured.
* following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -478,7 +478,7 @@ export function assertHeaders(): never {
*
* By the way, as HTTP headers are not enough to express complex data structures,
* `typia.http.headers()` function has some limitations. If target type `T` is not
* following those restrictions, compilation errors would be occured.
* following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down Expand Up @@ -539,7 +539,7 @@ export function isHeaders(): never {
*
* By the way, as HTTP headers are not enough to express complex data structures,
* `typia.http.headers()` function has some limitations. If target type `T` is not
* following those restrictions, compilation errors would be occured.
* following those restrictions, compilation errors would be occurred.
*
* 1. Type `T` must be an object type
* 2. Do not allow dynamic property
Expand Down
8 changes: 4 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export function createAssert<T>(): (input: unknown) => T {
* // MUST DECLARE THE VARIABLE TYPE
* const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
*
* // IF NOT, COMPILATION ERROR BE OCCURED
* // IF NOT, COMPILATION ERROR BE OCCURRED
* const func = typia.createAssertGuard<number>();
* ```
*
Expand Down Expand Up @@ -659,7 +659,7 @@ export function createAssertGuard(
* // MUST DECLARE THE VARIABLE TYPE
* const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
*
* // IF NOT, COMPILATION ERROR BE OCCURED
* // IF NOT, COMPILATION ERROR BE OCCURRED
* const func = typia.createAssertGuard<number>();
* ```
*
Expand Down Expand Up @@ -784,7 +784,7 @@ export function createAssertEquals<T>(): (input: unknown) => T {
* // MUST DECLARE THE VARIABLE TYPE
* const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
*
* // IF NOT, COMPILATION ERROR BE OCCURED
* // IF NOT, COMPILATION ERROR BE OCCURRED
* const func = typia.createAssertGuardEquals<number>();
* ```
*
Expand Down Expand Up @@ -813,7 +813,7 @@ export function createAssertGuardEquals(
* // MUST DECLARE THE VARIABLE TYPE
* const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
*
* // IF NOT, COMPILATION ERROR BE OCCURED
* // IF NOT, COMPILATION ERROR BE OCCURRED
* const func = typia.createAssertGuardEquals<number>();
* ```
*
Expand Down
18 changes: 9 additions & 9 deletions src/protobuf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function message(): never {
*
* For reference, as Protocol Buffer handles binary data directly, there's no way
* when `input` binary data was not encoded from the `T` typed value. In that case,
* unexpected behavior or internal error would be occured. Therefore, I recommend you
* unexpected behavior or internal error would be occurred. Therefore, I recommend you
* to encode binary data of Protocol Buffer from type safe encode functions like below.
* Use {@link encode} function only when you can ensure it.
*
Expand Down Expand Up @@ -103,7 +103,7 @@ export function decode(input: Uint8Array): never;
*
* For reference, as Protocol Buffer handles binary data directly, there's no way
* when `input` binary data was not encoded from the `T` typed value. In that case,
* unexpected behavior or internal error would be occured. Therefore, I recommend you
* unexpected behavior or internal error would be occurred. Therefore, I recommend you
* to encode binary data of Protocol Buffer from type safe encode functions like below.
* Use {@link encode} function only when you can ensure it.
*
Expand Down Expand Up @@ -354,7 +354,7 @@ export function validateDecode(): never {
* For reference, this `typia.protobuf.encode()` does not validate the `input` value.
* It just believes that the `input` value is valid and converts it to a binary data
* directly. Therefore, if you can't ensure the `input` value type, it would better to
* call one of below functions intead.
* call one of below functions instead.
*
* - {@link assertEncode}
* - {@link isEncode}
Expand Down Expand Up @@ -394,7 +394,7 @@ export function encode(): never {
* Protocol Buffer binary data would be returned.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link isEncode}
Expand Down Expand Up @@ -431,7 +431,7 @@ export function assertEncode<T>(
* Protocol Buffer binary data would be returned.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link isEncode}
Expand Down Expand Up @@ -475,7 +475,7 @@ export function assertEncode(): never {
* Buffer binary data would be returned.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link assertEncode}
Expand Down Expand Up @@ -508,7 +508,7 @@ export function isEncode<T>(input: T): Uint8Array | null;
* Buffer binary data would be returned.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link assertEncode}
Expand Down Expand Up @@ -549,7 +549,7 @@ export function isEncode(): never {
* `data` property of the output {@link IValidation.ISuccess} instance.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link assertEncode}
Expand Down Expand Up @@ -583,7 +583,7 @@ export function validateEncode<T>(input: T): IValidation<Uint8Array>;
* `data` property of the output {@link IValidation.ISuccess} instance.
*
* If you can trust `input` value, or want to perform other type of validation, use
* below functions intead.
* below functions instead.
*
* - {@link encode}
* - {@link assertEncode}
Expand Down
2 changes: 1 addition & 1 deletion src/tags/TagBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export namespace TagBase {
* `$input` would be transformed to the suitable when compilation.
*
* Also, If you've take a mistake on this script, compile error would be
* occured. So, define it with confidence. Compiler will block all your
* occurred. So, define it with confidence. Compiler will block all your
* mistakes.
*/
validate?: Validate;
Expand Down
4 changes: 2 additions & 2 deletions website/pages/docs/json/stringify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export namespace IValidation {

You can boost up JSON serialization speed just by calling `typia.json.stringify<T>()` function. Also, you even can ensure type safety of JSON serialization by calling other functions like `typia.json.isStringify()` and `typia.json.assertStringify()` functions.

As `typia.json.stringify<T>()` function writes dedicated JSON serialization code only for the target type `T`, its performance is much faster than native `JSON.stringify()` function. However, because of the dedicated optimal JSON serialization code, when wrong typed data comes, unexpected error be occured.
As `typia.json.stringify<T>()` function writes dedicated JSON serialization code only for the target type `T`, its performance is much faster than native `JSON.stringify()` function. However, because of the dedicated optimal JSON serialization code, when wrong typed data comes, unexpected error be occurred.

Instead, `typia` supports type safe JSON serialization functions like `typia.json.isStringify()`. The `typia.json.isStringify()` is a combination function of `typia.is<T>()` and `typia.json.stringify<T>()` function. It checks whether the input value is valid for the target type `T` or not first, and operate JSON serialization later. If the input value is not matched with the type `T`, it returns `null` value.

Expand Down Expand Up @@ -600,4 +600,4 @@ I'll show you the benchmark result that, how JSON serizliation speed affects on
![Server Benchmark](https://raw.githubusercontent.com/samchon/typia/master/benchmark/results/AMD%20Ryzen%209%207940HS%20w%20Radeon%20780M%20Graphics/images/server.svg)
> Measured on [AMD Ryzen 9 7940HS, Rog Flow x13](https://github.com/samchon/typia/tree/master/benchmark/results/AMD%20Ryzen%209%207940HS%20w%20Radeon%20780M%20Graphics#server)
> Measured on [AMD Ryzen 9 7940HS, Rog Flow x13](https://github.com/samchon/typia/tree/master/benchmark/results/AMD%20Ryzen%209%207940HS%20w%20Radeon%20780M%20Graphics#server)
8 changes: 4 additions & 4 deletions website/pages/docs/misc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1982,14 +1982,14 @@ URL query decoder functions.
`typia.http.query<T>()` is a function decoding a query string or an `URLSearchParams` instance, with automatic type casting to the expected type. When property type be defined as boolean or number type, `typia.http.query<T>()` will cast the value to the expected type when decoding.
By the way, as URL query is not enough to express complex data structures, `typia.http.query<T>()` function has some limitations. If target type `T` is not following those restrictions, compilation errors would be occured.
By the way, as URL query is not enough to express complex data structures, `typia.http.query<T>()` function has some limitations. If target type `T` is not following those restrictions, compilation errors would be occurred.
1. Type T must be an object type
2. Do not allow dynamic property
3. Only boolean, bigint, number, string or their array types are allowed
4. By the way, union type never be not allowed
Also, `typia.http.query<T>()` function does not perform validation about the decoded value. Therefore, if you can't sure that input data is following the `T` type, it would better to call one of below functions intead.
Also, `typia.http.query<T>()` function does not perform validation about the decoded value. Therefore, if you can't sure that input data is following the `T` type, it would better to call one of below functions instead.
- `typia.http.assertQuery<T>()`: [`typia.assert<T>()`](./validators/assert) + `typia.http.query<T>()`
- `typia.http.isQuery<T>()`: [`typia.is<T>()`](./validators/is) + `typia.http.query<T>()`
Expand Down Expand Up @@ -2250,7 +2250,7 @@ Headers decoder (for express and fastify).
`typia.http.headers<t>()` is a function decoding an header instance, with automatic type casting to the expected type. When property type be defined as boolean or number type, `typia.http.headers<t>()` will cast the value to the expected type.
By the way, as HTTP headers are not enough to express complex data structures, `typia.http.headers<t>()` function has some limitations. If target type `T` is not following those restrictions, compilation errors would be occured.
By the way, as HTTP headers are not enough to express complex data structures, `typia.http.headers<t>()` function has some limitations. If target type `T` is not following those restrictions, compilation errors would be occurred.
1. Type T must be an object type
2. Do not allow dynamic property
Expand Down Expand Up @@ -2279,7 +2279,7 @@ By the way, as HTTP headers are not enough to express complex data structures, `
- server
- user-agent
Also, `typia.http.headers<t>()` function does not perform validation about the decoded value. Therefore, if you can't sure that input data is following the `T` type, it would better to call one of below functions intead.
Also, `typia.http.headers<t>()` function does not perform validation about the decoded value. Therefore, if you can't sure that input data is following the `T` type, it would better to call one of below functions instead.
- `typia.http.assertHeaders<T>()`: [`typia.assert<T>()`](./validators/assert) + `typia.http.headers<T>()`
- `typia.http.isHeaders<T>()`: [`typia.is<T>()`](./validators/is) + `typia.http.headers<T>()`
Expand Down
4 changes: 2 additions & 2 deletions website/pages/docs/protobuf/decode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Protocol Buffer Decoder.

You can easily convert a Protocol Buffer's binary data to a JavaScript object, without any extra Protocol Buffer [Message Schema](./message) definition. `typia.protobuf.decode<T>()` function analyzes your type `T`, and generates a Protocol Buffer Message Schema internally.And then, it converts the binary data to a JavaScript object.

By the way, as Protocol Buffer handles binary data directly, there's no way when `input` binary data was not encoded from the `T` typed value. In that case, unexpected behavior or internal error would be occured. Therefore, I recommend you to encode binary data of Protocol Buffer from type safe encode functions like below, Use `typia.protobuf.encode<T>()` function only when you can trust it.
By the way, as Protocol Buffer handles binary data directly, there's no way when `input` binary data was not encoded from the `T` typed value. In that case, unexpected behavior or internal error would be occurred. Therefore, I recommend you to encode binary data of Protocol Buffer from type safe encode functions like below, Use `typia.protobuf.encode<T>()` function only when you can trust it.

- [`typia.protobuf.isEncode<T>()`](./encode)
- [`typia.protobuf.assertEncode<T>()`](./encode)
Expand Down Expand Up @@ -992,4 +992,4 @@ To know how to define special numeric types like `uint64`, and to understand whi
- [`message()` function](./message#message-function)
- [Type Tags](./message#type-tags)
- [Comment Tags](./message#comment-tags)
- [Restrictions](./message#restrictions)
- [Restrictions](./message#restrictions)
2 changes: 1 addition & 1 deletion website/pages/docs/validators/assert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ import typia, { AssertionGuard } from "typia";
//MUST DECLARE THE VARIABLE TYPE
const explicit: AssertionGuard<number> = typia.createAssertGuard<number>();

// IF NOT, COMPILATION ERROR BE OCCURED
// IF NOT, COMPILATION ERROR BE OCCURRED
const implicit = typia.createAssertGuard<number>();
```

Expand Down
2 changes: 1 addition & 1 deletion website/pages/docs/validators/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export namespace TagBase {
* `$input` would be transformed to the suitable when compilation.
*
* Also, If you've take a mistake on this script, compile error would be
* occured. So, define it with confidence. Compiler will block all your
* occurred. So, define it with confidence. Compiler will block all your
* mistakes.
*/
validate: Validate;
Expand Down

0 comments on commit b00ec46

Please sign in to comment.