1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | module.exports = function (valueNode) {
|
10 | if (!valueNode) {
|
11 | return false;
|
12 | }
|
13 |
|
14 | if (valueNode.type !== 'function' || !valueNode.nodes || valueNode.value) {
|
15 | return false;
|
16 | }
|
17 |
|
18 |
|
19 | const cleanNodes = valueNode.nodes.filter(
|
20 | (node) => node.type !== 'comment' && node.type !== 'space',
|
21 | );
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | if (cleanNodes[0] && cleanNodes[0].type !== 'word' && cleanNodes[0].type !== 'string') {
|
27 | return false;
|
28 | }
|
29 |
|
30 | if (cleanNodes[1] && cleanNodes[1].value !== ':') {
|
31 | return false;
|
32 | }
|
33 |
|
34 |
|
35 | if (!cleanNodes[2]) {
|
36 | return false;
|
37 | }
|
38 |
|
39 | if (cleanNodes[3] && cleanNodes[3].value !== ',') {
|
40 | return false;
|
41 | }
|
42 |
|
43 | return true;
|
44 | };
|