Skip to content

readForbiddenPatterns

Reads the forbidden patterns from the file FORBIDDEN_PATTERNS_FILE_ENV_VARIABLE names, loading the optional .env first.

An unset or blank variable means no list is configured, and yields no patterns. A variable that IS set but names a file that cannot be read throws instead of yielding none: a guard that switches itself off because its list moved is precisely the silent failure it exists to prevent.

Import:

import { readForbiddenPatterns } from 'obsidian-dev-utils/script-utils/forbidden-patterns';

Signature:

function readForbiddenPatterns(): Promise<RegExp[]>

Returns: Promise<RegExp[]> — A Promise that resolves to the compiled patterns.


Links to this page: