Skip to content
docs

redactUrls

redactUrls(text): string

Defined in: protocol-swap2-core/src/util.ts:62

Remove URLs from text that may travel to a client (a refusal reason, a build error): transport errors carry the endpoint — and with a keyed RPC (QuickNode, Alchemy, Infura…) the key sits in its path (scan 2026-10-23 F8). What /[a-z][a-z0-9+.-]{0,31}://[^\s"'<>]+/gi would replace, found from each :// instead of tried at every position: linear in the length of text whatever an API or a client puts in it (“a.a.a…” made the regex this replaced quadratic; scan 2026-10-27 modules, F34). A URL glued to a word loses its last 32 scheme characters and the rest.

string

string