aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-05-27 21:35:15 +0200
committerache <ache@ache.one>2018-05-27 21:35:15 +0200
commitb155fbcdde42fef8bdecb109d927da880f2ce1a9 (patch)
tree4647025478c443ab35eca062357626462c3e57c2
parentAdd more tests (diff)
xo recommendations
-rw-r--r--app.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/app.js b/app.js
index 027410a..447d560 100644
--- a/app.js
+++ b/app.js
@@ -23,7 +23,7 @@ function plugin() {
let subvalue = '';
let index = START.length;
- const length = value.length;
+ const {length} = value;
while (!value.startsWith(END, index) && index < length) {
subvalue += value.charAt(index);
@@ -40,7 +40,7 @@ function plugin() {
if (value.charAt(index + END.length) === '{') {
const res = parseAttr(value, index + END.length);
letsEat = res.eaten;
- prop = res.prop;
+ ({prop} = res);
}
/* istanbul ignore if - never used (yet) */
@@ -70,19 +70,19 @@ function plugin() {
inlineTokenizer.locator = locator;
- const Parser = this.Parser;
+ const {Parser} = this;
// Inject inlineTokenizer
- const inlineTokenizers = Parser.prototype.inlineTokenizers;
- const inlineMethods = Parser.prototype.inlineMethods;
+ const {inlineTokenizers} = Parser.prototype;
+ const {inlineMethods} = Parser.prototype;
inlineTokenizers.input = inlineTokenizer;
inlineMethods.splice(inlineMethods.indexOf('url'), 0, 'input');
- const Compiler = this.Compiler;
+ const {Compiler} = this;
// Stringify
if (Compiler) {
- const visitors = Compiler.prototype.visitors;
+ const {visitors} = Compiler.prototype;
visitors.lineinput = function (node) {
return `[__${this.all(node).join('')}__]`;
};