rdesign/frontend/node_modules/@braintree/sanitize-url
Jeff Emmett 80f1e96e6b Fix frontend build: type errors, SDK handling, docker context
- Use jq to cleanly remove encryptid SDK from package.json in Docker
- Fix TypeScript strict mode errors in dashboard and assistant
- Add .dockerignore to exclude node_modules from build context
- Use project root as Docker build context for frontend
- Fix Traefik routing: separate frontend/api/studio paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 02:21:52 +00:00
..
.github Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
dist Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
src Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
.eslintignore Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
.eslintrc Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
.nvmrc Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
.prettierignore Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
CHANGELOG.md Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
LICENSE Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
README.md Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
package.json Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
tsconfig.json Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
vitest.config.ts Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00

README.md

sanitize-url

Installation

npm install -S @braintree/sanitize-url

Usage

var sanitizeUrl = require("@braintree/sanitize-url").sanitizeUrl;

sanitizeUrl("https://example.com"); // 'https://example.com'
sanitizeUrl("http://example.com"); // 'http://example.com'
sanitizeUrl("www.example.com"); // 'www.example.com'
sanitizeUrl("mailto:hello@example.com"); // 'mailto:hello@example.com'
sanitizeUrl(
  "&#104;&#116;&#116;&#112;&#115;&#0000058//&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;",
); // https://example.com

sanitizeUrl("javascript:alert(document.domain)"); // 'about:blank'
sanitizeUrl("jAvasCrIPT:alert(document.domain)"); // 'about:blank'
sanitizeUrl(decodeURIComponent("JaVaScRiP%0at:alert(document.domain)")); // 'about:blank'
// HTML encoded javascript:alert('XSS')
sanitizeUrl(
  "&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041",
); // 'about:blank'

Testing

This library uses Vitest. All testing dependencies will be installed upon npm install and the test suite can be executed with npm test. Running the test suite will also run lint checks upon exiting.

npm test

To generate a coverage report, use npm run coverage.