import isFunction from 'lodash/isFunction' ; import trim from 'lodash/trim' ; export function assert ( condition , msg ) { if ( ! condition ) throw new Error ( `[vue.access.control] ${ msg }` ) ; } export function isPromiseLike ( item ) { return item && isFunction ( item . then ) ; } export function stringToArrayArgs ( arg ) { return arg . split ( ',' ) . map ( function ( item ) { let result = trim ( item ) ; if ( [ 'true' , 'false' ] . indexOf ( result . toLowerCase ( ) ) !== - 1 ) { result = result . toLowerCase ( ) === 'true' ; } return result ; } ) ; }