All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.initializers.globalProps.js Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
/* eslint-disable @bigbinary/neeto/no-globalProps-reassignment */
import { keysToCamelCase, deepFreezeObject, capitalize } from "@bigbinary/neeto-cist";
export default function initializeGlobalProps() {
  var _document$getElements, _document$getElements2, _window, _window$globalProps;
  window.globalProps = 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 = capitalize(window.globalProps.appName);
  }
  deepFreezeObject(window.globalProps);
}
//# sourceMappingURL=globalProps.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy