src/utils.js
/**
 * Ensures an object is returned if input value is not one.
 * ensureObject(value: Any) -> Object
 */
Ensures an object is returned if input value is not one.
Ensures an object is returned if input value is not one .
function ensureObject(value) {
  if (!value) { return {} }
  if (Array.isArray(value)) { return {} }
  if ('object' != typeof value) { return {} }
  return value
}
function ensureObject ( value ) { if ( ! value ) { return { } } if ( Array . isArray ( value ) ) { return { } } if ( 'object' != typeof value ) { return { } } return value }
Ensures an object is returned if input value is not one.
Ensures an object is returned if input value is not one .