(index: number, atStart = false)
| 794 | // For numbers larger than 62, an underscore is prepended. |
| 795 | // This encoding allows easy parsing to enable runtime merging by property. |
| 796 | function generateName(index: number, atStart = false): string { |
| 797 | if (index < 26) { |
| 798 | // lower case letters |
| 799 | return String.fromCharCode(index + 97); |
| 800 | } |
| 801 | |
| 802 | if (index < 52) { |
| 803 | // upper case letters |
| 804 | return String.fromCharCode(index - 26 + 65); |
| 805 | } |
| 806 | |
| 807 | if (index < 62 && !atStart) { |
| 808 | // numbers |
| 809 | return String.fromCharCode(index - 52 + 48); |
| 810 | } |
| 811 | |
| 812 | return '_' + generateName(index - (atStart ? 52 : 62)); |
| 813 | } |
| 814 | |
| 815 | // For arbitrary values, we use a hash of the string to generate the class name. |
| 816 | function generateArbitraryValueSelector(v: string, atStart = false) { |
no outgoing calls
no test coverage detected