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

@bit-js/blitz

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bit-js/blitz - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "@bit-js/blitz",
"main": "lib/index.js",
"version": "1.2.0",
"version": "1.2.1",
"type": "module",

@@ -6,0 +6,0 @@ "devDependencies": {

@@ -73,2 +73,31 @@ # Blitz

### URL routers
These are internals router built for path matching only.
```ts
import { internal } from '@bit-js/blitz';
// Blitz router with only path matching
const router = new internal.Radix<number>();
// EdgeRouter with only path matching;
const router = new internal.Edge<number>();
// Register routes
router.put('/', 0);
router.put('/:id', 1);
router.put('/*', 2);
// Merging routes
router.merge(otherInternalRouter);
// Get the matching function
const f = router.buildMatcher({}, 3);
f(ctx);
```
The match context only has:
`ctx.path`: The parsed pathname.
`ctx.params`: The output parameters.
### FS router

@@ -111,2 +140,10 @@ A cross-runtime file system router API.

#### Route style
Route style is a function that accepts a relative path and returns the correct route pattern.
```ts
type Style = (path: string) => string | null;
```
If the return result is null the path will be ignored.
#### Default style

@@ -113,0 +150,0 @@ - `basic`: NextJS route style (wildcard only supports `[...]` and wildcard parameter name is always `$`).

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