package.cjs.initializers.globalProps.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = initializeGlobalProps;
var _neetoCist = require("@bigbinary/neeto-cist");
/* eslint-disable @bigbinary/neeto/no-globalProps-reassignment */
function initializeGlobalProps() {
var _document$getElements, _document$getElements2, _window, _window$globalProps;
window.globalProps = (0, _neetoCist.keysToCamelCase)(JSON.parse(((_document$getElements = document.getElementsByClassName("root-container")[0]) === null || _document$getElements === void 0 ? void 0 : (_document$getElements2 = _document$getElements.dataset) === null || _document$getElements2 === void 0 ? void 0 : _document$getElements2.reactProps) || "{}"));
if ((_window = window) !== null && _window !== void 0 && (_window$globalProps = _window.globalProps) !== null && _window$globalProps !== void 0 && _window$globalProps.appName) {
window.globalProps.appName = (0, _neetoCist.capitalize)(window.globalProps.appName);
}
(0, _neetoCist.deepFreezeObject)(window.globalProps);
}
//# sourceMappingURL=globalProps.js.map