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 clone(obj) { | |
var ctr = Object.getPrototypeOf(obj).constructor; | |
return Object.assign(new ctr(), obj); | |
} |
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 parseBool (value){ | |
var isEmptyString = (typeof value === "string" && value.length <= 0); | |
var isFalsy = typeof value === "undefined" || isEmptyString; | |
return !isFalsy && !!JSON.parse(value); | |
}; |