UNPKG

hd-utils

Version:

A handy utils for modern JS developers

9 lines (8 loc) 268 B
/** * @description Shortcut function for checking if an object has a given property directly on itself. * @example has({a:1, b:2}, "a") => true * */ export default function has(objectType, key) { return Object.prototype.hasOwnProperty.call(objectType, key); }