Files
429499680c DEV: Replace deprecated String.prototype.substr() (#16233)
String.prototype.substr() is deprecated so we replace it with String.prototype.slice() which works similarily but isn't deprecated.

Signed-off-by: Tobias Speicher <[email protected]>
Co-authored-by: Jarek Radosz <[email protected]>
2022-04-01 17:35:17 +02:00

12 lines
224 B
JavaScript

export default function formatTextWithSelection(text, [start, len]) {
return [
'"',
text.slice(0, start),
"<",
text.slice(start, start + len),
">",
text.slice(start + len),
'"',
].join("");
}