{"name":"@braintree/sanitize-url","version":"3.0.0","keywords":[],"author":"","license":"MIT","_id":"@braintree/sanitize-url@3.0.0","homepage":"https://github.com/braintree/sanitize-url#readme","bugs":{"url":"https://github.com/braintree/sanitize-url/issues"},"dist":{"shasum":"a0ce629d18d4d435f23a0b880098cff7d99e8bb3","tarball":"http://registry-npm.ywwl.com/@braintree/sanitize-url/download/@braintree/sanitize-url-3.0.0.tgz","fileCount":7,"integrity":"sha512-ymeXC1qObTag/hhEG7BoTMdIzuhKekTxNJTIfiVXsoP1fUXHKBpr0EfCsSA06BuP5gxTPs2vDKjtmYbgvEfY+g==","signatures":[{"sig":"MEYCIQDym+BAapg7oYe3HX0L9M97IgW/RJ766koBP5jt8f9K0gIhALgzp50LgoVBfYbCNlPlxUBvCa/aIWvOskfGJslpereP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJP+dCRA9TVsSAnZWagAADIIP/Rmpg50HdnVlcY3848yC\nCiJDVznCue0R8jMK+liOCGAxipdkXFI7Hosngkr4LocOpIcxRMn/EOEKMFaP\n+ZgicUs4wWLqkPb8FAMrssY6X56/0qac8efSIjvjRWnIrJTIpnS8fL5sAzoe\ngP/r60raxhqHND/jhUBEBq2TuG9xCY+WDa10SlUP9NCeZr118iiiqN51z/E6\nrMG3q3T36AC7Z8/jqq3EGcEYx0TmPHzugC7ZzNvTDIC5sfFqUFF+QsJPaZ4f\naegWcAsCM8zVTZpheehrZ3H7HDZOLjjgboCDRhTGT5VU6e1Tuz1POQL2palM\nO5c614gB6CnCIAJWz6GYqS69GcccaMPYX/ZGXDUGrMt1oGYqOkDbMf3t6QrZ\nU195/6djKPYtJo7wCFp6XiD3fi5R+pnQk4fZreZC156x4dtIRgWbNLCd0eF0\n9Ul+F81DVG3GUyFHTnehNy7x20plojrvWWdinsPth0ns6SWVT9+DAplUjc6g\ntOBtuUvCY+eCfYiJy7g7YNjLczmWyApS70WZprMbxaQ81i9V8mZjbEAbNydl\nPsyWlmWyY80N4SxHiaOI7iIohRp9yDc/Gbni72FXjg8nkcbXQjS4rSMjn82v\nwEFu0uPHVWyqeUX2wbQMiMovoWA2qLldOPyTaN1ReGC6diZp7DN/yByTNatu\nLZuH\r\n=F8RJ\r\n-----END PGP SIGNATURE-----\r\n","size":3028,"noattachment":false,"key":"/@braintree/sanitize-url/-/@braintree/sanitize-url-3.0.0.tgz"},"main":"index.js","gitHead":"4afa2582a6fee8971be3bcbc59faeb83ebc41e5c","scripts":{"test":"mocha"},"_npmUser":{"name":"braintree","email":"devs@getbraintree.com"},"deprecated":"Potential XSS vulnerability patched in v6.0.0.","repository":{"url":"git+https://github.com/braintree/sanitize-url.git","type":"git"},"_npmVersion":"6.4.1","description":"A url sanitizer","directories":{},"_nodeVersion":"8.14.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.1.0","mocha":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sanitize-url_3.0.0_1545928604635_0.4910267614467647","host":"s3://npm-registry-packages"},"readme":"# sanitize-url\n\n## Installation\n\n```sh\nnpm install -S @braintree/sanitize-url\n```\n\n## Usage\n\n```js\nvar sanitizeUrl = require(\"@braintree/sanitize-url\").sanitizeUrl;\n\nsanitizeUrl(\"https://example.com\"); // 'https://example.com'\nsanitizeUrl(\"http://example.com\"); // 'http://example.com'\nsanitizeUrl(\"www.example.com\"); // 'www.example.com'\nsanitizeUrl(\"mailto:hello@example.com\"); // 'mailto:hello@example.com'\nsanitizeUrl(\n  \"&#104;&#116;&#116;&#112;&#115;&#0000058//&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;\"\n); // https://example.com\n\nsanitizeUrl(\"javascript:alert(document.domain)\"); // 'about:blank'\nsanitizeUrl(\"jAvasCrIPT:alert(document.domain)\"); // 'about:blank'\nsanitizeUrl(decodeURIComponent(\"JaVaScRiP%0at:alert(document.domain)\")); // 'about:blank'\n// HTML encoded javascript:alert('XSS')\nsanitizeUrl(\n  \"&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041\"\n); // 'about:blank'\n```\n\n## Testing\n\nThis library uses [Vitest](https://vitest.dev/). All testing dependencies\nwill be installed upon `npm install` and the test suite can be executed with\n`npm test`. Running the test suite will also run lint checks upon exiting.\n\n    npm test\n\nTo generate a coverage report, use `npm run coverage`.\n","publish_time":1545928604782,"maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"_cnpm_publish_time":1545928604782,"dist-tags":{"latest":"7.1.2"}}