import { Dictionary } from './declarations' ; export const modulePrefix = 'local' ; export function localKey ( key , moduleName ) { return [ modulePrefix , moduleName , key ] . join ( '/' ) ; } export function mapKeys < T > ( obj , f ) { const res = { } ; Object . keys ( obj ) . forEach ( key => { res [ f ( obj [ key ] , key ) ] = obj [ key ] ; } ) ; return res ; } export function mapValues < T , U > ( obj , f ) { const res = { } ; Object . keys ( obj ) . forEach ( key => { res [ key ] = f ( obj [ key ] , key ) ; } ) ; return res ; } export function isObject ( value ) { return value !== null && typeof value === 'object' ; } export function warn ( message ) { console . error ( '[vuex-local] ' + message ) ; } export function assert ( condition , message ) { if ( ! condition ) { throw new Error ( '[vuex-local] ' + message ) ; } }