[upd] plankton
This commit is contained in:
parent
7575c37a57
commit
b10f7baf68
3
lib/plankton/plankton.d.ts
vendored
3
lib/plankton/plankton.d.ts
vendored
|
|
@ -658,6 +658,9 @@ declare namespace lib_plankton.string {
|
|||
length?: int;
|
||||
indicator?: string;
|
||||
}): string;
|
||||
/**
|
||||
*/
|
||||
function slice(str: string, size: int): Array<string>;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
|
|
|
|||
|
|
@ -1775,6 +1775,18 @@ var lib_plankton;
|
|||
: (str.slice(0, options.length - options.indicator.length) + options.indicator));
|
||||
}
|
||||
string.limit = limit;
|
||||
/**
|
||||
*/
|
||||
function slice(str, size) {
|
||||
let slices = [];
|
||||
let rest = str;
|
||||
while (rest.length > 0) {
|
||||
slices.push(rest.slice(0, size));
|
||||
rest = rest.slice(size);
|
||||
}
|
||||
return slices;
|
||||
}
|
||||
string.slice = slice;
|
||||
})(string = lib_plankton.string || (lib_plankton.string = {}));
|
||||
})(lib_plankton || (lib_plankton = {}));
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue