@ou-imdt/utils
Version:
Utility library for interactive media development
11 lines • 349 B
JavaScript
/**
* Checks if a given value is a plain object.
*
* @param {any} obj - The value to check.
* @returns {boolean} `true` if the value is a plain object, otherwise `false`.
*/
export default function isPlainObject(obj) {
return (obj !== null) &&
(typeof obj === 'object') &&
[null, Object.prototype].includes(Object.getPrototypeOf(obj));
}