diff --git a/.changeset/chilly-ladybugs-collect.md b/.changeset/chilly-ladybugs-collect.md new file mode 100644 index 00000000..6e66732d --- /dev/null +++ b/.changeset/chilly-ladybugs-collect.md @@ -0,0 +1,5 @@ +--- +"docs": minor +--- + +docs(@nf-team/core): 의미가 모호한 core 함수명 변경으로 인한 문서 업데이트 diff --git a/.changeset/thirty-elephants-scream.md b/.changeset/thirty-elephants-scream.md new file mode 100644 index 00000000..69c5e5bd --- /dev/null +++ b/.changeset/thirty-elephants-scream.md @@ -0,0 +1,5 @@ +--- +"@nf-team/core": major +--- + +refactor(@nf-team/core): 의미가 모호한 core 유틸 함수명 변경 diff --git a/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip b/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip new file mode 100644 index 00000000..cf67cd85 Binary files /dev/null and b/.yarn/cache/@esbuild-darwin-arm64-npm-0.21.5-62349c1520-10.zip differ diff --git a/.yarn/cache/@esbuild-darwin-x64-npm-0.21.5-491c2ae06c-10.zip b/.yarn/cache/@esbuild-darwin-x64-npm-0.21.5-491c2ae06c-10.zip deleted file mode 100644 index c29febdf..00000000 Binary files a/.yarn/cache/@esbuild-darwin-x64-npm-0.21.5-491c2ae06c-10.zip and /dev/null differ diff --git a/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip b/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip deleted file mode 100644 index 2a3a835a..00000000 Binary files a/.yarn/cache/@esbuild-linux-x64-npm-0.21.5-88079726c4-10.zip and /dev/null differ diff --git a/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.4.1-0124a9273e-10.zip b/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.4.1-0124a9273e-10.zip new file mode 100644 index 00000000..8b855a62 Binary files /dev/null and b/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.4.1-0124a9273e-10.zip differ diff --git a/.yarn/cache/@rollup-rollup-darwin-x64-npm-4.4.1-3c0c058de6-10.zip b/.yarn/cache/@rollup-rollup-darwin-x64-npm-4.4.1-3c0c058de6-10.zip deleted file mode 100644 index 2e3fb976..00000000 Binary files a/.yarn/cache/@rollup-rollup-darwin-x64-npm-4.4.1-3c0c058de6-10.zip and /dev/null differ diff --git a/.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.4.1-8ac85f164e-10.zip b/.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.4.1-8ac85f164e-10.zip deleted file mode 100644 index 316722ce..00000000 Binary files a/.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.4.1-8ac85f164e-10.zip and /dev/null differ diff --git a/.yarn/cache/@swc-core-darwin-x64-npm-1.3.96-042e43a303-10.zip b/.yarn/cache/@swc-core-darwin-arm64-npm-1.3.96-6c495b7164-10.zip similarity index 59% rename from .yarn/cache/@swc-core-darwin-x64-npm-1.3.96-042e43a303-10.zip rename to .yarn/cache/@swc-core-darwin-arm64-npm-1.3.96-6c495b7164-10.zip index 7ecab066..5c6ff253 100644 Binary files a/.yarn/cache/@swc-core-darwin-x64-npm-1.3.96-042e43a303-10.zip and b/.yarn/cache/@swc-core-darwin-arm64-npm-1.3.96-6c495b7164-10.zip differ diff --git a/.yarn/cache/@swc-core-linux-x64-gnu-npm-1.3.96-01459a118a-10.zip b/.yarn/cache/@swc-core-linux-x64-gnu-npm-1.3.96-01459a118a-10.zip deleted file mode 100644 index 744d764b..00000000 Binary files a/.yarn/cache/@swc-core-linux-x64-gnu-npm-1.3.96-01459a118a-10.zip and /dev/null differ diff --git a/.yarn/cache/turbo-darwin-64-npm-2.0.5-50580a1137-10.zip b/.yarn/cache/turbo-darwin-arm64-npm-2.0.5-b6d4e32b48-10.zip similarity index 51% rename from .yarn/cache/turbo-darwin-64-npm-2.0.5-50580a1137-10.zip rename to .yarn/cache/turbo-darwin-arm64-npm-2.0.5-b6d4e32b48-10.zip index c8f275ff..fe721a54 100644 Binary files a/.yarn/cache/turbo-darwin-64-npm-2.0.5-50580a1137-10.zip and b/.yarn/cache/turbo-darwin-arm64-npm-2.0.5-b6d4e32b48-10.zip differ diff --git a/.yarn/cache/turbo-linux-64-npm-2.0.5-7da303db48-10.zip b/.yarn/cache/turbo-linux-64-npm-2.0.5-7da303db48-10.zip deleted file mode 100644 index 9d7e02f8..00000000 Binary files a/.yarn/cache/turbo-linux-64-npm-2.0.5-7da303db48-10.zip and /dev/null differ diff --git a/apps/docs/docs/core/functions/checkEmpty.md b/apps/docs/docs/core/functions/checkEmpty.md deleted file mode 100644 index cc6332a7..00000000 --- a/apps/docs/docs/core/functions/checkEmpty.md +++ /dev/null @@ -1,19 +0,0 @@ -# Function: checkEmpty() - -> **checkEmpty**\<`T`\>(`value`?): `T`[] - -## Type Parameters - -• **T** - -## Parameters - -• **value?**: `T`[] - -## Returns - -`T`[] - -## Defined in - -[utils.ts:44](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L44) diff --git a/apps/docs/docs/core/functions/checkNumber.md b/apps/docs/docs/core/functions/checkNumber.md deleted file mode 100644 index 681459c7..00000000 --- a/apps/docs/docs/core/functions/checkNumber.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: checkNumber() - -> **checkNumber**(`value`?): `number` - -## Parameters - -• **value?**: `null` \| `number` - -## Returns - -`number` - -## Defined in - -[utils.ts:26](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L26) diff --git a/apps/docs/docs/core/functions/createNumberArray.md b/apps/docs/docs/core/functions/createNumberArray.md new file mode 100644 index 00000000..a3cc918d --- /dev/null +++ b/apps/docs/docs/core/functions/createNumberArray.md @@ -0,0 +1,15 @@ +# Function: createNumberArray() + +> **createNumberArray**(`length`): `number`[] + +## Parameters + +• **length**: `number` + +## Returns + +`number`[] + +## Defined in + +[utils.ts:61](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L61) diff --git a/apps/docs/docs/core/functions/emptyAThenB.md b/apps/docs/docs/core/functions/emptyAThenB.md index d6e7c732..0945f2ab 100644 --- a/apps/docs/docs/core/functions/emptyAThenB.md +++ b/apps/docs/docs/core/functions/emptyAThenB.md @@ -14,4 +14,4 @@ ## Defined in -[utils.ts:34](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L34) +[utils.ts:31](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L31) diff --git a/apps/docs/docs/core/functions/ensureArray.md b/apps/docs/docs/core/functions/ensureArray.md new file mode 100644 index 00000000..0dcf76c6 --- /dev/null +++ b/apps/docs/docs/core/functions/ensureArray.md @@ -0,0 +1,19 @@ +# Function: ensureArray() + +> **ensureArray**\<`T`\>(`value`?): `T`[] + +## Type Parameters + +• **T** + +## Parameters + +• **value?**: `T`[] + +## Returns + +`T`[] + +## Defined in + +[utils.ts:41](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L41) diff --git a/apps/docs/docs/core/functions/generateArrayOfNumber.md b/apps/docs/docs/core/functions/generateArrayOfNumber.md deleted file mode 100644 index ccfd8bef..00000000 --- a/apps/docs/docs/core/functions/generateArrayOfNumber.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: generateArrayOfNumber() - -> **generateArrayOfNumber**(`length`): `number`[] - -## Parameters - -• **length**: `number` - -## Returns - -`number`[] - -## Defined in - -[utils.ts:64](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L64) diff --git a/apps/docs/docs/core/functions/getNumberOrDefault.md b/apps/docs/docs/core/functions/getNumberOrDefault.md new file mode 100644 index 00000000..9e3380b5 --- /dev/null +++ b/apps/docs/docs/core/functions/getNumberOrDefault.md @@ -0,0 +1,17 @@ +# Function: getNumberOrDefault() + +> **getNumberOrDefault**(`value`?, `defaultValue`?): `number` + +## Parameters + +• **value?**: `null` \| `number` + +• **defaultValue?**: `number` = `0` + +## Returns + +`number` + +## Defined in + +[utils.ts:26](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L26) diff --git a/apps/docs/docs/core/functions/removeNullable.md b/apps/docs/docs/core/functions/getStringOrDefault.md similarity index 81% rename from apps/docs/docs/core/functions/removeNullable.md rename to apps/docs/docs/core/functions/getStringOrDefault.md index bf18bb14..cde4c661 100644 --- a/apps/docs/docs/core/functions/removeNullable.md +++ b/apps/docs/docs/core/functions/getStringOrDefault.md @@ -1,6 +1,6 @@ -# Function: removeNullable() +# Function: getStringOrDefault() -> **removeNullable**(`value`?, `replacementValue`?): `string` +> **getStringOrDefault**(`value`?, `replacementValue`?): `string` ## Parameters @@ -33,4 +33,4 @@ console.log(result); // 'newValue'; ## Defined in -[utils.ts:14](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L14) +[utils.ts:14](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L14) diff --git a/apps/docs/docs/core/functions/isEmpty.md b/apps/docs/docs/core/functions/isEmpty.md index 31e39b3d..7306e5d3 100644 --- a/apps/docs/docs/core/functions/isEmpty.md +++ b/apps/docs/docs/core/functions/isEmpty.md @@ -16,4 +16,4 @@ ## Defined in -[utils.ts:52](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L52) +[utils.ts:49](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L49) diff --git a/apps/docs/docs/core/functions/trueOrFalse.md b/apps/docs/docs/core/functions/trueOrFalse.md index d37b0686..83c81d16 100644 --- a/apps/docs/docs/core/functions/trueOrFalse.md +++ b/apps/docs/docs/core/functions/trueOrFalse.md @@ -12,4 +12,4 @@ ## Defined in -[utils.ts:36](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/core/src/utils.ts#L36) +[utils.ts:33](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/core/src/utils.ts#L33) diff --git a/apps/docs/docs/core/packages.md b/apps/docs/docs/core/packages.md index 80dc02ae..e5d8dee9 100644 --- a/apps/docs/docs/core/packages.md +++ b/apps/docs/docs/core/packages.md @@ -2,10 +2,10 @@ ## Functions -- [checkEmpty](functions/checkEmpty.md) -- [checkNumber](functions/checkNumber.md) +- [createNumberArray](functions/createNumberArray.md) - [emptyAThenB](functions/emptyAThenB.md) -- [generateArrayOfNumber](functions/generateArrayOfNumber.md) +- [ensureArray](functions/ensureArray.md) +- [getNumberOrDefault](functions/getNumberOrDefault.md) +- [getStringOrDefault](functions/getStringOrDefault.md) - [isEmpty](functions/isEmpty.md) -- [removeNullable](functions/removeNullable.md) - [trueOrFalse](functions/trueOrFalse.md) diff --git a/apps/docs/docs/core/typedoc-sidebar.cjs b/apps/docs/docs/core/typedoc-sidebar.cjs index 503a63e0..97039102 100644 --- a/apps/docs/docs/core/typedoc-sidebar.cjs +++ b/apps/docs/docs/core/typedoc-sidebar.cjs @@ -1,4 +1,4 @@ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const typedocSidebar = { items: [{"type":"category","label":"Functions","items":[{"type":"doc","id":"core/functions/checkEmpty","label":"checkEmpty"},{"type":"doc","id":"core/functions/checkNumber","label":"checkNumber"},{"type":"doc","id":"core/functions/emptyAThenB","label":"emptyAThenB"},{"type":"doc","id":"core/functions/generateArrayOfNumber","label":"generateArrayOfNumber"},{"type":"doc","id":"core/functions/isEmpty","label":"isEmpty"},{"type":"doc","id":"core/functions/removeNullable","label":"removeNullable"},{"type":"doc","id":"core/functions/trueOrFalse","label":"trueOrFalse"}]}]}; +const typedocSidebar = { items: [{"type":"category","label":"Functions","items":[{"type":"doc","id":"core/functions/createNumberArray","label":"createNumberArray"},{"type":"doc","id":"core/functions/emptyAThenB","label":"emptyAThenB"},{"type":"doc","id":"core/functions/ensureArray","label":"ensureArray"},{"type":"doc","id":"core/functions/getNumberOrDefault","label":"getNumberOrDefault"},{"type":"doc","id":"core/functions/getStringOrDefault","label":"getStringOrDefault"},{"type":"doc","id":"core/functions/isEmpty","label":"isEmpty"},{"type":"doc","id":"core/functions/trueOrFalse","label":"trueOrFalse"}]}]}; module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/apps/docs/docs/fetch/classes/FetchError.md b/apps/docs/docs/fetch/classes/FetchError.md index c57c124a..1f7ba60e 100644 --- a/apps/docs/docs/fetch/classes/FetchError.md +++ b/apps/docs/docs/fetch/classes/FetchError.md @@ -26,7 +26,7 @@ #### Defined in -[packages/fetch/src/fetch.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L6) +[packages/fetch/src/fetch.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L6) ## Properties @@ -78,7 +78,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1069 #### Defined in -[packages/fetch/src/fetch.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L6) +[packages/fetch/src/fetch.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L6) *** diff --git a/apps/docs/docs/fetch/functions/fetchApi.md b/apps/docs/docs/fetch/functions/fetchApi.md index 674e7c09..81a056d1 100644 --- a/apps/docs/docs/fetch/functions/fetchApi.md +++ b/apps/docs/docs/fetch/functions/fetchApi.md @@ -1,6 +1,6 @@ # Function: fetchApi() -> **fetchApi**\<`T`, `K`\>(`__namedParameters`): `Promise`\<`T`\> +> **fetchApi**\<`T`, `K`, `B`\>(`__namedParameters`): `Promise`\<`T`\> ## Type Parameters @@ -8,9 +8,11 @@ • **K** = `unknown` +• **B** = `unknown` + ## Parameters -• **\_\_namedParameters**: [`FetchApiRequest`](../interfaces/FetchApiRequest.md)\<`K`\> +• **\_\_namedParameters**: [`FetchApiRequest`](../interfaces/FetchApiRequest.md)\<`K`, `B`\> ## Returns @@ -18,4 +20,4 @@ ## Defined in -[packages/fetch/src/fetch.ts:28](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L28) +[packages/fetch/src/fetch.ts:32](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L32) diff --git a/apps/docs/docs/fetch/functions/paramsSerializer.md b/apps/docs/docs/fetch/functions/paramsSerializer.md index eefcafc9..380b1cfc 100644 --- a/apps/docs/docs/fetch/functions/paramsSerializer.md +++ b/apps/docs/docs/fetch/functions/paramsSerializer.md @@ -16,4 +16,4 @@ ## Defined in -[packages/fetch/src/fetch.ts:23](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L23) +[packages/fetch/src/fetch.ts:23](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L23) diff --git a/apps/docs/docs/fetch/interfaces/FetchApiRequest.md b/apps/docs/docs/fetch/interfaces/FetchApiRequest.md index 7ae0ac23..3af22771 100644 --- a/apps/docs/docs/fetch/interfaces/FetchApiRequest.md +++ b/apps/docs/docs/fetch/interfaces/FetchApiRequest.md @@ -1,18 +1,20 @@ -# Interface: FetchApiRequest\ +# Interface: FetchApiRequest\ ## Type Parameters • **K** = `unknown` +• **B** = `unknown` + ## Properties ### body? -> `optional` **body**: `unknown` +> `optional` **body**: `B` #### Defined in -[packages/fetch/src/fetch.ts:18](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L18) +[packages/fetch/src/fetch.ts:18](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L18) *** @@ -22,7 +24,7 @@ #### Defined in -[packages/fetch/src/fetch.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L20) +[packages/fetch/src/fetch.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L20) *** @@ -32,7 +34,7 @@ #### Defined in -[packages/fetch/src/fetch.ts:17](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L17) +[packages/fetch/src/fetch.ts:17](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L17) *** @@ -42,7 +44,7 @@ #### Defined in -[packages/fetch/src/fetch.ts:16](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L16) +[packages/fetch/src/fetch.ts:16](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L16) *** @@ -52,7 +54,7 @@ #### Defined in -[packages/fetch/src/fetch.ts:19](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L19) +[packages/fetch/src/fetch.ts:19](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L19) *** @@ -62,4 +64,4 @@ #### Defined in -[packages/fetch/src/fetch.ts:15](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L15) +[packages/fetch/src/fetch.ts:15](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L15) diff --git a/apps/docs/docs/fetch/packages.md b/apps/docs/docs/fetch/packages.md index 8c45848d..f5dab01d 100644 --- a/apps/docs/docs/fetch/packages.md +++ b/apps/docs/docs/fetch/packages.md @@ -1,4 +1,4 @@ -# @nf-team/fetch v1.1.0 +# @nf-team/fetch v1.2.0 ## Classes diff --git a/apps/docs/docs/fetch/type-aliases/Method.md b/apps/docs/docs/fetch/type-aliases/Method.md index 18e8c539..89f0f6f7 100644 --- a/apps/docs/docs/fetch/type-aliases/Method.md +++ b/apps/docs/docs/fetch/type-aliases/Method.md @@ -4,4 +4,4 @@ ## Defined in -[packages/fetch/src/fetch.ts:12](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/fetch/src/fetch.ts#L12) +[packages/fetch/src/fetch.ts:12](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/fetch/src/fetch.ts#L12) diff --git a/apps/docs/docs/react/components/functions/ClientOnly.md b/apps/docs/docs/react/components/functions/ClientOnly.md index a966a69a..53f16878 100644 --- a/apps/docs/docs/react/components/functions/ClientOnly.md +++ b/apps/docs/docs/react/components/functions/ClientOnly.md @@ -33,4 +33,4 @@ function ClintOnlyComponent() { ## Defined in -[packages/react/src/components/ClientOnly.tsx:22](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/components/ClientOnly.tsx#L22) +[packages/react/src/components/ClientOnly.tsx:22](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/components/ClientOnly.tsx#L22) diff --git a/apps/docs/docs/react/components/functions/DelayRenderComponent.md b/apps/docs/docs/react/components/functions/DelayRenderComponent.md index 9cdef939..671b3918 100644 --- a/apps/docs/docs/react/components/functions/DelayRenderComponent.md +++ b/apps/docs/docs/react/components/functions/DelayRenderComponent.md @@ -12,4 +12,4 @@ ## Defined in -[packages/react/src/components/DelayRenderComponent.tsx:12](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/components/DelayRenderComponent.tsx#L12) +[packages/react/src/components/DelayRenderComponent.tsx:12](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/components/DelayRenderComponent.tsx#L12) diff --git a/apps/docs/docs/react/components/functions/GlobalPortal.md b/apps/docs/docs/react/components/functions/GlobalPortal.md index 22735be7..8a1757ce 100644 --- a/apps/docs/docs/react/components/functions/GlobalPortal.md +++ b/apps/docs/docs/react/components/functions/GlobalPortal.md @@ -38,4 +38,4 @@ function SampleComponent() { ## Defined in -[packages/react/src/components/GlobalPortal.tsx:34](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/components/GlobalPortal.tsx#L34) +[packages/react/src/components/GlobalPortal.tsx:34](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/components/GlobalPortal.tsx#L34) diff --git a/apps/docs/docs/react/hooks/functions/useActionKeyEvent.md b/apps/docs/docs/react/hooks/functions/useActionKeyEvent.md index 4dd1b819..a0719359 100644 --- a/apps/docs/docs/react/hooks/functions/useActionKeyEvent.md +++ b/apps/docs/docs/react/hooks/functions/useActionKeyEvent.md @@ -20,4 +20,4 @@ ## Defined in -[packages/react/src/hooks/useActionKeyEvent.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useActionKeyEvent.ts#L6) +[packages/react/src/hooks/useActionKeyEvent.ts:6](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useActionKeyEvent.ts#L6) diff --git a/apps/docs/docs/react/hooks/functions/useBoolean.md b/apps/docs/docs/react/hooks/functions/useBoolean.md index b30b9270..2a7a56e0 100644 --- a/apps/docs/docs/react/hooks/functions/useBoolean.md +++ b/apps/docs/docs/react/hooks/functions/useBoolean.md @@ -24,4 +24,4 @@ const [isOpen, openModal, closeModal, toggleModal] = useBoolean(); ## Defined in -[packages/react/src/hooks/useBoolean.ts:13](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useBoolean.ts#L13) +[packages/react/src/hooks/useBoolean.ts:13](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useBoolean.ts#L13) diff --git a/apps/docs/docs/react/hooks/functions/useDebounce.md b/apps/docs/docs/react/hooks/functions/useDebounce.md index e713603e..85e09c8a 100644 --- a/apps/docs/docs/react/hooks/functions/useDebounce.md +++ b/apps/docs/docs/react/hooks/functions/useDebounce.md @@ -18,4 +18,4 @@ ## Defined in -[packages/react/src/hooks/useDebounce.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useDebounce.ts#L3) +[packages/react/src/hooks/useDebounce.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useDebounce.ts#L3) diff --git a/apps/docs/docs/react/hooks/functions/useEffectOnce.md b/apps/docs/docs/react/hooks/functions/useEffectOnce.md index d07d7d60..8b959ea1 100644 --- a/apps/docs/docs/react/hooks/functions/useEffectOnce.md +++ b/apps/docs/docs/react/hooks/functions/useEffectOnce.md @@ -12,4 +12,4 @@ ## Defined in -[packages/react/src/hooks/useEffectOnce.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useEffectOnce.ts#L3) +[packages/react/src/hooks/useEffectOnce.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useEffectOnce.ts#L3) diff --git a/apps/docs/docs/react/hooks/functions/useGeolocation.md b/apps/docs/docs/react/hooks/functions/useGeolocation.md index 38bf29a8..c8726a5e 100644 --- a/apps/docs/docs/react/hooks/functions/useGeolocation.md +++ b/apps/docs/docs/react/hooks/functions/useGeolocation.md @@ -8,4 +8,4 @@ ## Defined in -[packages/react/src/hooks/useGeolocation.ts:15](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useGeolocation.ts#L15) +[packages/react/src/hooks/useGeolocation.ts:15](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useGeolocation.ts#L15) diff --git a/apps/docs/docs/react/hooks/functions/useIsFirstRender.md b/apps/docs/docs/react/hooks/functions/useIsFirstRender.md index 409df1df..dbcbeab8 100644 --- a/apps/docs/docs/react/hooks/functions/useIsFirstRender.md +++ b/apps/docs/docs/react/hooks/functions/useIsFirstRender.md @@ -8,4 +8,4 @@ ## Defined in -[packages/react/src/hooks/useIsFirstRender.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useIsFirstRender.ts#L3) +[packages/react/src/hooks/useIsFirstRender.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useIsFirstRender.ts#L3) diff --git a/apps/docs/docs/react/hooks/functions/useIsMounted.md b/apps/docs/docs/react/hooks/functions/useIsMounted.md index 6059e678..59b738ff 100644 --- a/apps/docs/docs/react/hooks/functions/useIsMounted.md +++ b/apps/docs/docs/react/hooks/functions/useIsMounted.md @@ -26,4 +26,4 @@ useEffect(() => { ## Defined in -[packages/react/src/hooks/useIsMounted.ts:18](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useIsMounted.ts#L18) +[packages/react/src/hooks/useIsMounted.ts:18](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useIsMounted.ts#L18) diff --git a/apps/docs/docs/react/hooks/functions/useIsomorphicLayoutEffect.md b/apps/docs/docs/react/hooks/functions/useIsomorphicLayoutEffect.md index f2975f1d..164e1dfb 100644 --- a/apps/docs/docs/react/hooks/functions/useIsomorphicLayoutEffect.md +++ b/apps/docs/docs/react/hooks/functions/useIsomorphicLayoutEffect.md @@ -28,4 +28,4 @@ If present, effect will only activate if the values in the list change. ## Defined in -[packages/react/src/hooks/useIsomorphicLayoutEffect.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useIsomorphicLayoutEffect.ts#L3) +[packages/react/src/hooks/useIsomorphicLayoutEffect.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useIsomorphicLayoutEffect.ts#L3) diff --git a/apps/docs/docs/react/hooks/functions/useLessThenScrollY.md b/apps/docs/docs/react/hooks/functions/useLessThenScrollY.md index 1fef9264..8dab4c0d 100644 --- a/apps/docs/docs/react/hooks/functions/useLessThenScrollY.md +++ b/apps/docs/docs/react/hooks/functions/useLessThenScrollY.md @@ -14,4 +14,4 @@ ## Defined in -[packages/react/src/hooks/useLessThenScrollY.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useLessThenScrollY.ts#L5) +[packages/react/src/hooks/useLessThenScrollY.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useLessThenScrollY.ts#L5) diff --git a/apps/docs/docs/react/hooks/functions/useResizeViewportHeight.md b/apps/docs/docs/react/hooks/functions/useResizeViewportHeight.md index 8a92b274..7843a78f 100644 --- a/apps/docs/docs/react/hooks/functions/useResizeViewportHeight.md +++ b/apps/docs/docs/react/hooks/functions/useResizeViewportHeight.md @@ -24,4 +24,4 @@ function SampleComponent() { ## Defined in -[packages/react/src/hooks/useResizeViewportHeight.ts:17](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useResizeViewportHeight.ts#L17) +[packages/react/src/hooks/useResizeViewportHeight.ts:17](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useResizeViewportHeight.ts#L17) diff --git a/apps/docs/docs/react/hooks/functions/useThrottleCallback.md b/apps/docs/docs/react/hooks/functions/useThrottleCallback.md index 1c8424f2..425b3b49 100644 --- a/apps/docs/docs/react/hooks/functions/useThrottleCallback.md +++ b/apps/docs/docs/react/hooks/functions/useThrottleCallback.md @@ -28,4 +28,4 @@ ## Defined in -[packages/react/src/hooks/useThrottleCallback.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useThrottleCallback.ts#L3) +[packages/react/src/hooks/useThrottleCallback.ts:3](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useThrottleCallback.ts#L3) diff --git a/apps/docs/docs/react/hooks/functions/useTimeout.md b/apps/docs/docs/react/hooks/functions/useTimeout.md index 5ba4eec4..ba48361b 100644 --- a/apps/docs/docs/react/hooks/functions/useTimeout.md +++ b/apps/docs/docs/react/hooks/functions/useTimeout.md @@ -14,4 +14,4 @@ ## Defined in -[packages/react/src/hooks/useTimeout.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useTimeout.ts#L5) +[packages/react/src/hooks/useTimeout.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useTimeout.ts#L5) diff --git a/apps/docs/docs/react/hooks/functions/useUnmount.md b/apps/docs/docs/react/hooks/functions/useUnmount.md index 75270644..b3ba39b1 100644 --- a/apps/docs/docs/react/hooks/functions/useUnmount.md +++ b/apps/docs/docs/react/hooks/functions/useUnmount.md @@ -12,4 +12,4 @@ ## Defined in -[packages/react/src/hooks/useUnmount.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useUnmount.ts#L5) +[packages/react/src/hooks/useUnmount.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useUnmount.ts#L5) diff --git a/apps/docs/docs/react/hooks/functions/useUpdateEffect.md b/apps/docs/docs/react/hooks/functions/useUpdateEffect.md index 98d66b45..229e56aa 100644 --- a/apps/docs/docs/react/hooks/functions/useUpdateEffect.md +++ b/apps/docs/docs/react/hooks/functions/useUpdateEffect.md @@ -14,4 +14,4 @@ ## Defined in -[packages/react/src/hooks/useUpdateEffect.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/react/src/hooks/useUpdateEffect.ts#L5) +[packages/react/src/hooks/useUpdateEffect.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/react/src/hooks/useUpdateEffect.ts#L5) diff --git a/apps/docs/docs/storage/functions/getLocalStorageItem.md b/apps/docs/docs/storage/functions/getLocalStorageItem.md index 4e977312..7ee5db4c 100644 --- a/apps/docs/docs/storage/functions/getLocalStorageItem.md +++ b/apps/docs/docs/storage/functions/getLocalStorageItem.md @@ -16,4 +16,4 @@ ## Defined in -[localStorage.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/localStorage.ts#L5) +[localStorage.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/localStorage.ts#L5) diff --git a/apps/docs/docs/storage/functions/getSessionStorageItem.md b/apps/docs/docs/storage/functions/getSessionStorageItem.md index 02d20ce2..4e26b6f9 100644 --- a/apps/docs/docs/storage/functions/getSessionStorageItem.md +++ b/apps/docs/docs/storage/functions/getSessionStorageItem.md @@ -16,4 +16,4 @@ ## Defined in -[sessionStorage.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/sessionStorage.ts#L5) +[sessionStorage.ts:5](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/sessionStorage.ts#L5) diff --git a/apps/docs/docs/storage/functions/removeLocalStorageItem.md b/apps/docs/docs/storage/functions/removeLocalStorageItem.md index 16073a8e..7b642f11 100644 --- a/apps/docs/docs/storage/functions/removeLocalStorageItem.md +++ b/apps/docs/docs/storage/functions/removeLocalStorageItem.md @@ -12,4 +12,4 @@ ## Defined in -[localStorage.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/localStorage.ts#L20) +[localStorage.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/localStorage.ts#L20) diff --git a/apps/docs/docs/storage/functions/removeSessionStorageItem.md b/apps/docs/docs/storage/functions/removeSessionStorageItem.md index 95e3096a..d0ed1ab2 100644 --- a/apps/docs/docs/storage/functions/removeSessionStorageItem.md +++ b/apps/docs/docs/storage/functions/removeSessionStorageItem.md @@ -12,4 +12,4 @@ ## Defined in -[sessionStorage.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/sessionStorage.ts#L20) +[sessionStorage.ts:20](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/sessionStorage.ts#L20) diff --git a/apps/docs/docs/storage/functions/setLocalStorageItem.md b/apps/docs/docs/storage/functions/setLocalStorageItem.md index 2b70ad7c..36266e69 100644 --- a/apps/docs/docs/storage/functions/setLocalStorageItem.md +++ b/apps/docs/docs/storage/functions/setLocalStorageItem.md @@ -14,4 +14,4 @@ ## Defined in -[localStorage.ts:1](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/localStorage.ts#L1) +[localStorage.ts:1](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/localStorage.ts#L1) diff --git a/apps/docs/docs/storage/functions/setSessionStorageItem.md b/apps/docs/docs/storage/functions/setSessionStorageItem.md index 1247c73f..45ff7da9 100644 --- a/apps/docs/docs/storage/functions/setSessionStorageItem.md +++ b/apps/docs/docs/storage/functions/setSessionStorageItem.md @@ -14,4 +14,4 @@ ## Defined in -[sessionStorage.ts:1](https://github.com/mbti-nf-team/frontend-libraries/blob/08b9d43288f72c3d793bb8f598c64f689d769c2e/packages/storage/src/sessionStorage.ts#L1) +[sessionStorage.ts:1](https://github.com/mbti-nf-team/frontend-libraries/blob/3916286534b50dbdcab9c2145adbaa464419b886/packages/storage/src/sessionStorage.ts#L1) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index e313f9a9..bd432c2d 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,4 @@ export { - checkEmpty, checkNumber, emptyAThenB, generateArrayOfNumber, - isEmpty, removeNullable, trueOrFalse, + createNumberArray, emptyAThenB, ensureArray, + getNumberOrDefault, getStringOrDefault, isEmpty, trueOrFalse, } from './utils'; diff --git a/packages/core/src/utils.test.ts b/packages/core/src/utils.test.ts index ff6cef7e..bd36b164 100644 --- a/packages/core/src/utils.test.ts +++ b/packages/core/src/utils.test.ts @@ -1,18 +1,18 @@ import { - checkEmpty, - checkNumber, + createNumberArray, emptyAThenB, - generateArrayOfNumber, + ensureArray, + getNumberOrDefault, + getStringOrDefault, isEmpty, - removeNullable, trueOrFalse, } from './utils'; -describe('removeNullable', () => { +describe('getStringOrDefault', () => { context('value가 null일 경우', () => { context('replacementValue가 존재하지 않는 경우', () => { it('빈 문자열을 반환해야만 한다', () => { - const result = removeNullable(null); + const result = getStringOrDefault(null); expect(result).toBe(''); }); @@ -20,7 +20,7 @@ describe('removeNullable', () => { context('replacementValue가 존재하는 경우', () => { it('대체할 문자열(두 번째 인자)을 반환해야만 한다', () => { - const result = removeNullable(undefined, '-'); + const result = getStringOrDefault(undefined, '-'); expect(result).toBe('-'); }); @@ -29,25 +29,33 @@ describe('removeNullable', () => { context('value가 null이 아닌 경우', () => { it('입력된 값이 반환되어야만 한다', () => { - const result = removeNullable('nana'); + const result = getStringOrDefault('nana'); expect(result).toBe('nana'); }); }); }); -describe('checkNumber', () => { +describe('getNumberOrDefault', () => { context('value가 null인 경우', () => { it('0을 반환해야 한다', () => { - const result = checkNumber(null); + const result = getNumberOrDefault(null); expect(result).toBe(0); }); + + context('defaultValue가 존재하는 경우', () => { + it('defaultValue를 반환해야 한다', () => { + const result = getNumberOrDefault(null, 100); + + expect(result).toBe(100); + }); + }); }); context('value가 null이 아닌 경우', () => { it('입력된 값이 반환되어야 한다', () => { - const result = checkNumber(100); + const result = getNumberOrDefault(100); expect(result).toBe(100); }); @@ -94,10 +102,10 @@ describe('trueOrFalse', () => { }); }); -describe('checkEmpty', () => { +describe('ensureArray', () => { context('value가 undefined이거나 빈 배열인 경우', () => { it('빈 배열을 반환해야만 한다', () => { - const result = checkEmpty(); + const result = ensureArray(); expect(result).toEqual([]); }); @@ -107,7 +115,7 @@ describe('checkEmpty', () => { const mockArray = ['test', 'test2']; it('입력된 값이 반환되어야 한다', () => { - const result = checkEmpty(mockArray); + const result = ensureArray(mockArray); expect(result).toEqual(mockArray); }); @@ -140,9 +148,9 @@ describe('isEmpty', () => { }); }); -describe('generateArrayOfNumber', () => { +describe('createNumberArray', () => { it('길이가 5인 배열을 반환해야만한다', () => { - const result = generateArrayOfNumber(5); + const result = createNumberArray(5); expect(result.length).toBe(5); }); diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index f3e4cc79..0369ac30 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -11,7 +11,7 @@ * @param replacementValue - 두 번째 인자에 값이 존재하는 경우 첫 번째 인자가 `null` 또는 `undefined`인 경우 두번째 인자로 문자열 대체 * @returns */ -export const removeNullable = (value?: string | null, replacementValue?: string): string => { +export const getStringOrDefault = (value?: string | null, replacementValue?: string): string => { if (value) { return value; } @@ -23,13 +23,10 @@ export const removeNullable = (value?: string | null, replacementValue?: string) return ''; }; -export const checkNumber = (value?: number | null): number => { - if (typeof value === 'number') { - return value; - } - - return 0; -}; +export const getNumberOrDefault = ( + value?: number | null, + defaultValue = 0, +): number => value ?? defaultValue; export const emptyAThenB = (b: string, a?: string | null): string => a || b; @@ -41,7 +38,7 @@ export const trueOrFalse = (value?: string | null | number | boolean): boolean = return true; }; -export const checkEmpty = (value?: T[]): T[] => { +export const ensureArray = (value?: T[]): T[] => { if (!value || !value.length) { return []; } @@ -61,4 +58,4 @@ export const isEmpty = (value?: T[]) => { return true; }; -export const generateArrayOfNumber = (length: number) => Array.from({ length }, (_, i) => i); +export const createNumberArray = (length: number) => Array.from({ length }, (_, i) => i);