New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@uppercod/exp-route

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppercod/exp-route

exp-route, designed to compare routes on the client based on simple expressions

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5K
increased by16.24%
Maintainers
1
Weekly downloads
 
Created
Source

@uppercod/exp-route

Path expression syntax for capturing parameters.

Install

npm install @uppercod/exp-route

Syntax

fixed route

/folder1/folrder2

parameter path

/folder1/{folder}

optional parameter path

/folder1/[folder]

spread parameter path

/folder1/[...folder]
/folder1/{...folder}

Api

declare module "@uppercod/exp-route" {
    export interface Params {
        [param: string]: string;
    }
    export type Match<T = Params> = (path: string) => T | undefined;
    /**
     * Separate the pathname from the search
     * @example
     * "/before?after" = ["/before","?after"]
     */
    export function getParts(path: string): [string, string];
    /**
     * Capture the search parameters of a string that begins with the character `?`
     * @example
     * "?id=10"
     * @param search
     * @param master - Object to be used to store the captured indices
     */
    export function searchParams<T = Params>(
        search: string,
        master?: Params
    ): T;
    /**
     * Create a callback to compare the route expression with the given route
     */
    export function createMatch<T = Params>(path: string): Match<T>;
}

FAQs

Package last updated on 17 Mar 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc