{"name":"@braintree/sanitize-url","version":"6.0.1","keywords":[],"author":"","license":"MIT","_id":"@braintree/sanitize-url@6.0.1","homepage":"https://github.com/braintree/sanitize-url#readme","bugs":{"url":"https://github.com/braintree/sanitize-url/issues"},"dist":{"shasum":"45ff061b9ded1c6e4474b33b336ebb1b986b825a","tarball":"http://registry-npm.ywwl.com/@braintree/sanitize-url/download/@braintree/sanitize-url-6.0.1.tgz","fileCount":16,"integrity":"sha512-zr9Qs9KFQiEvMWdZesjcmRJlUck5NR+eKGS1uyKk+oYTWwlYrsoPEi6VmG6/TzBD1hKCGEimrhTgGS6hvn/xIQ==","signatures":[{"sig":"MEUCIDjjLDHqOHTNQUMErLoTDVNDb7MVmOwzoCn1Q15+6q2KAiEAwojDnKccbYd+DxTuu7ToEKQX9x9C5gpz25Nm+SoX6dk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUclkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5dA//QHFC6gor4KH+rotuh+1abHp/5s0Q1YZlx1+taKiB1tw+V0+E\r\ntQ/cJ8QCmCijR/90h6xzPF7xJS+ksPPbZW38tbbMaZCyVeuR87vq5yH/XAA8\r\nTHA7kHeP0cDu5XjcRfDAGjvU4ZOHbIhjSC5oJkdcRIZ+gmIwdQoBi4llNtPx\r\n2oLBwenqBMU7mfruCs3pRmvvzdY+vfoAid/sgR6cpspfRVbGGWpAZVnQI0o0\r\nPG8Kkoo/TTcUzT6zQJ61S2q+9Ehv/LGFJtgjaSMf/8/bBuxBiTgm6XzlUudP\r\nOOtawcLr1DTKlSyfnYePExGVnMfs4WBUL+WZPniDpZRsvtxcM0IUC2MbIC9Q\r\nac0PvNMwtLTffD3XuDXSFkS2xtfBGTPYfIoL9nen5blXsZVr17Qsu5PEQOSR\r\nIA2MrhYvVwuvEaMVsSWCqCZo7Ucd9NmkTYvRtdbJfd8tGt1DorcupAuO9Hy7\r\nb4x+JugiIj/yMU7QgIu2SgH4Idz69hp1q+r7U3U4SMM1rd4D4hFjlR/ho1T2\r\nftKXar9BBYrK+jDtJiewjSckQ5RTAlyymHRWozmzxqKlVSF3yEkWDI/IXqYm\r\nqGbJXaF8GUzkDjm2QE/Vy074sluVZ3w/vlzXPslHQJUoztgOhbnRW3YjviAS\r\nW2JYYUwyM4rciSh8so2IcG7TJFshcerY3D8=\r\n=DmYG\r\n-----END PGP SIGNATURE-----\r\n","size":5116,"noattachment":false,"key":"/@braintree/sanitize-url/-/@braintree/sanitize-url-6.0.1.tgz"},"jest":{"preset":"ts-jest","globals":{"ts-jest":{"tsconfig":"src/__tests__/tsconfig.json"}},"testEnvironment":"jsdom"},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ab8d43d0516e48324826b9cb7f8612eee0e328a0","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":"sdk-package-registries@paypal.com"},"repository":{"url":"git+https://github.com/braintree/sanitize-url.git","type":"git"},"_npmVersion":"8.3.1","description":"A url sanitizer","directories":{},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.6","jest":"^27.5.1","eslint":"^8.13.0","ts-jest":"^27.1.4","prettier":"^2.6.2","typescript":"^4.6.3","@types/jest":"^27.4.1","eslint-plugin-prettier":"^4.0.0","eslint-config-braintree":"^6.0.0-typescript-prep-rc.2","@typescript-eslint/eslint-plugin":"^5.19.0"},"_npmOperationalInternal":{"tmp":"tmp/sanitize-url_6.0.1_1666304356430_0.32634965828415385","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":1666304356650,"maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"_cnpm_publish_time":1666304356650,"dist-tags":{"latest":"7.1.2"}}