mql2
Advanced tools
Comparing version 0.1.16 to 0.1.17
24
mql.js
@@ -110,15 +110,19 @@ import { | ||
var [strs3, tails3] = tail(); | ||
var maped = strs3.map(str => str.replace(/\n/g, '\n' + spaces)); | ||
const splited = strs2[k].split('\n'); | ||
if (!last(splited).trim()) { | ||
splited[splited.length-1] = maped[0].substr(1); | ||
strs2[k] = splited.join('\n'); | ||
maped = maped.slice(1); | ||
} | ||
strs2.splice(k+1, 0, maped); | ||
strs2.splice(k+1, 0, strs3.map(str => str.replace(/\n/g, '\n' + spaces))); | ||
return tails3; | ||
}); | ||
return [flatten(strs2).filter(str => str.trim()), flatten(tails2)]; | ||
return [ | ||
flatten(strs2).filter(str => str.trim()).reduce((strs, str, i) => { | ||
if (i == 0) return strs.push(str), strs; | ||
const splited = last(strs).split('\n'); | ||
if (!last(splited).trim()) { | ||
splited[splited.length-1] = str.substr(1); | ||
strs[strs.length-1] = splited.join('\n'); | ||
} else { | ||
strs.push(str); | ||
} | ||
return strs; | ||
}, []), | ||
flatten(tails2)]; | ||
} | ||
@@ -125,0 +129,0 @@ |
{ | ||
"name": "mql2", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"description": "query builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
35891
659