0.4.2 • Published 5 years ago

safe-uri-path v0.4.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

safe-uri-path

CircleCI codecov npm version

A module to safely parse uri paths.

Why? :thinking:

There are times that a string path will contain special characters. Imagine you are using a cat api and someone named a cat cat?*=my&cat. That is not a valid part of a url if someone was to include it. This library helps parsing correctly any uri paths :tada:

Install :metal:

yarn add --save safe-uri-path

Example

const safeUriPath = require('safe-uri-path');

const cat = 'cat';
// weird string with special characters
const weirdCat = 'cat?format=json';

const uriPath = safelyParseUri`/${cat}/${weirdCat}`;

Contributing

  1. Fork it (https://github.com/George-Aidonidis/safe-uri-path/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

MIT ©

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago