1 |
|
2 |
|
3 | let Node = require('./node')
|
4 |
|
5 | class Declaration extends Node {
|
6 | constructor(defaults) {
|
7 | if (
|
8 | defaults &&
|
9 | typeof defaults.value !== 'undefined' &&
|
10 | typeof defaults.value !== 'string'
|
11 | ) {
|
12 | defaults = { ...defaults, value: String(defaults.value) }
|
13 | }
|
14 | super(defaults)
|
15 | this.type = 'decl'
|
16 | }
|
17 |
|
18 | get variable() {
|
19 | return this.prop.startsWith('--') || this.prop[0] === '$'
|
20 | }
|
21 | }
|
22 |
|
23 | module.exports = Declaration
|
24 | Declaration.default = Declaration
|