{"name":"@braintree/sanitize-url","version":"5.0.0","keywords":[],"author":"","license":"MIT","_id":"@braintree/sanitize-url@5.0.0","homepage":"https://github.com/braintree/sanitize-url#readme","bugs":{"url":"https://github.com/braintree/sanitize-url/issues"},"dist":{"shasum":"3ba791f37b90e7f6170d252b63aacfcae943c039","tarball":"http://registry-npm.ywwl.com/@braintree/sanitize-url/download/@braintree/sanitize-url-5.0.0.tgz","fileCount":15,"integrity":"sha512-WmKrB/575EJCzbeSJR3YQ5sET5FaizeljLRw1382qVUeGqzuWBgIS+AF5a0FO51uQTrDpoRgvuHC2IWVsgwkkA==","signatures":[{"sig":"MEUCIQC3AdwEcwVx9nyrqKefGVQvVyfmZ8fYpqAgZr6YtERMMQIgJCEIrVUn4scOHefuzpNxwNqlpktnrya1tUdv0nPKi68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc4U9CRA9TVsSAnZWagAAzRQP/A7zzAvcE3fJxkWlc6qi\nf3Et+pAlWNVoecSHwbnHfogohP9FWHTFkgGX4LBievGP2xUncFBBJXWFBMz3\nJPYLWKTfLL7WglHW9ncqGYcp2Pxf6w+KrMjpYSWeo83uh5wb4PXbTSFQNfo0\ngN3vj14USN+Tqi9egm9xu+IHcLjIT6zOJ5BTyc5MmMz7+vuWNGOT0/B+RKZu\nXgEdLK0CKQLsnQAdJb+3eHJ7/hpuQr8K3V19G0fiqMnoqVdaJRtxMt/VD35t\ng+pe7JFH7UleFz4Fe2bqLifgtv9jEKficePCPYDMMu4ZGzrW/MeAg/ltt0KA\ntmeJ29ur4UJLcjOE6719DlknyI0WjmLYRv1Iufm5t+YYGvNXZEHhxhehlB4Q\nUljHDCCQextR8g7Wl63UQQjO7feCcq8NLXMfxfDmuil+VLifLicvzoSA/ybl\n2doJfjIpFj5vEtkIAxVmAFK+crtRSG9+lWK98V0rCOhbo4uUHYBKn2jkR7Sp\nnrlBx6g6GJ7zvpw7g83JOf9uu9XRGHPYVs4wdvyNz72Y6Bc63oEHRKcQ0bnd\nN/20W6+YKNuVHw8e5v9gy2TDHNCJeyaZ2itukrhI6F6EaRjlBeFkAaJEJugP\nZnlqK18g/n01TfVYO4er+SMFYpeJlmdUDxtW2wKXgjGzIpC/VoonIoPUYStK\nilMS\r\n=gxLY\r\n-----END PGP SIGNATURE-----\r\n","size":4317,"noattachment":false,"key":"/@braintree/sanitize-url/-/@braintree/sanitize-url-5.0.0.tgz"},"jest":{"preset":"ts-jest","globals":{"ts-jest":{"tsConfig":"src/__tests__/tsconfig.json"}}},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"4e94fbc72a7ad3fa171b0319a5f69fca6080d835","scripts":{"lint":"eslint --ext js,ts .","test":"jest","build":"tsc --declaration","posttest":"npm run lint","prebuild":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"braintree","email":"team-sdk@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.13.4","description":"A url sanitizer","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.1.0","jest":"^26.4.2","eslint":"^7.8.1","ts-jest":"^26.3.0","prettier":"^2.1.1","typescript":"^3.9.7","@types/jest":"^26.0.13","eslint-config-braintree":"^5.0.0-typescript-prep-rc.18"},"_npmOperationalInternal":{"tmp":"tmp/sanitize-url_5.0.0_1601406268809_0.988892767029089","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":1601406268995,"maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"_cnpm_publish_time":1601406268995,"dist-tags":{"latest":"7.1.2"}}