Inert pad rules (distinct, never-matching heads) used to push rule sets * over the index threshold.
(count: number, prefix = 'Pad')
| 43 | /** Inert pad rules (distinct, never-matching heads) used to push rule sets |
| 44 | * over the index threshold. */ |
| 45 | function pads(count: number, prefix = 'Pad'): Rule[] { |
| 46 | const result: Rule[] = []; |
| 47 | for (let i = 0; i < count; i++) |
| 48 | result.push({ |
| 49 | match: [`${prefix}${i}`, '_a', i], |
| 50 | replace: '_a', |
| 51 | id: `pad-${i}`, |
| 52 | }); |
| 53 | return result; |
| 54 | } |
| 55 | |
| 56 | function ordinalsOf( |
| 57 | bucket: ReadonlyArray<{ ordinal: number }> | undefined |