@zstings/utils
Version:
javascript、typescript 工具函数库 文档地址 [utils 文档](https://zstings.github.io/utils/)
14 lines (13 loc) • 359 B
TypeScript
/**
* 检查指定对象是否存在指定属性
* @param target 指定对象
* @param key 要检查的属性
* @return true | false
* @category 对象Object
* @example
* ```ts
* hasOwn({a: 1, b: 0}, 'b') // => true
* hasOwn({a: 1, b: 0}, 'c') // => false
* ```
*/
export default function hasOwn(target: Record<string, any>, key: string): boolean;