Namespace: Basic:isPlainObject

Basic:isPlainObject

Source:

Methods

isPlainObject(value) → {Boolean}

Returns if a value is an object literal, so so-called "plain object. A plain object is something like "{hello : 'world'}".

This might especially be helpful when dealing with JSON configs, so quickly check if something might even be parsed JSON (which in most cases is a plain object in js).

Be aware that this function cannot differentiate between constructor-based simple objects and plain objects declared inline. So, if someone took on the work to instantiate a base object and assign properties either in a function or a constructor, we accept that as a plain object.

Parameters:
Name Type Description
value *

the value to check

Source:
Returns:
true if value seems to be a plain object
Type
Boolean
Example
const isParameterConfigObject = isPlainObject(param);