

Reading a tab as however many spaces is trivial, and the point of tabs.
Reading however many spaces as a tab is a gross hack that has to be dialed-in for whatever standard the document chose.
Just use tabs in the first place. God damn. That’s what they’re for.
For Javascript it’s
() => { }
. Lamba functions! Because at least it’s more readable than Perl.