docs(isPrimitive): fix isPrimitive function documentations (#331)

* fix: isPrimitive function

* docs: fix isPrimitive docs

* docs: fix isPrimitive jsdoc
This commit is contained in:
Gromit (전민재) 2024-07-31 21:50:58 +09:00 committed by GitHub
parent 876931405a
commit 25217a571e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 12 deletions

View File

@ -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`.
## 예시

View File

@ -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

View File

@ -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。
## 示例

View File

@ -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');