This file contains hidden or 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 arrayToObject = (array) => { | |
return array.reduce(function(result, item) { | |
var key = Object.keys(item)[0]; | |
if(Array.isArray(item[key])) { | |
item[key] = arrayToObject(item[key]); | |
} | |
result[key] = item[key]; | |
return result; |
This file contains hidden or 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 trimMiddle = (text) => { | |
return text.trim().replace(/\s\s+/g,' '); | |
} | |
const trimAll = (text) => { | |
return text.replace(/\s+/g,''); | |
} | |
const roundTo = (n,kop) => { | |
let x=0; | |
if (typeof(n)==='number') | |
if (Number.isInteger(n)) |
NewerOlder