Skip to content

Commit

Permalink
fix spelling ci & fix typo (#1481)
Browse files Browse the repository at this point in the history
* chore: add typos config

* chore: add typos dictionary

* chore: spell-check ci

* feat(typos): ignore pattern

https://github.com/crate-ci/typos/blob/0fad3ddc6e0fedf679217dcc61886fbeabd09346/docs/reference.md#example-configurations

* chore(README): fix spelling

* chore(website): fix spelling

* chore(test-error): fix spelling

* chore(test): fix typo

* chore(benckmark): fix spelling

* chore(src): fix spelling

* chore(test): fix spelling

shrinked -> shrunk

* chore(website): secretly -> secret

* chore(website): key -> keys

* Revert "chore(website): key -> keys"

This reverts commit 36374b6.

* Revert "chore(website): secretly -> secret"

This reverts commit 547b9e9.

* chore(website): secretly key -> security keys

* chore(src): secretly key -> security keys

* Make test program to be passed

* Add extend-exclude

* Fix extend-exclude

* Fix some keywords

---------

Co-authored-by: Jeongho Nam <samchon.github@gmail.com>
  • Loading branch information
ryoppippi and samchon authored Feb 3, 2025
1 parent 0cef0e1 commit feade78
Show file tree
Hide file tree
Showing 142 changed files with 906 additions and 728 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: spell-check
on:
push:
pull_request:

jobs:
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- uses: crate-ci/typos@master
with:
config: ./typos.toml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Also, `typia` is re-distributing half of donations to core contributors of `typi
- [`nonara/ts-patch`](https://github.com/nonara/ts-patch)
- [`ryoppippi/unplugin-typia`](https://github.com/ryoppippi/unplugin-typia)

[![Sponsers](https://opencollective.com/typia/badge.svg?avatarHeight=75&width=600)](https://opencollective.com/typia)
[![Sponsors](https://opencollective.com/typia/badge.svg?avatarHeight=75&width=600)](https://opencollective.com/typia)



Expand Down
8 changes: 4 additions & 4 deletions benchmark/src/internal/BenchmarkServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export namespace BenchmarkServer {
console.log("---------------------------------------------------");

const location: string = `${__dirname}/../programs/${category}`;
const libraries: string[] = await findLibaries(location);
const libraries: string[] = await findLibraries(location);
const types: string[] = await findTypes(
libraries.map((str) => `${location}/${str}`),
);
Expand Down Expand Up @@ -130,14 +130,14 @@ export namespace BenchmarkServer {
return (await tolerable()) ? controller.failure(data) : null;
};

async function findLibaries(path: string): Promise<string[]> {
async function findLibraries(path: string): Promise<string[]> {
const directory: string[] = [];
for (const file of await fs.promises.readdir(path)) {
if (file === "internal") continue;
const stats: fs.Stats = await fs.promises.stat(`${path}/${file}`);
if (stats.isDirectory()) directory.push(file);
}
const index = (str: string) => LIBARIES.findIndex((s) => s === str);
const index = (str: string) => LIBRARIES.findIndex((s) => s === str);
return directory.sort((x, y) => index(x) - index(y));
}

Expand Down Expand Up @@ -174,7 +174,7 @@ export namespace BenchmarkServer {
ArrayRecursiveUnionImplicit: ArrayRecursiveUnionImplicit,
UltimateUnion: UltimateUnion,
};
const LIBARIES: string[] = [
const LIBRARIES: string[] = [
"typia",
"typebox",
"ajv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { IoTsUtils } from "../../../structures/io-ts/IoTsUtils";
import { createAssertErrorBenchmarkProgram } from "../createAssertErrorBenchmarkProgram";

export const createAssertErrorIoTsBenchmarkProgram = <Schema extends Mixed>(
instace: Schema,
instance: Schema,
) => {
const schema = array(instace);
const schema = array(instance);
return createAssertErrorBenchmarkProgram((input) => {
if (schema.is(input) === false) {
const validation: Validation<any> = schema.decode(input);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/src/programs/createSuccessBenchmarkProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tgrid from "tgrid";
import { IBenchmarkProgram } from "./IBenchmarkProgram";

export const createSuccessBenchmarkProgram =
(multipler: number) =>
(multiplier: number) =>
<T>(process: (input: T) => any) =>
async (validate: (input: T) => boolean, skip?: (name: string) => boolean) => {
const provider: IBenchmarkProgram<T> = {
Expand All @@ -17,7 +17,7 @@ export const createSuccessBenchmarkProgram =
return suite.map((elem: benchmark) => {
const count: number = elem.hz * elem.times.elapsed;
const size: number =
multipler * Buffer.from(JSON.stringify(input)).byteLength;
multiplier * Buffer.from(JSON.stringify(input)).byteLength;

return {
amount: size * count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { IoTsUtils } from "../../../structures/io-ts/IoTsUtils";
import { createValidateErrorBenchmarkProgram } from "../createValidateErrorBenchmarkProgram";

export const createValidateErrorIoTsBenchmarkProgram = <Schema extends Mixed>(
instace: Schema,
instance: Schema,
) => {
const schema = array(instace);
const schema = array(instance);
return createValidateErrorBenchmarkProgram((input) => {
if (schema.is(input) === true) return [];
const validation: Validation<any> = schema.decode(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Employee {
@cv.ValidateNested()
@cv.IsObject()
@tr.Type(() => ClassValidatorTimestamp)
employeed_at!: ClassValidatorTimestamp;
employed_at!: ClassValidatorTimestamp;
}

class Department {
Expand Down
6 changes: 3 additions & 3 deletions benchmark/src/structures/pure/ArrayHierarchical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export namespace ArrayHierarchical {
name: string;
age: number;
grade: number;
employeed_at: ITimestamp;
employed_at: ITimestamp;
}
export interface ITimestamp {
time: number;
Expand Down Expand Up @@ -51,7 +51,7 @@ export namespace ArrayHierarchical {
name: TestRandomGenerator.string(),
age: TestRandomGenerator.integer(),
grade: TestRandomGenerator.integer(),
employeed_at: {
employed_at: {
time: TestRandomGenerator.integer(),
zone: TestRandomGenerator.integer(),
},
Expand Down Expand Up @@ -92,7 +92,7 @@ export namespace ArrayHierarchical {
"$input[0].departments[0].employees[0].name",
"$input[0].departments[0].employees[0].age",
"$input[0].departments[0].employees[0].grade",
"$input[0].departments[0].employees[0].employeed_at",
"$input[0].departments[0].employees[0].employed_at",
];
},
];
Expand Down
4 changes: 2 additions & 2 deletions benchmark/src/structures/pure/ObjectHierarchical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export namespace ObjectHierarchical {

export function generate(
authorized: boolean = true,
employeed: boolean = true,
employed: boolean = true,
): ObjectHierarchical {
const account = authorized ? () => generate_account() : () => null;
const enterprise: IEnterprise | null = employeed
const enterprise: IEnterprise | null = employed
? {
id: TestRandomGenerator.integer(),
account: generate_account(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Employee = Type.Object({
name: Type.String(),
age: Type.Number(),
grade: Type.Number(),
employeed_at: Timestamp,
employed_at: Timestamp,
});

const Department = Type.Object({
Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/utils/TestRandomGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export namespace TestRandomGenerator {
export const length = () => integer(0, 3);

/* -----------------------------------------------------------
SECIAL FORMATS
SPECIAL FORMATS
----------------------------------------------------------- */
export const uuid = () =>
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Also, `typia` is re-distributing half of donations to core contributors of `typi
- [`nonara/ts-patch`](https://github.com/nonara/ts-patch)
- [`ryoppippi/unplugin-typia`](https://github.com/ryoppippi/unplugin-typia)

[![Sponsers](https://opencollective.com/typia/badge.svg?avatarHeight=75&width=600)](https://opencollective.com/typia)
[![Sponsors](https://opencollective.com/typia/badge.svg?avatarHeight=75&width=600)](https://opencollective.com/typia)



Expand Down
2 changes: 1 addition & 1 deletion src/IReadableURLSearchParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Interface for a readable URLSearchParams object.
*
* This interface is a subset of the {@link URLSearchParams} interface,
* designed especially for the [Hono.JS](https://hono.dev/) libray.
* designed especially for the [Hono.JS](https://hono.dev/) library.
*
* @author https://github.com/miyaji255
*/
Expand Down
2 changes: 1 addition & 1 deletion src/factories/MetadataTypeTagFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export namespace MetadataTypeTagFactory {
if (tag.target !== props.type) {
success &&= props.report({
property: null,
message: `target must constains ${props.type} type`,
message: `target must contain ${props.type} type`,
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/factories/ProtobufFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ export namespace ProtobufFactory {
);
}
//----
// ARRRAY CASES
// ARRAY CASES
//----
// DO NOT ALLOW MULTI-DIMENTIONAL ARRAY
// DO NOT ALLOW MULTI-DIMENSIONAL ARRAY
if (
meta.arrays.length &&
meta.arrays.some((array) => !!array.type.value.arrays.length)
)
noSupport("over two dimenstional array type");
noSupport("over two dimensional array type");
// CHILD OF ARRAY TYPE MUST BE REQUIRED
if (
meta.arrays.length &&
Expand Down Expand Up @@ -494,7 +494,7 @@ export namespace ProtobufFactory {
meta.objects[0]!.type.properties.some((p) => !!p.value.arrays.length)
)
noSupport("dynamic object with array value type");
// UNION WITH DYNAMIC OBJECTa
// UNION WITH DYNAMIC OBJECTTa
if (
meta.size() > 1 &&
meta.objects.length &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const iterate_metadata_intersection = (
if (props.intersected === true) return false;
else if (props.type.isIntersection() === false) return false;

// COSTRUCT FAKE METADATA LIST
// CONSTRUCT FAKE METADATA LIST
const commit: MetadataCollection = props.collection.clone();
props.collection["options"] = undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ export function validateHeaders(): never {
* URL path parameter decoder.
*
* `typia.http.parameter()` is a function decoding a path parameter, with automatic
* type casting to the expected type. When type `T` has beeen defined as `boolean` or
* type casting to the expected type. When type `T` has been defined as `boolean` or
* `number` type, `typia.http.parameter()` will cast the value to the expected type.
*
* Also, `typia.http.parameter()` performs type assertion to the decoded value by
Expand Down
2 changes: 1 addition & 1 deletion src/internal/_isUniqueItems.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const _isUniqueItems = (elements: any[]): boolean => {
// EMTPY OR ONLY ONE
// EMPTY OR ONLY ONE
if (elements.length < 2) return true;

// SHALLOW COMPARISON
Expand Down
12 changes: 6 additions & 6 deletions src/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function application(): never {
* Safe `JSON.parse()` function with type assertion.
*
* `typia.json.assertParse()` is a combination function of `JSON.parse()` and
* {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
* {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation) string
* to a `T` typed instance with type assertion.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
Expand All @@ -197,7 +197,7 @@ export function assertParse(
* Safe `JSON.parse()` function with type assertion.
*
* `typia.json.assertParse()` is a combination function of `JSON.parse()` and
* {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
* {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation) string
* to a `T` typed instance with type assertion.
*
* In such reason, when parsed JSON string value is not matched with the type `T`,
Expand Down Expand Up @@ -230,7 +230,7 @@ export function assertParse<T>(): Primitive<T> {
* Safe `JSON.parse()` function with type checking.
*
* `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
* Therefore, it converts a JSON (JavaScript Object Notation) string to a `T` typed
* instance with type checking.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
Expand All @@ -249,7 +249,7 @@ export function isParse(input: string): never;
* Safe `JSON.parse()` function with type checking.
*
* `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
* Therefore, it converts a JSON (JavaScript Object Notation) string to a `T` typed
* instance with type checking.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
Expand Down Expand Up @@ -277,7 +277,7 @@ export function isParse<T>(): Primitive<T> | null {
* Safe `JSON.parse()` function with detailed type validation.
*
* `typia.json.validateParse()` is a combination function of `JSON.parse()` and
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
* {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation) string
* to a `T` typed instance with detailed type validation.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
Expand All @@ -297,7 +297,7 @@ export function validateParse(input: string): never;
* Safe `JSON.parse()` function with detailed type validation.
*
* `typia.json.validateParse()` is a combination function of `JSON.parse()` and
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
* {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation) string
* to a `T` typed instance with detailed type validation.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
Expand Down
16 changes: 8 additions & 8 deletions src/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ILlmApplicationOfValidate } from "./module";
*
* By the way, there can be some parameters (or their nested properties) which must be
* composed by human, not by LLM. File uploading feature or some sensitive information
* like secrety key (password) are the examples. In that case, you can separate the
* like security keys (password) are the examples. In that case, you can separate the
* function parameters to both LLM and human sides by configuring the
* {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
* are assigned to the {@link ILlmFunctionOfValidate.separated} property.
Expand Down Expand Up @@ -85,7 +85,7 @@ export function applicationOfValidate(
*
* By the way, there can be some parameters (or their nested properties) which must be
* composed by human, not by LLM. File uploading feature or some sensitive information
* like secrety key (password) are the examples. In that case, you can separate the
* like security keys (password) are the examples. In that case, you can separate the
* function parameters to both LLM and human sides by configuring the
* {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
* are assigned to the {@link ILlmFunctionOfValidate.separated} property.
Expand Down Expand Up @@ -155,7 +155,7 @@ export function applicationOfValidate(): never {
*
* By the way, there can be some parameters (or their nested properties) which must be
* composed by human, not by LLM. File uploading feature or some sensitive information
* like secrety key (password) are the examples. In that case, you can separate the
* like security keys (password) are the examples. In that case, you can separate the
* function parameters to both LLM and human sides by configuring the
* {@link ILlmApplication.IOptions.separate} property. The separated parameters are
* assigned to the {@link ILlmFunction.separated} property.
Expand Down Expand Up @@ -210,7 +210,7 @@ export function application(
*
* By the way, there can be some parameters (or their nested properties) which must be
* composed by human, not by LLM. File uploading feature or some sensitive information
* like secrety key (password) are the examples. In that case, you can separate the
* like security keys (password) are the examples. In that case, you can separate the
* function parameters to both LLM and human sides by configuring the
* {@link ILlmApplication.IOptions.separate} property. The separated parameters are
* assigned to the {@link ILlmFunction.separated} property.
Expand Down Expand Up @@ -385,8 +385,8 @@ export function parameters(): never {
*
* > **What LLM function calling is?
* >
* > LLM (Large Language Model) selects propert function and fill the arguments,
* > but actuall function call execution is not by LLM, but by you.
* > LLM (Large Language Model) selects property function and fill the arguments,
* > but actual function call execution is not by LLM, but by you.
* >
* > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
* > "function calling" feature. The "function calling" means that LLM automatically selects
Expand Down Expand Up @@ -432,8 +432,8 @@ export function schema(): never;
*
* > **What LLM function calling is?
* >
* > LLM (Large Language Model) selects propert function and fill the arguments,
* > but actuall function call execution is not by LLM, but by you.
* > LLM (Large Language Model) selects property function and fill the arguments,
* > but actual function call execution is not by LLM, but by you.
* >
* > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
* > "function calling" feature. The "function calling" means that LLM automatically selects
Expand Down
Loading

0 comments on commit feade78

Please sign in to comment.