mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
Spreadsheet: Remove custom JS string split function implementation
This commit is contained in:
parent
dc8e69eb44
commit
f70bed7339
1 changed files with 1 additions and 17 deletions
|
@ -109,27 +109,11 @@ function range(start, end, columnStep, rowStep) {
|
||||||
return cells;
|
return cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Remove this and use String.split() eventually
|
|
||||||
function split(str, sep) {
|
|
||||||
const parts = [];
|
|
||||||
let splitIndex = -1;
|
|
||||||
for (;;) {
|
|
||||||
splitIndex = str.indexOf(sep);
|
|
||||||
if (splitIndex == -1) {
|
|
||||||
if (str.length) parts.push(str);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
parts.push(str.substring(0, splitIndex));
|
|
||||||
str = str.slice(splitIndex + sep.length);
|
|
||||||
}
|
|
||||||
return parts;
|
|
||||||
}
|
|
||||||
|
|
||||||
function R(fmt, ...args) {
|
function R(fmt, ...args) {
|
||||||
if (args.length !== 0) throw new TypeError("R`` format must be literal");
|
if (args.length !== 0) throw new TypeError("R`` format must be literal");
|
||||||
|
|
||||||
fmt = fmt[0];
|
fmt = fmt[0];
|
||||||
return range(...split(fmt, ":"));
|
return range(...fmt.split(":"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function select(criteria, t, f) {
|
function select(criteria, t, f) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue