node-nk-base
Advanced tools
Comparing version 1.0.8 to 1.0.9
126
index.js
@@ -402,2 +402,20 @@ function NKB(basefile) { | ||
} | ||
this.isPart = function(id) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) return null; | ||
return is_part(section, id); | ||
} | ||
this.isVariable = function(id, variable) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) return null; | ||
if(!is_part(section, id)) return null | ||
return is_variable(section, id, variable); | ||
} | ||
@@ -500,2 +518,100 @@ | ||
this.get = function(id, variable) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) { | ||
console.error(`node-nk-base get(section): This section(${section}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_part(section, id)) { | ||
console.error(`node-nk-base get(id): Part with this id(${id}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_variable(section, id, variable)) { | ||
console.error(`node-nk-base get(variable): This variable(${variable}) doesn't exists!`); | ||
return null; | ||
} | ||
return get(section, id, variable); | ||
} | ||
this.set = function(id, variable, value) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) { | ||
console.error(`node-nk-base set(section): This section(${section}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_part(section, id)) { | ||
console.error(`node-nk-base set(id): Part with this id(${id}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_variable(section, id, variable)) { | ||
console.error(`node-nk-base set(variable): This variable(${variable}) doesn't exists!`); | ||
return null; | ||
} | ||
return set(section, id, variable, value); | ||
} | ||
this.add = function(id, variable, value) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) { | ||
console.error(`node-nk-base add(section): This section(${section}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_part(section, id)) { | ||
console.error(`node-nk-base add(id): Part with this id(${id}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_variable(section, id, variable)) { | ||
console.error(`node-nk-base add(variable): This variable(${variable}) doesn't exists!`); | ||
return null; | ||
} | ||
return add(section, id, variable, value); | ||
} | ||
this.append = function(id, variable, value) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) { | ||
console.error(`node-nk-base append(section): This section(${section}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_part(section, id)) { | ||
console.error(`node-nk-base append(id): Part with this id(${id}) doesn't exists!`); | ||
return null; | ||
} | ||
if(!is_variable(section, id, variable)) { | ||
console.error(`node-nk-base append(variable): This variable(${variable}) doesn't exists!`); | ||
return null; | ||
} | ||
return append(section, id, variable, value); | ||
} | ||
this.findPart = function(id) { | ||
@@ -517,2 +633,12 @@ | ||
this.isVariable = function(variable) { | ||
if(!rb()) return null; | ||
if(!is_section(section)) return null; | ||
if(!is_part(section, id)) return null | ||
return is_variable(section, id, variable); | ||
} | ||
this.get = function(variable) { | ||
@@ -519,0 +645,0 @@ |
{ | ||
"name": "node-nk-base", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"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
28240
582