analytics-util-params
v0.1.2
Published
Url Parameter helper functions
Downloads
14
Maintainers
Readme
Param utilities
URI param utilities for analytics
getParams
, removeParams
, replaceParams
getParams
import { getParams } from '@analytics/param-utils'
/* Get url params */
const params = getParams()
removeParams
import { removeParams } from '@analytics/param-utils'
/* Get url params */
removeParams('foo')
replaceParams
import { replaceParams } from '@analytics/param-utils'
// Replace
replaceParams('foo')
Params Parse benchmark
Decode:
@analytics/param-utils x 189,959 ops/sec ±0.91% (91 runs sampled)
qs x 152,998 ops/sec ±1.41% (90 runs sampled)
querystringify x 240,017 ops/sec ±1.32% (90 runs sampled)
query-string x 172,217 ops/sec ±0.67% (91 runs sampled)
native x 179,175 ops/sec ±0.88% (88 runs sampled)
qss x 391,393 ops/sec ±0.99% (91 runs sampled)
Details
Open API Query Params Query API ref jQuery Param URL spec
Alt libraries
- https://github.com/Sage/jsurl
- https://github.com/QubitProducts/urlite