MCPcopy Create free account
hub / github.com/purifycss/purifycss / getAllWordsInContent

Function getAllWordsInContent

src/utils/ExtractWordsUtil.js:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3}
4
5export 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
18export const getAllWordsInSelector = selector => {
19 // Remove attr selectors. "a[href...]"" will become "a".

Callers 1

purifyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected