/whitelist-query-params

Filter url query parameters with a whitelist

Primary LanguageJavaScriptMIT LicenseMIT

Whitelist query params Build Status

Filter url query parameters with a whitelist

Table of Contents

Install

npm i whitelist-query-params

# Or with Yarn
yarn add whitelist-query-params

Usage

import whitelistQueryParams from 'whitelist-query-params';

const url = whitelistQueryParams('http://www.example.org/?foo=bar&baz=qux', ['foo']);

console.log(url); // http://www.example.org/?foo=bar

Contributing

See the contribute file!

PRs accepted.

License

MIT © Michael Leaney