import { DataMap } from '../types' ; export function identity < T > ( x ) { return x ; } export function isDataMap ( obj ) { return ! ! obj && typeof obj === 'object' && ! Array . isArray ( obj ) ; } export const isDevelopment = ( ) => typeof process !== 'undefined' && process . env . NODE_ENV !== 'production' ; export function assertDataMap ( obj , name ) { if ( ! isDataMap ( obj ) ) { if ( isDevelopment ( ) ) { throw TypeError ( `'${ name }' should be an object` ) ; } return false ; } return true ; }