MCPcopy Index your code
hub / github.com/postcss/postcss / getTokenType

Function getTokenType

lib/terminal-highlight.js:31–48  ·  view source on GitHub ↗
([type, value], processor)

Source from the content-addressed store, hash-verified

29}
30
31function getTokenType([type, value], processor) {
32 if (type === 'word') {
33 if (value[0] === '.') {
34 return 'class'
35 }
36 if (value[0] === '#') {
37 return 'hash'
38 }
39 }
40
41 if (!processor.endOfFile()) {
42 let next = processor.nextToken()
43 processor.back(next)
44 if (next[0] === 'brackets' || next[0] === '(') return 'call'
45 }
46
47 return type
48}
49
50function terminalHighlight(css) {
51 let processor = tokenizer(new Input(css), { ignoreErrors: true })

Callers 1

terminalHighlightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…