Skip to content

Commit

Permalink
add this.unquoted()
Browse files Browse the repository at this point in the history
  • Loading branch information
ampatspell committed Oct 18, 2020
1 parent f4b91bb commit dfbbd76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/dsl/block.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Property = require('./property');
const Base = require('./base');
const { arrayToString, clone, uniq, quote, pad, block, assign } = require('./util');
const { arrayToString, clone, uniq, quote, pad, block, assign, UnquotedString } = require('./util');

class Block extends Base {

Expand Down Expand Up @@ -232,6 +232,10 @@ class Block extends Base {
};
}

unquoted(arg) {
return new UnquotedString(arg);
}

cmp(key, cmp, value) {
let { request } = this.data(key);
return `${request} ${cmp} ${quote(value)}`;
Expand Down
15 changes: 14 additions & 1 deletion lib/dsl/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,25 @@ const uniq = arg => {
return arr;
}

class UnquotedString {

constructor(string) {
this.string = string;
}

toString() {
return this.string;
}

}

module.exports = {
clone,
quote,
arrayToString,
pad,
block,
assign,
uniq
uniq,
UnquotedString
}

0 comments on commit dfbbd76

Please sign in to comment.