Parses and compiles CSS nth-checks to highly optimized functions.
nth-check is a JavaScript module that parses and compiles CSS nth-checks—the selector formulas used in CSS3's `nth-child()` and `nth-last-of-type()` pseudo-classes—into highly optimized functions. The module provides an API for checking whether a given index matches an nth-rule, as well as for generating sequences of indices that satisfy a given rule, with a focus on performance while adhering to the CSS3 selector specification. It exports functions for parsing formulas into step and offset components, compiling those components into check functions, and generating index sequences, along with convenience methods that combine parsing and compilation.