node-nk-base
Advanced tools
Comparing version 1.0.3 to 1.0.4
93
index.js
@@ -5,9 +5,10 @@ function NKB(basefile) { | ||
section: ⟦⸨⸩⸨⸩⟧ | ||
part: ❰❲❳⦃ ⥏ ⦄❱ | ||
section: | ||
part: ⥏ | ||
var types: ± ň క | ||
var value: 『』 | ||
var value: | ||
new string: | ||
*/ | ||
const fs = require('fs'); | ||
@@ -54,3 +55,3 @@ var bt; | ||
if((bt.indexOf(`⟦⸨${section}⸩`) != -1 && bt.indexOf(`⸨${section}⸩⟧`) != -1)) return true; else return false; | ||
if((bt.indexOf(`${section}`) != -1 && bt.indexOf(`${section}`) != -1)) return true; else return false; | ||
@@ -64,5 +65,5 @@ } | ||
if((bt.indexOf(`⟦⸨${section}⸩`) != -1 && bt.indexOf(`⸨${section}⸩⟧`) != -1)) { | ||
if((bt.indexOf(`${section}`) != -1 && bt.indexOf(`${section}`) != -1)) { | ||
if(bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].indexOf(`❰❲${id}❳⦃ ⥏ `) != -1) return true; else return false; | ||
if(bt.split(`${section}`)[1].split(`${section}`)[0].indexOf(`${id}`) != -1) return true; else return false; | ||
@@ -78,7 +79,7 @@ } else return false; | ||
if((bt.indexOf(`⟦⸨${section}⸩`) != -1 && bt.indexOf(`⸨${section}⸩⟧`) != -1)) { | ||
if((bt.indexOf(`${section}`) != -1 && bt.indexOf(`${section}`) != -1)) { | ||
if(bt.indexOf(`❰❲${id}❳⦃ ⥏ `) != -1) { | ||
if(bt.indexOf(`${id}`) != -1) { | ||
if(bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0].indexOf(` ⥏ ${variable}=`) != -1) return true; else return false; | ||
if(bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].indexOf(`${variable}=`) != -1) return true; else return false; | ||
@@ -96,10 +97,10 @@ } else return false; | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
if(v.startsWith(`ň『`)) return Number(v.split(`ň『`)[1]); | ||
if(v.startsWith(`ň`)) return Number(v.split(`ň`)[1]); | ||
if(v.startsWith(`క『`)) return v.split(`క『`)[1].replace(//g, '\n').replace(/』 ⥑ /g, `』 ⥏ `); | ||
if(v.startsWith(`క`)) return v.split(`క`)[1].replace(//g, '\n').replace(/c/g, ``); | ||
if(v.startsWith(`±『`)) { | ||
v = v.split(`±『`)[1]; | ||
if(v.startsWith(`±`)) { | ||
v = v.split(`±`)[1]; | ||
if(v == '0') return false; | ||
@@ -121,14 +122,14 @@ if(v == '1') return true; | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
let t; | ||
if(v.startsWith(`ň『`)) t = 'ň'; | ||
if(v.startsWith(`ň`)) t = 'ň'; | ||
if(v.startsWith(`క『`)) { | ||
if(v.startsWith(`క`)) { | ||
t = 'క'; | ||
value = String(value).replace(/\n/g, '').replace(/』 ⥏ /g, '』 ⥑ '); | ||
value = String(value).replace(/\n/g, '').replace(//g, ' '); | ||
} | ||
if(v.startsWith(`±『`)) t = '±'; | ||
if(v.startsWith(`±`)) t = '±'; | ||
@@ -140,3 +141,3 @@ if(t == undefined) { | ||
wb(`${bt.split(`⟦⸨${section}⸩`)[0]}⟦⸨${section}⸩${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].replace(`❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`, `❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0].split(` ⥏ ${variable}=`)[0]} ⥏ ${variable}=${t}『${value}』${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0].split(` ⥏ ${variable}=${v}』`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`)}⸨${section}⸩⟧${bt.split(`⸨${section}⸩⟧`)[1]}`); | ||
wb(`${bt.split(`${section}`)[0]}${section}${bt.split(`${section}`)[1].split(`${section}`)[0].replace(`${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}`, `${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[0]}${variable}=${t}${value}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=${v}`)[1].split(``)[0]}`)}${section}${bt.split(`${section}`)[1]}`); | ||
@@ -170,7 +171,7 @@ v = null; | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
let t = false; | ||
if(v.startsWith(`ň『`)) t = 'num'; | ||
if(v.startsWith(`ň`)) t = 'num'; | ||
@@ -217,7 +218,7 @@ if(!t) { | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
let t = false; | ||
if(v.startsWith(`క『`) ) t = 'str'; | ||
if(v.startsWith(`క`) ) t = 'str'; | ||
@@ -252,8 +253,8 @@ if(!t) { | ||
let c = [ | ||
bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲`).length-1, | ||
bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❳⦃ ⥏ `).length-1, | ||
bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(` ⥏ ⦄❱`).length-1 | ||
bt.split(`${section}`)[1].split(`${section}`)[0].split(``).length-1, | ||
bt.split(`${section}`)[1].split(`${section}`)[0].split(``).length-1, | ||
bt.split(`${section}`)[1].split(`${section}`)[0].split(``).length-1 | ||
] | ||
if(c[0] == c[1] == c[2]) return bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❳⦃ ⥏ `).length-1; | ||
if(c[0] == c[1] == c[2]) return bt.split(`${section}`)[1].split(`${section}`)[0].split(``).length-1; | ||
@@ -316,11 +317,11 @@ c.sort( (a, b) => { return a = b } ); | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
let t = false; | ||
if(v.startsWith(`ň『`) && (Number(value) || Number(value) == 0)) t = 'num'; | ||
if(v.startsWith(`ň`) && (Number(value) || Number(value) == 0)) t = 'num'; | ||
if(v.startsWith(`క『`) && (String(value) || value == '')) t = 'str'; | ||
if(v.startsWith(`క`) && (String(value) || value == '')) t = 'str'; | ||
if(v.startsWith(`±『`) && (value == true || value == false)) { | ||
if(v.startsWith(`±`) && (value == true || value == false)) { | ||
t = 'bool'; | ||
@@ -359,3 +360,3 @@ if(value == true) value = '1'; | ||
wb(bt + `⟦⸨${section}⸩⸨${section}⸩⟧`); | ||
wb(bt + `${section}${section}`); | ||
@@ -376,3 +377,3 @@ return true; | ||
wb(bt.replace(`⟦⸨${section}⸩${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0]}⸨${section}⸩⟧`, '')); | ||
wb(bt.replace(`${section}${bt.split(`${section}`)[1].split(`${section}`)[0]}${section}`, '')); | ||
@@ -405,3 +406,3 @@ return true; | ||
let newbt = bt.split(`⸨${section}⸩⟧`)[0] + `❰❲${id}❳⦃`; | ||
let newbt = bt.split(`${section}`)[0] + `${id}`; | ||
@@ -433,3 +434,3 @@ vars.map( (x) => { | ||
newbt += ` ⥏ ${x[0]}=${(x[1] == Number ? 'ň' : "") + (x[1] == String ? 'క' : "") + (x[1] == Boolean ? '±' : "")}『${x[2]}』`; | ||
newbt += `${x[0]}=${(x[1] == Number ? 'ň' : "") + (x[1] == String ? 'క' : "") + (x[1] == Boolean ? '±' : "")}${x[2]}`; | ||
@@ -443,3 +444,3 @@ } else { | ||
newbt += ` ⥏ ⦄❱⸨${section}⸩⟧` + bt.split(`⸨${section}⸩⟧`)[1]; | ||
newbt += `${section}` + bt.split(`${section}`)[1]; | ||
if(!err) wb(newbt); else return false; | ||
@@ -462,3 +463,3 @@ newbt = null; | ||
wb(`${bt.split(`⟦⸨${section}⸩`)[0]}⟦⸨${section}⸩${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].replace(`❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`, '')}⸨${section}⸩⟧${bt.split(`⸨${section}⸩⟧`)[1]}`); | ||
wb(`${bt.split(`${section}`)[0]}${section}${bt.split(`${section}`)[1].split(`${section}`)[0].replace(`${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}`, '')}${section}${bt.split(`${section}`)[1]}`); | ||
@@ -525,11 +526,11 @@ return true; | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
let t = false; | ||
if(v.startsWith(`ň『`) && (Number(value) || Number(value) == 0)) t = 'num'; | ||
if(v.startsWith(`ň`) && (Number(value) || Number(value) == 0)) t = 'num'; | ||
if(v.startsWith(`క『`) && (String(value) || value == '')) t = 'str'; | ||
if(v.startsWith(`క`) && (String(value) || value == '')) t = 'str'; | ||
if(v.startsWith(`±『`) && (value == true || value == false)) { | ||
if(v.startsWith(`±`) && (value == true || value == false)) { | ||
t = 'bool'; | ||
@@ -609,3 +610,3 @@ if(value == true) value = '1'; | ||
wb(`${bt.split(`⟦⸨${section}⸩`)[0]}⟦⸨${section}⸩${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].replace(`❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`, `❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ${variable}=${(type == Number ? 'ň' : "") + (type == String ? 'క' : "") + (type == Boolean ? '±' : "")}『${value}』 ⥏ ⦄❱`)}⸨${section}⸩⟧${bt.split(`⸨${section}⸩⟧`)[1]}`); | ||
wb(`${bt.split(`${section}`)[0]}${section}${bt.split(`${section}`)[1].split(`${section}`)[0].replace(`${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}`, `${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}${variable}=${(type == Number ? 'ň' : "") + (type == String ? 'క' : "") + (type == Boolean ? '±' : "")}${value}`)}${section}${bt.split(`${section}`)[1]}`); | ||
@@ -626,5 +627,5 @@ return true; | ||
let v = bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(`⦄❱`)[0].split(` ⥏ ${variable}=`)[1].split(`』 ⥏ `)[0]; | ||
let v = bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0].split(`${variable}=`)[1].split(``)[0]; | ||
wb(`${bt.split(`⟦⸨${section}⸩`)[0]}⟦⸨${section}⸩${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].replace(`❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`, `❰❲${id}❳⦃${bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲${id}❳⦃`)[1].split(` ⥏ ⦄❱`)[0]} ⥏ ⦄❱`.replace(` ⥏ ${variable}=${v}』`,''))}⸨${section}⸩⟧${bt.split(`⸨${section}⸩⟧`)[1]}`); | ||
wb(`${bt.split(`${section}`)[0]}${section}${bt.split(`${section}`)[1].split(`${section}`)[0].replace(`${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}`, `${id}${bt.split(`${section}`)[1].split(`${section}`)[0].split(`${id}`)[1].split(``)[0]}`.replace(`${variable}=${v}`,''))}${section}${bt.split(`${section}`)[1]}`); | ||
@@ -659,3 +660,3 @@ v = null; | ||
for(var i = 1; i < count+1; i++) { | ||
parts.push(bt.split(`⟦⸨${section}⸩`)[1].split(`⸨${section}⸩⟧`)[0].split(`❰❲`)[i].split(`❳⦃ ⥏ `)[0]); | ||
parts.push(bt.split(`${section}`)[1].split(`${section}`)[0].split(``)[i].split(``)[0]); | ||
} | ||
@@ -662,0 +663,0 @@ |
{ | ||
"name": "node-nk-base", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "database for nodejs by NK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21321
400