main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
569 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | let Container = require('./container')
|
---|
| 4 | let list = require('./list')
|
---|
| 5 |
|
---|
| 6 | class Rule extends Container {
|
---|
| 7 | constructor(defaults) {
|
---|
| 8 | super(defaults)
|
---|
| 9 | this.type = 'rule'
|
---|
| 10 | if (!this.nodes) this.nodes = []
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | get selectors() {
|
---|
| 14 | return list.comma(this.selector)
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | set selectors(values) {
|
---|
| 18 | let match = this.selector ? this.selector.match(/,\s*/) : null
|
---|
| 19 | let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
|
---|
| 20 | this.selector = values.join(sep)
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | module.exports = Rule
|
---|
| 25 | Rule.default = Rule
|
---|
| 26 |
|
---|
| 27 | Container.registerRule(Rule)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.