Files
taimed/node_modules/underscore.string/chop.js
2025-07-24 17:21:45 +08:00

7 lines
192 B
JavaScript

module.exports = function chop(str, step) {
if (str == null) return [];
str = String(str);
step = ~~step;
return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
};