Socket
Socket
Sign inDemoInstall

@chaitin/querystring

Package Overview
Dependencies
0
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @chaitin/querystring

Parse and stringify URL query strings


Version published
Weekly downloads
980
decreased by-9.34%
Maintainers
6
Install size
23.7 kB
Created
Weekly downloads
 

Readme

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

Last updated on 01 Aug 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc