object-placeholder
Version:
It's a zero-dependency package that exports default function: ```text placeholder(<template>, <data>, <options>) ``` and function with named params: ```text placeholder.replace({ template, data, options }) ``` where: - `template` - some template ( [string
15 lines (13 loc) • 402 B
JavaScript
module.exports = isPlainObject
/**
* Figure out if the value is plain object
* @param {*} value The value
* @return {Boolean}
*/
function isPlainObject (value) {
if (typeof value !== 'object' || value === null) {
return false
}
const prototype = Object.getPrototypeOf(value)
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null)
}