could this just be `lastUnderscore !== -1 && lastUnderscore !== nodeName.length - 1`?