Created
March 25, 2022 12:36
-
-
Save emilhein/b5503166892828a6065052011303a5f6 to your computer and use it in GitHub Desktop.
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 getParameterByName = function (name) { | |
const regexS = "[\\?&]" + name + "=([^&#]*)"; | |
const regex = new RegExp(regexS); | |
const results = regex.exec(window.location.search); | |
if (results === null) { | |
return ""; | |
} | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}; | |
const debugParamActive = getParameterByName("lib_debug") === "true"; | |
const logme = function (msg) { | |
return debugParamActive && console.log(msg) | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment