New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tidy-path-tree

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tidy-path-tree

tidy file upload plugin

latest
Source
npmnpm
Version
1.0.19
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

tidy-path-tree

Path tree that used Prefix Tree(Trie Tree)

Installation

$ npm install tidy-path-tree --save

Usage

// for typescript

import { PathTree } from 'tidy-path-tree'

const tree = new PathTree<string>()
tree.add('/a/b/:name', 'data')


/**
 * will returns : {
 *          path: 'a/b/:name',
  *         params: {
  *             name: 'tidy'
  *         }
  *     }
 */
const found = tree.find('/a/b/tidy')    

Path Grammar

    Path:  Layer  ( Layer Delimiter )*  GlobStarEnd?
    
    Layer: Seg*
    Seg: Param  |  Text  |  ReGroup
    
    GlobStarEnd: Delimiter "**"
    
    ReGroup: "("  <RegularExpressBody>  ")"
    
    Text: TextChar+
    TextChar:
      - <Char not Delimiter && not in '\r\n:(/?\\'>
      - BackslashChar
    BackslashChar: "\"  <Char not in "\r\n">
    
    Param = ":"  <JSIdentifier>  "*"?  ( ReGroup "*"? )?

Path examples:

  • /
  • /part1
  • part1/part2
  • /part1/part2/**
  • /test/:name/:type
  • /test/:country([a-z]+)/:name([a-z]+)?/:code?([0-9]+)

FAQs

Package last updated on 28 Mar 2019

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