push
github
799 of 891 branches covered (89.67%)
Branch coverage included in aggregate %.
52 of 52 new or added lines in 4 files covered. (100.0%)
1436 of 1524 relevant lines covered (94.23%)
32500.37 hits per line
1 |
"use strict"
|
|
2 |
|
|
|
const stylus = require("stylus")
|
1✔ |
4 |
|
|
|
const nodeTypes = new Map()
|
1✔ |
6 |
|
|
|
for (const name of Object.keys(stylus.nodes)) {
|
1✔ |
|
nodeTypes.set(stylus.nodes[name], name.toLowerCase()) |
43✔ |
9 |
} |
|
10 |
|
|
|
module.exports = { |
1✔ |
12 |
getName(node) { |
|
|
const name = nodeTypes.get(node.constructor) |
588,708✔ |
|
if (name) {
|
|
|
return name
|
481,374✔ |
16 |
} |
|
17 |
|
|
|
if ("nodeName" in node) { |
|
|
return node.nodeName
|
× |
20 |
} |
|
|
return undefined |
107,334✔ |
22 |
}, |
|
23 |
} |