|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
634 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";
|
|---|
| 2 | var parse = require("./parse");
|
|---|
| 3 | var walk = require("./walk");
|
|---|
| 4 | var stringify = require("./stringify");
|
|---|
| 5 | function ValueParser(value) {
|
|---|
| 6 | if (this instanceof ValueParser) {
|
|---|
| 7 | this.nodes = parse(value);
|
|---|
| 8 | return this;
|
|---|
| 9 | }
|
|---|
| 10 | return new ValueParser(value);
|
|---|
| 11 | }
|
|---|
| 12 | ValueParser.prototype.toString = function() {
|
|---|
| 13 | return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
|---|
| 14 | };
|
|---|
| 15 | ValueParser.prototype.walk = function(cb, bubble) {
|
|---|
| 16 | walk(this.nodes, cb, bubble);
|
|---|
| 17 | return this;
|
|---|
| 18 | };
|
|---|
| 19 | ValueParser.unit = require("./unit");
|
|---|
| 20 | ValueParser.walk = walk;
|
|---|
| 21 | ValueParser.stringify = stringify;
|
|---|
| 22 | module.exports = ValueParser;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.