Node-Red configuration
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

rule.js 569B

123456789101112131415161718192021222324252627
  1. 'use strict'
  2. let Container = require('./container')
  3. let list = require('./list')
  4. class Rule extends Container {
  5. constructor(defaults) {
  6. super(defaults)
  7. this.type = 'rule'
  8. if (!this.nodes) this.nodes = []
  9. }
  10. get selectors() {
  11. return list.comma(this.selector)
  12. }
  13. set selectors(values) {
  14. let match = this.selector ? this.selector.match(/,\s*/) : null
  15. let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
  16. this.selector = values.join(sep)
  17. }
  18. }
  19. module.exports = Rule
  20. Rule.default = Rule
  21. Container.registerRule(Rule)