2 ms·
you can replace with this: function shorten(text, length) { return new Promise((a, r) => fetch(`http://leftpad.io/shorten?l=${length}&v=${encod
by stestagg 6y ago
you can replace with this:
function shorten(text, length) {
return new Promise((a, r) =>
fetch(`http://leftpad.io/shorten?l=${length}&v=${encodeURIComponent(text)}`).then(rx=>rx.text().then(a, r), r));
}