This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My example | |
rows.forEach(element => { | |
let json = JSON.parse(element.template_source); | |
for (let key in json) { | |
if(key === 'details') { | |
json[key].forEach(element => { | |
if(element.level !== undefined) { | |
console.log(element.level); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.readFileSync("DB.txt"); | |
let lk = res.rows.filter((result) => { | |
return result.app_version === "lk"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it.only("create cache file", () => { | |
let cacheResult = {}; | |
const query3 = "SELECT * FROM profile_systems"; | |
const newCursor = client.query(new Cursor(query3)); | |
newCursor.read(20, (err, rowsTop) => { | |
if (err) { | |
throw err; | |
} | |
test(err => { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inherit(child, parent) { | |
var Temp = function () {}; | |
Temp.prototype = parent.prototype; | |
child.prototype = new Temp(); | |
} | |
inherit(F2, F); | |
function inherit(child, parent) { | |
child.prototype = Object.create(parent.prototype); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pushUniqueObject(...arrays) { | |
let result = []; | |
let uniqueId = []; | |
for(let array of arrays) { | |
if(array.length !== 0) { | |
for (let object of array) { | |
if(object.child_id !== undefined && !uniqueId[object.child_id]) { | |
uniqueId[object.child_id] = true; | |
result.push(object); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isIterable = object => | |
object != null && typeof object[Symbol.iterator] === 'function'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const templates = { | |
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i, | |
number: /^-?\d+(?:\.\d+)?/, | |
string: /^(?:'[^']*')+/, | |
name: /^[0-9A-Za-z]+/, | |
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение | |
space: /^\s+/ | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getLexeme = (source) => { | |
let tokens = []; | |
const templates = { | |
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i, | |
number: /^-?\d+(?:\.\d+)?/, | |
string: /^(?:'[^']*')+/, | |
name: /^[0-9A-Za-z]+/, | |
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение | |
space: /^\s+/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"editor.tokenColorCustomizations": { | |
"textMateRules": [{ | |
"scope": [ | |
//following will be in italic (=FlottFlott) | |
"comment", | |
"entity.name.type.class", //class names | |
"keyword", //import, export, return… | |
"constant", //String, Number, Boolean…, this, super | |
"storage.modifier", //static keyword | |
"storage.type.class.js", //class keyword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$store.subscribe(function(mutation, state) { | |
// console.log("mutation.type", mutation.type); | |
// console.log("(mutation.payload", mutation.payload); | |
console.log(that.$router); | |
console.log(state); | |
if (mutation.type === "LOGIN" && state.userAuth.status) { | |
that.$router.push("/"); | |
} | |
}); |