nl_tokens: let s try to keep the complexity down ... If we have to do this much more let s break this up / * eslint - disable complexity Logically converts the given value to the correct version based on the key and flow direction context
pl_tokens: function getValueDoppelganger ( key , originalValue , isRtl ) { if ( isNullOrUndefined ( originalValue ) ) { return originalValue } const flowDirection = isRtl ? 'rtl' : 'ltr' if ( isObject ( originalValue ) ) { return convert ( originalValue , flowDirection ) // recurssion 🌀 } const { isLogical , logicallessValue , isImportant , importantlessValue , } = analyzeOriginalValue ( originalValue ) if ( canHaveLogical . includes ( key ) && ! isLogical ) { return originalValue } const isFourDirectionalShorthand = <mask> ( [ 'margin' , 'padding' , 'borderColor' , 'borderRadius' , 'borderStyle' , 'borderWidth' , ] , key , ) if ( isLogical && ! isRtl && ! isFourDirectionalShorthand && ! key . match ( / (background)|((t|T)ransformOrigin) / ) ) { return logicallessValue } const conversionMap = valuesToConvert [ flowDirection ] // The logical props and values changes the default way you write four-directional shorhands // so that the order of values is `block-start`, `inline-start`, `block-end` and `inline-end`, which, // for the `inline-*` sides, is the opposite of how they are written without the `logical` keyword if ( isLogical && isFourDirectionalShorthand ) { return isRtl ? logicallessValue : convertValues ( key , importantlessValue , conversionMap , isImportant , // Reversing `isRtl` like this is crooked, but for the time being, it is the easiest way to // address how values of four-directional shorthand properties with the `logical` keyword // should be handled according to the spec. ! isRtl , ) } return convertValues ( key , importantlessValue , conversionMap , isImportant , isRtl , ) }