Skip to content

thephoenixofthevoid/lexicographic-path-encoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lexicographic-path-encoding

console.log(lexicographic_path.encode("/simple/paths/now/is/supported"))                             
// "KJsimple"Jpaths"Jnow"Jis"Jsupported!"

console.log(lexicographic_path.decode(lexicographic_path.encode("/simple/paths/now/is/supported")))  
// "/simple/paths/now/is/supported"

lexicographic ordering is provided through the charwise (https://github.com/dominictarr/charwise) encoding

Valid paths

A string is considered a path if it satisfies the following RE:

const RE_PATH = /^(\/[a-zA-Z0-9.#_:-]+)+$/

List of examples:

/api/v3/create   VALID
/api/v3          VALID
/api             VALID
/                INVALID
/api/v3/create/  INVALID
/api/v3//create  INVALID

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published