Last active
October 21, 2022 00:01
-
-
Save jonesnxt/950afb38f308ea68095143f243da64e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S('MemberExpression').each((expression) => { | |
const [name, index] = expression.children().map((child) => child.text()); | |
const nameDotLength = `${name}.length`; | |
if (!index.startsWith(nameDotLength)) return; | |
expression.text(`${name}.at(${index.slice(nameDotLength.length)})`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment