2 ms·
This isn't for the whole thing, but a common pattern to clean up that inner part could be something like: return { '>': '>', '<': '<', '&': '&', '
by petercooper 14y ago
This isn't for the whole thing, but a common pattern to clean up that inner part could be something like:
return { '>': '>', '<': '<', '&': '&', '"': '"' }[t] || t
All formatted nicer than that, of course ;-)