Returns compiled function, that acceps object and returns Boolean, indicates, that passed object is matching compiled pattern.
Matcher.build(prefix, object)
Returns one-line if for comparsion other objects agains object param. Prefix used to identify compared object inside generated if.
Mathcer.escape(id)
Returns escaped property accessor. For example for valid will be returned .valid, but for -invalid will be returned ["-invalid"].
Benchmarks
object-match-statement is using if for patterns, since inlining is not an option (we need to construct comparing statement by object fields and values).