{"name":"@braintree/sanitize-url","version":"1.0.0","keywords":[],"author":"","license":"MIT","_id":"@braintree/sanitize-url@1.0.0","homepage":"https://github.com/braintree/sanitize-url#readme","bugs":{"url":"https://github.com/braintree/sanitize-url/issues"},"dist":{"shasum":"24cfce661d5c7496b7024460fe23942d9afc5eed","tarball":"http://registry-npm.ywwl.com/@braintree/sanitize-url/download/@braintree/sanitize-url-1.0.0.tgz","integrity":"sha512-WGdsUlyx3TucDlo1HCulzT6r399iJPeVeHF4RX4NiwVVFq4hBYG9iVs5rOcxqTe6z80dKJZ1cD1OfvDCLtOThw==","signatures":[{"sig":"MEYCIQCnExfhSm/wgN2S1YfPApcvrrWRRV4HOSsz5xkfLNx+dgIhAO2umz3/6Ffb6nqwx+KogDer0ZyqlCy4BL5VoqD5mVwB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":2102,"noattachment":false,"key":"/@braintree/sanitize-url/-/@braintree/sanitize-url-1.0.0.tgz"},"main":"index.js","_from":".","_shasum":"24cfce661d5c7496b7024460fe23942d9afc5eed","gitHead":"d44c75d6607261f85fa18464f9dc436d4e6030ca","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":"3.10.10","description":"A url sanitizer","directories":{},"_nodeVersion":"6.11.2","devDependencies":{"chai":"^4.1.0","mocha":"^3.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sanitize-url-1.0.0.tgz_1502228007321_0.23632650636136532","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":1502228008289,"maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"_cnpm_publish_time":1502228008289,"dist-tags":{"latest":"7.1.2"}}