🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@chaitin/querystring

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chaitin/querystring

Parse and stringify URL query strings

1.1.0
latest
Source
npm
Version published
Maintainers
6
Created
Source

querystring

Build Status Commitizen friendly

Parse and stringify URL query strings. Forked from query-string

Install

yarn add @chaitin/querystring

Usage

import { parse, stringify } from '@chaitin/querystring'

const result = parse("foo=foo&foo&foo=one&foo=&bat=buz")
// the result is:
{ bat: "buz", foo: ["foo", null, "one", ""] }

// result is sorted by key
let qs = stringify({
  page: "10",
  pageSize: 200,
  filter: ["aaa", "bbb", "ccc", 255]
})
qs === "filter=aaa&filter=bbb&filter=ccc&filter=255&page=10&pageSize=200"

// and you can disable sorting
qs = stringify({
  page: "10",
  pageSize: 200,
  filter: ["aaa", "bbb", "ccc", 255]
}, { sort: false })
qs === "page=10&pageSize=200&filter=aaa&filter=bbb&filter=ccc&filter=255"

License

MIT

FAQs

Package last updated on 01 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts