废话不说,直接上代码
function clamp_range(range) {
if(range.e.r >= (1<<20)) range.e.r = (1<<20)-1;
if(range.e.c >= (1<<14)) range.e.c = (1<<14)-1;
return range;
}
var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g;
/*
inserts `nrows` rows BEFORE specified `start_row`
- ws = worksheet object
- start_row = starting row (0-indexed) | default 0
- nrows = number of rows to add | default 1
- opts = options:
+ fill = set to true to "fill" cell styles and formulae
*/
function insert_rows(ws, start_row, nrows, opts) {
if(!ws) throw new Error("operation expects a worksheet");
var dense = Array.isArray(ws);
if(!nrows) nrows = 1;
if(!start_row) start_row = 0;
if(!opts) opts = {};
/*