Skip to content

Function: createFsRegexCheckBuilder() ​

ts
function createFsRegexCheckBuilder<THandle>(id, options): FsRegexCheckNode<THandle>;

Defined in: fs/src/builders/create-fs-regex-check-builder.ts:62

Compiles a passive FsRegexCheckNode (fs:regex-check) for fs.regexCheck(id, options).

Normalizes options.forbidPattern (string | RegExp) into serializable forbidPattern and forbidFlags properties and validates regular expression compilation at build time.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownRuntime handle type of the active isolation scope.

Parameters ​

ParameterTypeDescription
idstringUnique identifier for the regex check.
optionsFsRegexCheckOptionsTarget globs, forbidden pattern, and violation message.

Returns ​

FsRegexCheckNode<THandle>

Deeply frozen FsRegexCheckNode AST descriptor.

Throws ​

If id, options.targetGlobs, or options.violationMessage is empty.

Released under the MIT License.