1.0.5 • Published 8 years ago

update-query v1.0.5

Weekly downloads
432
License
MIT
Repository
github
Last release
8 years ago

updateQuery(url, Object)

npm version npm download build

Update the query string of a url with the given object

Installation

npm i update-query -S

alternatively:<script src="dist/update-query.min.js"></script>

Usage

Any falsey value is omitted except 0

> updateQuery('test.com?a=1', { b: 2 })
'test.com?a=1&b=2'

> updateQuery('test.com?a=1&b=2', { a: 0, b: 3 })
'test.com?a=0&b=3'

> updateQuery('test.com?a=1&b=2', { a: '', b: null })
'test.com'

Build

npm run build, output will be piped into dist/

Test & Coverage

npm test & npm run cov

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago