MCPcopy Index your code
hub / github.com/codecombat/codecombat / getQueryVariables

Function getQueryVariables

app/core/utils.js:825–834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

823 document.location.search
824
825const getQueryVariables = function () {
826 const query = module.exports.getDocumentSearchString().substring(1) // use module.exports so spy is used in testing
827 const pairs = (Array.from(query.split('&')).map((pair) => pair.split('=')))
828 const variables = {}
829 for (const [key, value] of Array.from(pairs)) {
830 var left1
831 variables[key] = (left1 = { true: true, false: false }[value]) != null ? left1 : decodeURIComponent(value)
832 }
833 return variables
834}
835
836const getQueryVariable = function (param, defaultValue) {
837 const variables = getQueryVariables()

Callers 1

getQueryVariableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected