Fix bin/publish: use correct .env path for rspade_system Fix bin/publish script: prevent grep exit code 1 from terminating script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.0 KiB
TypeScript
Executable File
34 lines
1.0 KiB
TypeScript
Executable File
/**
|
|
* Make a value safe for injection as a URL.
|
|
*
|
|
* This encodes unsafe characters with percent-encoding and skips already
|
|
* encoded sequences (see `normalizeUri` below).
|
|
* Further unsafe characters are encoded as character references (see
|
|
* `micromark-util-encode`).
|
|
*
|
|
* Then, a regex of allowed protocols can be given, in which case the URL is
|
|
* sanitized.
|
|
* For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`,
|
|
* or `/^https?$/i` for `img[src]`.
|
|
* If the URL includes an unknown protocol (one not matched by `protocol`, such
|
|
* as a dangerous example, `javascript:`), the value is ignored.
|
|
*
|
|
* @param {string|undefined} url
|
|
* @param {RegExp} [protocol]
|
|
* @returns {string}
|
|
*/
|
|
export function sanitizeUri(
|
|
url: string | undefined,
|
|
protocol?: RegExp | undefined
|
|
): string
|
|
/**
|
|
* Normalize a URL (such as used in definitions).
|
|
*
|
|
* Encode unsafe characters with percent-encoding, skipping already encoded
|
|
* sequences.
|
|
*
|
|
* @param {string} value
|
|
* @returns {string}
|
|
*/
|
|
export function normalizeUri(value: string): string
|