dir.js 502 B

123456789101112131415161718
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. /**
  5. * Returns `true` if the document or host element
  6. * has a `dir` set to `rtl`. The host value will always
  7. * take priority over the root document value.
  8. */
  9. const isRTL = (hostEl) => {
  10. if (hostEl) {
  11. if (hostEl.dir !== '') {
  12. return hostEl.dir.toLowerCase() === 'rtl';
  13. }
  14. }
  15. return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
  16. };
  17. export { isRTL as i };