Files
postcss/lib/declaration.js
T
Remco Haszing b94a22e19f Fix usage of default exports with TypeScript
This is done by assigning the property `default` for all properties that are
exported using `export default` according to their type definitions.

Closes #1424
2020-11-10 14:24:37 +01:00

25 lines
497 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
Declaration.default = Declaration