multi-path-matcher
Advanced tools
Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "multi-path-matcher", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"type": "module", | ||
@@ -37,3 +37,3 @@ "publishConfig": { | ||
"engines": { | ||
"node": ">=10.16.1" | ||
"node": ">=10.16.2" | ||
}, | ||
@@ -40,0 +40,0 @@ "repository": { |
@@ -21,2 +21,3 @@ [![npm](https://img.shields.io/npm/v/multi-path-matcher.svg)](https://www.npmjs.com/package/multi-path-matcher) | ||
With paramus | ||
```js | ||
@@ -43,2 +44,23 @@ import { compile, matcher } from "multi-path-matcher"; | ||
With wildcards | ||
```js | ||
import { compile, matcher } from "multi-path-matcher"; | ||
const routes = [ | ||
{ path: "/" }, | ||
{ path: "/*" }, | ||
{ path: "/about"}, | ||
{ path: "/login" } | ||
]; | ||
const compiled = compile(routes); | ||
matcher(compiled "/"); // routes[0] | ||
matcher(compiled "/index.html"); // routes[1] | ||
matcher(compiled "/about"); // routes[2] | ||
matcher(compiled "/login"); // routes[3] | ||
``` | ||
# API | ||
@@ -45,0 +67,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10461
85
167