Skip to content

Commit

Permalink
feat: 增加symbol方法
Browse files Browse the repository at this point in the history
  • Loading branch information
Fullsize committed May 10, 2024
1 parent 23a6ecc commit 1be6d13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export { default as isEmpty } from './isEmpty'
export { default as isFunction } from './isFunction'
export { default as isNuil } from './isNuil'
export { default as isNull } from './isNull'
export { default as isObject } from './isObject'
export { default as isObject } from './isObject'
export { default as isSymbol } from './isSymbol'
9 changes: 9 additions & 0 deletions src/isSymbol.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* 检查一个值是否为Symbol类型。
* @param value 待检查的值。
* @returns 布尔值,表示值是否为Symbol类型。
*/
export default function isSymbol(value: unknown): boolean {
// 使用 typeof 检查值的类型是否为 'symbol'
return typeof value === 'symbol';
}

0 comments on commit 1be6d13

Please sign in to comment.