| 3 | } |
| 4 | |
| 5 | export const getAllWordsInContent = content => { |
| 6 | let used = { |
| 7 | // Always include html and body. |
| 8 | html: true, |
| 9 | body: true |
| 10 | } |
| 11 | const words = content.split(/[^a-z]/g) |
| 12 | for (let word of words) { |
| 13 | used[word] = true |
| 14 | } |
| 15 | return used |
| 16 | } |
| 17 | |
| 18 | export const getAllWordsInSelector = selector => { |
| 19 | // Remove attr selectors. "a[href...]"" will become "a". |