This package has been deprecated

Author message:

"@now/routing-utils" is deprecated and will stop receiving updates on December 31, 2020. Please use "@vercel/routing-utils" instead.

@now/routing-utils
TypeScript icon, indicating that this package has built-in type declarations

1.9.1 • Public • Published

@now/routing-utils

Route validation utilities

Usage

yarn add @now/routing-utils

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

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

if (error) {
  console.log(error.code, error.message);
}
import { routesSchema } from '@now/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);

Readme

Keywords

none

Package Sidebar

Install

npm i @now/routing-utils

Weekly Downloads

4

Version

1.9.1

License

MIT

Unpacked Size

41.1 kB

Total Files

14

Last publish

Collaborators

  • matt.straka
  • vercel-release-bot
  • rauchg
  • matheuss
  • javivelasco
  • nkzawa
  • timneutkens
  • tootallnate
  • quietshu
  • zeit-bot
  • styfle
  • timer
  • lucleray