๐งผ Sanitise a URI to mitigate XSS and malformed URIs
npm install @sanitise/uri[size]: https://packagephobia.now.sh/badge?p=@sanitise/html
[size-url]: https://packagephobia.now.sh/result?p=@sanitise/html
[![size][size]][size-url]


๐งผ Sanitise a URI to mitigate XSS and malformed URIs
This module requires an Active LTS Node version (v14.15.0+).
Using npm:
``console`
npm install @sanitise/uri
`js
const { sanitise } = require('@sanitise/uri');
sanitise('http://bat.cave');
// โ 'http://bat.cave'
sanitise(javascript:alert('joker'));`
// โ undefined
This package follows the behavior of JSON.stringify. The following results for falsey values can be expected:
`js
sanitise(undefined);
// โ undefined
sanitise(null);
// โ 'null'
sanitise('');
// โ ''
`
Type: String''
Default:
Sets the default result value, should the uri` passed contain an invalid protocol.