From 25217a571e0ac83bd2937e74b266f4793cca9254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gromit=20=28=EC=A0=84=EB=AF=BC=EC=9E=AC=29?= <64779472+ssi02014@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:50:58 +0900 Subject: [PATCH] docs(isPrimitive): fix isPrimitive function documentations (#331) * fix: isPrimitive function * docs: fix isPrimitive docs * docs: fix isPrimitive jsdoc --- docs/ko/reference/predicate/isPrimitive.md | 6 +++--- docs/reference/predicate/isPrimitive.md | 6 +++--- docs/zh_hans/reference/predicate/isPrimitive.md | 6 +++--- src/predicate/isPrimitive.ts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/ko/reference/predicate/isPrimitive.md b/docs/ko/reference/predicate/isPrimitive.md index fd61a835..7a469011 100644 --- a/docs/ko/reference/predicate/isPrimitive.md +++ b/docs/ko/reference/predicate/isPrimitive.md @@ -7,16 +7,16 @@ JavaScript 원시 값은 null, undefined, string, number, symbol, bigint를 말 ## 인터페이스 ```typescript -function isPrimitive(x: unknown): x is null | undefined | string | number | boolean | symbol | bigint; +function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint; ``` ### 파라미터 -- `x` (`unknown`): 검사할 값. +- `value` (`unknown`): 검사할 값. ### 반환 값 -(`x is null | undefined | string | number | boolean | symbol | bigint`): 값이 원시 값이면 `true`, 아니면 `false`. +(`value is null | undefined | string | number | boolean | symbol | bigint`): 값이 원시 값이면 `true`, 아니면 `false`. ## 예시 diff --git a/docs/reference/predicate/isPrimitive.md b/docs/reference/predicate/isPrimitive.md index 0c564f89..b6f2caf7 100644 --- a/docs/reference/predicate/isPrimitive.md +++ b/docs/reference/predicate/isPrimitive.md @@ -7,16 +7,16 @@ JavaScript primitives include null, undefined, strings, numbers, booleans, symbo ## Signature ```typescript -function isPrimitive(x: unknown): x is null | undefined | string | number | boolean | symbol | bigint; +function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint; ``` ### Parameters -- `x` (`unknown`): The value to check. +- `value` (`unknown`): The value to check. ### Returns -(`x is null | undefined | string | number | boolean | symbol | bigint`): True if the value is a primitive, otherwise false. +(`value is null | undefined | string | number | boolean | symbol | bigint`): True if the value is a primitive, otherwise false. ## Examples diff --git a/docs/zh_hans/reference/predicate/isPrimitive.md b/docs/zh_hans/reference/predicate/isPrimitive.md index d35e8fe2..44830bbb 100644 --- a/docs/zh_hans/reference/predicate/isPrimitive.md +++ b/docs/zh_hans/reference/predicate/isPrimitive.md @@ -7,16 +7,16 @@ JavaScript 的原始类型包括 null、undefined、字符串、数字、布尔 ## 签名 ```typescript -function isPrimitive(x: unknown): x is null | undefined | string | number | boolean | symbol | bigint; +function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint; ``` ### 参数 -- `x` (`unknown`): 要检查的值。 +- `value` (`unknown`): 要检查的值。 ### 返回 -(`x is null | undefined | string | number | boolean | symbol | bigint`): 如果值是原始类型则返回 true,否则返回 false。 +(`value is null | undefined | string | number | boolean | symbol | bigint`): 如果值是原始类型则返回 true,否则返回 false。 ## 示例 diff --git a/src/predicate/isPrimitive.ts b/src/predicate/isPrimitive.ts index b80f8ff4..46dcde04 100644 --- a/src/predicate/isPrimitive.ts +++ b/src/predicate/isPrimitive.ts @@ -2,15 +2,15 @@ * Checks whether a value is a JavaScript primitive. * JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints. * - * @param {unknown} x The value to check. - * @returns {x is + * @param {unknown} value The value to check. + * @returns {value is * | null * | undefined * | string * | number * | boolean * | symbol - * | bigint} Returns true if `x` is a primitive, false otherwise. + * | bigint} Returns true if `value` is a primitive, false otherwise. */ export function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint { return value == null || (typeof value !== 'object' && typeof value !== 'function');