Writing code
FUNCTION
@skmtc/lang-typescript 0.19.1toAnyStringExceptPattern
A pattern that matches any string except the given names, each matched exactly. A record beside named properties uses it as its key: the record then checks only the keys the properties do not name.
With no names, every string matches, and the pattern is empty.
Signature
import { toAnyStringExceptPattern } from '@skmtc/lang-typescript'
toAnyStringExceptPattern(args: ToAnyStringExceptPatternArgs): stringParameters
args, ToAnyStringExceptPatternArgs required
names, string[] required
The strings the pattern must not match, as written (they are escaped here).
Example
toAnyStringExceptPattern({ names: ['id', 'a.b'] }) // '^(?!(?:id|a\\.b)$)'
toAnyStringExceptPattern({ names: [] }) // ''Returns
string