You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
495 B

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