export function cleanPath ( path ) { return path . replace ( /^[\#]*[\/]*(.*)/ , '$1' ) . replace ( /\/+$/ , '' ) ; } export function getParam ( paramName , url ) { const href = url || window . location . href ; const name = paramName . replace ( /[[]]/g , '\\$&' ) ; const regex = new RegExp ( `[?&]${ name }(=([^&#]*)|&|#|$)` ) ; const results = regex . exec ( href ) ; if ( ! results ) return null ; if ( ! results [ 2 ] ) return '' ; return decodeURIComponent ( results [ 2 ] . replace ( /\+/g , ' ' ) ) ; } export function convertToArray ( arr ) { return [ ... arr ] ; } export function isObject ( obj ) { return typeof obj === 'object' ; } export function includes ( arr , id ) { return arr . indexOf ( id ) !== - 1 ; }