Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

search-params

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

search-params - npm Package Compare versions

Comparing version 2.1.3 to 3.0.0

dist/encode.d.ts

13

CHANGELOG.md

@@ -0,1 +1,14 @@

# [3.0.0](https://github.com/troch/search-params/compare/v2.1.3...v3.0.0) (2019-12-30)
### Maintain package
([#2](https://github.com/troch/search-params/issues/2)) ([f41f072](https://github.com/troch/search-params/commit/f41f0722c19bd896797fd24be7277a6ccf8f2138)):
- Update dev dependencies
- Switch to strict type checking (TypeScript)
- Add optional generic type to `parse` and `build`
- Fix bug on decoding values
<a name="2.1.3"></a>

@@ -2,0 +15,0 @@ ## [2.1.3](https://github.com/troch/search-params/compare/v2.1.2...v2.1.3) (2018-06-05)

61

package.json
{
"name": "search-params",
"version": "2.1.3",
"version": "3.0.0",
"description": "A module to manipulate search part of URLs (querystring)",
"main": "dist/cjs/index.js",
"jsnext:main": "dist/es/index.js",
"modules": "dist/es/index.js",
"main": "dist/index.js",
"module": "dist/search-params.esm.js",
"typings": "dist/index.d.ts",
"sideEffects": false,
"types": "typings/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean && rollup -c rollup.config.js",
"test": "mocha -r ts-node/register 'test/main.js'",
"precommit": "lint-staged",
"lint": "eslint modules/*.ts",
"clog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"lint-staged": {
"*.{js,ts,md}": [
"prettier --write",
"git add",
"tslint"
]
},
"files": [
"dist",
"LICENSE"
],
"repository": {

@@ -44,18 +32,23 @@ "type": "git",

"homepage": "https://github.com/troch/search-params#readme",
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint src test",
"prepare": "tsdx build",
"clog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"devDependencies": {
"chai": "~4.1.2",
"conventional-changelog-angular": "~1.6.6",
"conventional-changelog-cli": "~1.3.16",
"lint-staged": "~7.0.0",
"mkdirp": "~0.5.1",
"mocha": "~4.0.1",
"prettier": "~1.11.1",
"rimraf": "~2.6.2",
"rollup": "~0.57.1",
"rollup-plugin-typescript2": "~0.12.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"tslint-config-prettier": "~1.10.0",
"typescript": "~2.7.2"
"conventional-changelog-cli": "2.0.31",
"@types/jest": "^24.0.25",
"husky": "^3.1.0",
"tsdx": "^0.12.1",
"tslib": "^1.10.0",
"typescript": "^3.7.4"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint src test"
}
}
}

@@ -7,9 +7,9 @@ # search-params

#### parse: (path: string, opts?: IOptions) => object
#### parse: <T>(path: string, opts?: IOptions) => T
Parse a querystring and returns an object of parameters. See options below for available options.
Parse a querystring and returns an object of parameters. See options below for available options. Optional generic type can be provided.
#### build: (params: object, opts?: IOptions) => string
#### build: <T>(params: T, opts?: IOptions) => string
Build a querystring from a list of parameters
Build a querystring from a list of parameters. Optional generic type can be provided.

@@ -29,14 +29,14 @@ #### omit: (path: string, paramsToOmit: string[], opts?: IOptions) => IOmitResponse

- `arrayFormat`: Specifies how arrays should be stringified
- `'none'` (default): no brackets or indexes are added to query parameter names (`'role=member&role=admin'`)
- `'brackets`: brackets are added to query parameter names (`'role[]=member&role[]=admin'`)
- `'index'`: brackets and indexes are added to query parameter names (`'role[0]=member&role[1]=admin'`)
- `'none'` (default): no brackets or indexes are added to query parameter names (`'role=member&role=admin'`)
- `'brackets`: brackets are added to query parameter names (`'role[]=member&role[]=admin'`)
- `'index'`: brackets and indexes are added to query parameter names (`'role[0]=member&role[1]=admin'`)
- `booleanFormat`: specifies how boolean values are stringified and parsed
- `'none'` (default): booleans are stringified to strings (`'istrue=true&isfalse=false'`)
- `'empty-true'`: same as `'none'` except true values are stringified without value (`'istrue&isfalse=false'`). If you choose this boolean format, make sure to change the value of `'nullFormat'`.
- `'string'`: same as `'none'` but `'true'` and `'false'` are parsed as booleans
- `'unicode'`: `true` and `false` are displayed with unicode characters, and parsed as booleans (`'istrue=✓&isfalse=✗'`)
- `'none'` (default): booleans are stringified to strings (`'istrue=true&isfalse=false'`)
- `'empty-true'`: same as `'none'` except true values are stringified without value (`'istrue&isfalse=false'`). If you choose this boolean format, make sure to change the value of `'nullFormat'`.
- `'string'`: same as `'none'` but `'true'` and `'false'` are parsed as booleans
- `'unicode'`: `true` and `false` are displayed with unicode characters, and parsed as booleans (`'istrue=✓&isfalse=✗'`)
- `nullFormat`: specifies how null values are stringified and parsed
- `'default'` (default): null values are stringified without equal sign and value (`'isnull'`)
- `'string'`: null values are stringified to `'null'` (`'isnull=null'`) and parsed as null values
- `'hidden'`: null values are not stringified
- `'default'` (default): null values are stringified without equal sign and value (`'isnull'`)
- `'string'`: null values are stringified to `'null'` (`'isnull=null'`) and parsed as null values
- `'hidden'`: null values are not stringified

@@ -57,4 +57,4 @@ ## Example

build({
country: 'scotland',
town: 'glasgow'
country: 'scotland',
town: 'glasgow'
})

@@ -61,0 +61,0 @@ // 'country=scotland&town=glasgow'

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc