UNPKG

@polgubau/utils

Version:

A collection of utility functions for TypeScript

46 lines 1.71 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var getDocumentDirection_exports = {}; __export(getDocumentDirection_exports, { DirEnum: () => DirEnum, getDocumentDirection: () => getDocumentDirection }); module.exports = __toCommonJS(getDocumentDirection_exports); var DirEnum = /* @__PURE__ */ ((DirEnum2) => { DirEnum2["rtl"] = "rtl"; DirEnum2["ltr"] = "ltr"; DirEnum2["auto"] = "auto"; return DirEnum2; })(DirEnum || {}); function getDocumentDirection() { if (typeof window === "undefined" || !window.document) { return "ltr"; } const dirAttribute = document.documentElement.getAttribute("dir"); if (dirAttribute === "auto" /* auto */ || !dirAttribute) { return window.getComputedStyle(document.documentElement).direction; } return dirAttribute; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { DirEnum, getDocumentDirection }); //# sourceMappingURL=getDocumentDirection.js.map