MCPcopy Create free account
hub / github.com/chunshand/qdev / isArray

Function isArray

admin/src/utils/validate.ts:2–4  ·  view source on GitHub ↗
(arg: unknown)

Source from the content-addressed store, hash-verified

1/** 判断是否为数组 */
2export const isArray = (arg: unknown) => {
3 return Array.isArray ? Array.isArray(arg) : Object.prototype.toString.call(arg) === "[object Array]"
4}
5
6/** 判断是否为字符串 */
7export const isString = (str: unknown) => {

Callers 2

validate.test.tsFile · 0.90
catchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected