Skip to main content

Module like

Module like 

Source
Expand description

LIKE and ILIKE (packages/zql/src/builder/like.ts).

JS compiles a pattern without wildcards to a (lowercased) string comparison, and anything else to a non-Unicode RegExp with the s flag. That regexp works on UTF-16 code units: _ matches one code unit (half of a surrogate pair), and i folds case per code unit through simple uppercasing. This reproduces both paths.

Structs§

InvalidPattern
LikePattern
A compiled LIKE or ILIKE pattern.

Functions§

escape_like
Escapes the wildcards of value (% and _) for a LIKE pattern (packages/zql/src/query/escape-like.ts).