2023-08-17 09:47:40 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
let Node = require('./node')
|
|
|
|
|
|
|
|
class Declaration extends Node {
|
|
|
|
constructor(defaults) {
|
|
|
|
if (
|
|
|
|
defaults &&
|
|
|
|
typeof defaults.value !== 'undefined' &&
|
|
|
|
typeof defaults.value !== 'string'
|
|
|
|
) {
|
|
|
|
defaults = { ...defaults, value: String(defaults.value) }
|
|
|
|
}
|
|
|
|
super(defaults)
|
|
|
|
this.type = 'decl'
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
get variable() {
|
|
|
|
return this.prop.startsWith('--') || this.prop[0] === '$'
|
|
|
|
}
|
|
|
|
}
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
module.exports = Declaration
|
|
|
|
Declaration.default = Declaration
|