compile.d.ts 644 B

12345678910111213141516171819
  1. /**
  2. * Returns a function that checks if an elements index matches the given rule
  3. * highly optimized to return the fastest solution.
  4. *
  5. * @param parsed A tuple [a, b], as returned by `parse`.
  6. * @returns A highly optimized function that returns whether an index matches the nth-check.
  7. * @example
  8. * const check = nthCheck.compile([2, 3]);
  9. *
  10. * check(0); // `false`
  11. * check(1); // `false`
  12. * check(2); // `true`
  13. * check(3); // `false`
  14. * check(4); // `true`
  15. * check(5); // `false`
  16. * check(6); // `true`
  17. */
  18. export declare function compile(parsed: [a: number, b: number]): (index: number) => boolean;
  19. //# sourceMappingURL=compile.d.ts.map