Extension of the value storage handler with a fluent API for convenience.
withName(name: string): FluentHandler
Give the handler a name.
whenPathMatches(pattern: string): FluentHandler
Add a pattern-based path match pattern.
whenPathMatchesEvery(patterns: string[]): FluentHandler
Add pattern-based path matching: the path in the source must match all of these patterns.
whenPathMatchesSome(patterns: string[]): FluentHandler
Add pattern-based path matching: the path in the source must match at least one of these patterns.
Add a type matching condition that only matches array values.
Add a type matching condition that only matches object (excluding null
and array) values.
whenIsTypeOf(type: "string"
| "number"
| "bigint"
| "boolean"
| "symbol"
| "undefined"
| "object"
| "function"): FluentHandler
Add coarse JavaScript type matching using the typeof
operator. The handler only can store values whose
type matches the argument.
whenIsInstanceOf(classConstructor: new (..._: any[]) => unknown): FluentHandler
Add class instance matching using the instanceof
operator. The handler only can store values
that are instances of the provided class (constructor).