



export function jsVar(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoLibraryBeta"] || window["neoGlobalEnqueueFrontendNeoLibraryBeta"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    if (window["neoGlobalEnqueueBackendNeoLibraryBeta"]  && window["neoGlobalEnqueueBackendNeoLibraryBeta"][variableName]  !== undefined) { return window["neoGlobalEnqueueBackendNeoLibraryBeta"][variableName]; }
    if (window["neoGlobalEnqueueFrontendNeoLibraryBeta"] && window["neoGlobalEnqueueFrontendNeoLibraryBeta"][variableName] !== undefined) { return window["neoGlobalEnqueueFrontendNeoLibraryBeta"][variableName]; }
    throw new Error("Missing JS variable: " + variableName + ". Make sure it is registered via enqueue_js_variable_backend(...) or enqueue_js_variable_frontend(...).");
}


export function jsVarExists(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoLibraryBeta"] || window["neoGlobalEnqueueFrontendNeoLibraryBeta"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    return (window["neoGlobalEnqueueBackendNeoLibraryBeta"] || window["neoGlobalEnqueueFrontendNeoLibraryBeta"])?.[variableName] !== undefined;
}
