CoolFace
Apppublic

strong-tie/inbound-calls

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
1# fast-decode-uri-component2 3[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)  [![Build Status](https://travis-ci.org/delvedor/fast-decode-uri-component.svg?branch=master)](https://travis-ci.org/delvedor/fast-decode-uri-component)4 5Decodes strings encoded by `encodeURI` and `encodeURIComponent`, without throwing errors on invalid escapes, instead, it returns `null`.6 7 8## Installation9```10npm install fast-decode-uri-component11```12 13## Usage14```js15const fastDecode = require('fast-decode-uri-component')16 17console.log(fastDecode('test')) // 'test'18console.log(fastDecode('%25')) // '%'19console.log(fastDecode('/test/hel%2Flo')) // '/test/hel/lo'20 21console.log(fastDecode('/test/hel%"Flo')) // null22console.log(fastDecode('%7B%ab%7C%de%7D')) // null23console.log(fastDecode('%ab')) // null24```25 26## Benchmarks27You can find the benchmark file [here](https://github.com/delvedor/fast-decode-uri-component/blob/master/bench.js).28```29# fast-decode-uri-component30ok ~539 ms (0 s + 539114308 ns)31 32# decodeURIComponent33ok ~6.06 s (6 s + 62305153 ns)34```35 36## Acknowledgements37This project has been forked from [`jridgewell/safe-decode-uri-component`](https://github.com/jridgewell/safe-decode-uri-component) because I wanted to change the behaviour of the library on invalid inputs, plus change some internals.<br>38All the credits before the commit [`53000fe`](https://github.com/delvedor/fast-decode-uri-component/commit/53000feb8c268eec7a24620fd440fdd540be32b7) goes to the `jridgewell/safe-decode-uri-component` project [contributors](https://github.com/delvedor/fast-decode-uri-component/graphs/contributors).<br>39Since the commit [`9673ab7`](https://github.com/delvedor/fast-decode-uri-component/commit/9673ab7820ef92081206a9f4fd158ffe9a352861) the project will be maintained by [**@delvedor**](https://github.com/delvedor).40 41## License42 43Licensed under [MIT](./LICENSE).44