1.0.0 • Published 5 years ago

lossy-encode-to-uri v1.0.0

Weekly downloads
5
License
(ISC OR GPL-3.0)
Repository
github
Last release
5 years ago

NPM version Downloads Rate on Openbase

Performs a lossy transformation into a format that can be inserted into a URI path component.

Requirements

It runs inside any webbrowser (starting at IE11 and up) or NodeJS environment.

It has zero dependencies on other modules.

Reference documentation

  • LossyEncode2URI.encode(string) Performs a lossy transformation of string into a format that can be inserted into a URI path component:
    • Cast to lowercase.
    • Replace diacritics by their ASCII equivalent.
    • Replace all strings of non-alphanumeric characters with single dashes.
    • Strip dashes from start and end.

References

Card-carrying member of the zerodeps movement.