Socket
Socket
Sign inDemoInstall

@vercel/routing-utils

Package Overview
Dependencies
7
Maintainers
9
Versions
80
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vercel/routing-utils

Vercel routing utilities


Version published
Weekly downloads
485K
increased by4.81%
Maintainers
9
Install size
1.95 MB
Created
Weekly downloads
 

Readme

Source

@vercel/routing-utils

Route validation utilities

Usage

npm add @vercel/routing-utils

import { normalizeRoutes } from '@vercel/routing-utils';

const { routes, error } = normalizeRoutes(inputRoutes);

if (error) {
  console.log(error.code, error.message);
}
import { routesSchema } from '@vercel/routing-utils';

const ajv = new Ajv();
const validate = ajv.compile(routesSchema);
const valid = validate([{ src: '/about', dest: '/about.html' }]);

if (!valid) console.log(validate.errors);

FAQs

Last updated on 20 Oct 2023

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