This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
2020-11-01 22:46:04 +00:00

24 lines
463 B
JavaScript

'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'
}
get variable () {
return this.prop.startsWith('--') || this.prop[0] === '$'
}
}
module.exports = Declaration