dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/underscore.string/chop.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

6 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];
};