Socket
Socket
Sign inDemoInstall

path-parser

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-parser - npm Package Compare versions

Comparing version 4.2.0 to 5.0.0

dist/index.d.ts

17

CHANGELOG.md

@@ -0,1 +1,18 @@

# [5.0.0](https://github.com/troch/path-parser/compare/v4.2.0...v5.0.0) (2019-12-29)
### Bug Fixes
* use encodeURIComponent to encode URL params ([#43](https://github.com/troch/path-parser/issues/43)) ([946d256](https://github.com/troch/path-parser/commit/946d2563a3cabe3b22fc14c679045ef8a8519821))
### Maintenance
* upgrade all dev dependencies ([#42](https://github.com/troch/path-parser/issues/42)) ([b294b17](https://github.com/troch/path-parser/commit/b294b17fdadd37db399469c10920eb1850652fd8))
### BREAKING CHANGES
* default export has been removed, now `Path` is only available as a named export.
<a name="4.2.0"></a>

@@ -2,0 +19,0 @@ # [4.2.0](https://github.com/troch/path-parser/compare/v4.1.1...v4.2.0) (2018-07-11)

109

package.json
{
"name": "path-parser",
"version": "4.2.0",
"description": "A small utility to parse, match and generate paths",
"main": "dist/cjs/path-parser.js",
"jsnext:main": "dist/es/path-parser.js",
"module": "dist/es/path-parser.js",
"sideEffects": false,
"typings": "./typings/Path.d.ts",
"scripts": {
"test": "mocha -r ts-node/register 'test/main.js'",
"lint": "tslint modules/*.ts",
"build": "npm run clean && rollup -c rollup.config.js",
"clean": "rimraf dist && rimraf temp",
"clog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"precommit": "lint-staged"
},
"lint-staged": {
"modules/*.ts": [
"prettier --write",
"tslint",
"git add"
],
"test/*.js": [
"prettier --write",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/troch/path-parser.git"
},
"keywords": [
"path",
"parser",
"url",
"route",
"match",
"partial match",
"regex"
],
"author": "Thomas Roch",
"license": "ISC",
"bugs": {
"url": "https://github.com/troch/path-parser/issues"
},
"homepage": "https://github.com/troch/path-parser",
"devDependencies": {
"conventional-changelog": "~1.1.18",
"conventional-changelog-cli": "~2.0.1",
"husky": "~0.14.3",
"lint-staged": "~7.0.0",
"mkdirp": "~0.5.1",
"mocha": "~5.0.4",
"prettier": "~1.11.1",
"rimraf": "~2.6.2",
"rollup": "~0.57.1",
"rollup-plugin-typescript2": "~0.12.0",
"should": "~13.2.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"tslint-config-prettier": "~1.10.0",
"typescript": "~2.7.2"
},
"dependencies": {
"search-params": "2.1.3"
"name": "path-parser",
"version": "5.0.0",
"description": "A small utility to parse, match and generate paths",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/path-parser.esm.js",
"sideEffects": false,
"files": [
"dist",
"LICENSE"
],
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"clog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"author": "Thomas Roch",
"repository": {
"type": "git",
"url": "https://github.com/troch/path-parser.git"
},
"bugs": {
"url": "https://github.com/troch/path-parser/issues"
},
"homepage": "https://github.com/troch/path-parser",
"dependencies": {
"search-params": "2.1.3"
},
"devDependencies": {
"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"
}
}

@@ -12,7 +12,6 @@ [![npm version](https://badge.fury.io/js/path-parser.svg)](http://badge.fury.io/js/path-parser)

```javascript
import Path from 'path-parser'
import { Path } from 'path-parser'
// or
const Path = require('path-parser').default
const { Path } = require('path-parser')

@@ -49,6 +48,6 @@ const path = new Path('/users/:id')

* `:param`: for URL parameters
* `;param`: for matrix parameters
* `*splat`: for parameters spanning over multiple segments. Handle with care
* `?param1&param2` or `?:param1&:param2`: for query parameters. Colons `:` are optional.
- `:param`: for URL parameters
- `;param`: for matrix parameters
- `*splat`: for parameters spanning over multiple segments. Handle with care
- `?param1&param2` or `?:param1&:param2`: for query parameters. Colons `:` are optional.

@@ -60,4 +59,4 @@ #### Parameter constraints

* `:param<\\d+>` will match numbers only for parameter `param`
* `;id<[a-fA-F0-9]{8}` will match 8 characters hexadecimal strings for parameter `id`
- `:param<\\d+>` will match numbers only for parameter `param`
- `;id<[a-fA-F0-9]{8}` will match 8 characters hexadecimal strings for parameter `id`

@@ -76,6 +75,6 @@ Constraints are also applied when building paths, unless specified otherwise (set option flag `ignoreConstraints` to true).

### path.test(path: string, opts?: object): object | null;
Test if the provided path matches the defined path template. Options available are:
- `'caseSensitive'`: whether matching should be case sensitive or not (default to `false`)

@@ -85,6 +84,6 @@ - `'strictTrailingSlash'`: whether or not it should strictly match trailing slashes (default to `false`)

### path.partialTest(path: string, opts?: object): object | null;
Test if the provided path is partially matched (starts with) the defined path template. Options available are:
- `'caseSensitive'`: whether matching should be case sensitive or not (default to `false`)

@@ -94,6 +93,6 @@ - `'delimited'`: whether or not a partial match should only be successful if it reaches a delimiter (`/`, `?`, `.` and `;`). Default to `true`.

### path.build(params?: object, opts?: object): string;
Builds the defined path template with the provided parameters
- `'ignoreConstraints'`: whether or not to ignore parameter constraints (default to `false`)

@@ -104,7 +103,5 @@ - `'ignoreSearch'`: whether or not to build query parameters (default to `false`)

## Related modules
* [route-parser](https://github.com/rcs/route-parser)
* [url-pattern](https://github.com/snd/url-pattern)
- [route-parser](https://github.com/rcs/route-parser)
- [url-pattern](https://github.com/snd/url-pattern)

Sorry, the diff of this file is not supported yet

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