Version: 0.26.00.27.00.27.10.28.00.29.00.29.10.30.00.30.10.30.20.30.30.30.40.30.50.30.61.0.21.1.01.2.01.3.02.0.02.1.02.1.12.1.22.2.02.2.12.2.22.3.02.4.02.4.12.4.22.4.32.4.43.0.03.1.03.2.03.2.13.2.23.2.33.2.43.2.53.3.03.3.13.4.03.4.13.4.23.5.03.6.03.6.13.6.24.0.0-alpha.04.0.04.0.14.0.24.0.34.0.44.0.54.0.64.0.74.1.04.1.14.1.24.1.35.0.0-beta5.0.0-beta.15.0.05.0.15.0.25.1.05.1.15.1.25.1.35.2.05.3.05.4.05.4.15.4.25.4.35.5.05.5.15.5.25.6.05.7.05.7.15.7.25.7.35.7.45.7.55.8.05.9.06.0.0-beta.16.0.0-beta.26.0.0-beta.36.0.0-beta.46.0.0-beta.56.0.0-beta.66.0.0-beta.76.0.0-beta.86.0.0-beta.96.0.06.0.16.0.2
/**
* Get the declared text direction for an element.
*
* @param {Node} element
* @returns {string|undefined}
*/
function getTextDirection (element) {
// There is another way to determine text direction using getComputedStyle(), as done here:
// https://github.com/pencil-js/text-direction/blob/2a235ce95089b3185acec3b51313cbba921b3811/text-direction.js
//
// We do not use that approach because we are interested specifically in the _declared_ text direction.
// If no text direction is declared, we have to provide our own explicit text direction so our
// bidirectional CSS style sheets work.
while (element && !element.dir) {
element = element.parentNode
}
return element ? element.dir : undefined
module.exports = getTextDirection