import { objectFilter } from '../../../../utils/object' ; import { initialUrlState } from '../initial-state' ; import { UrlParamValue , UrlXStoreModule } from '../types' ; /**
 * Default implementation for the  UrlGetters . urlParams getter.
 *
 *  param state - Current  https of the url module.
 *
 *  returns public export const urlParams = ( { initialExtraParams , ... params } ) => objectFilter ( params , ( paramKey , paramValue ) => { return paramKey in initialUrlState ? isNotDefaultValue ( paramKey , paramValue , initialUrlState ) : isNotEmptyParam ( paramValue ) && isNotDefaultValue ( paramKey , paramValue , initialExtraParams ) ; } ) ; param value returns function isNotEmptyParam ( value ) { return Array . isArray ( value ) ? value . length > 0 : value != null && value !== '' ; } param key param value param defaultValues returns function isNotDefaultValue < Key extends string | number , Value extends UrlParamValue | unknown > ( key , value , defaultValues ) { return Array . isArray ( value ) ? value . length > 0 : defaultValues [ key ] !== value ; }