Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
495 bytes
|
Line | |
---|
1 | 'use strict'
|
---|
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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.