Skip to main content

Module pattern

Module pattern 

Source
Expand description

upstream utils/pattern.ts.

Functions§

dict_get
DICTIONARY[key] (None = undefined).
dict_keys
Object.keys(DICTIONARY).
js_len
JS string.length: UTF-16 code units. Use it wherever upstream compares or sorts by length.
match_any_pattern
matchAnyPattern(dictionary): pass the dictionary keys in upstream’s key order. Longest first (stable sort, so equal lengths keep that order), joined with |, dots escaped.
repeated_timeunit_pattern
repeatedTimeunitPattern(prefix, singleTimeunitPattern, connectorPattern).

Type Aliases§

Dictionary
An upstream { [word: string]: V } dictionary, as (key, value) pairs in upstream key order.