UNPKG

@zstings/utils

Version:

javascript、typescript 工具函数库 文档地址 [utils 文档](https://zstings.github.io/utils/)

38 lines (37 loc) 567 B
/** * 获取数据类型 * @param value 任意值 * @return 返回value的类型 * @category 工具Util * @example * 数字 * ```ts * typeOf(12) => 'Number' * ``` * @example * 字符串 * ```ts * typeOf('12') => 'String' * ``` * @example * 布尔 * ```ts * typeOf(true) => 'Boolean' * ``` * @example * 函数 * ```ts * typeOf(functuin(){}) => 'Function' * ``` * @example * 对象 * ```ts * typeOf({}) => 'Object' * ``` * @example * 数组 * ```ts * typeOf([]) => 'Array' * ``` */ export default function typeOf(value: any): string;