Sha256: 0a4157807f57e872a587358c469ca86fc47a923aa6782fac43a9f70af3172570

Contents?: true

Size: 192 Bytes

Versions: 19

Compression:

Stored size: 192 Bytes

Contents

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/underscore.string/chop.js
ela-4.1.5 node_modules/underscore.string/chop.js
ela-4.1.4 node_modules/underscore.string/chop.js
ela-4.1.3 node_modules/underscore.string/chop.js
ela-4.1.2 node_modules/underscore.string/chop.js
ela-4.1.1 node_modules/underscore.string/chop.js
ela-4.1.0 node_modules/underscore.string/chop.js
ela-4.0.0 node_modules/underscore.string/chop.js
ela-3.4.3 node_modules/underscore.string/chop.js
ela-3.4.2 node_modules/underscore.string/chop.js
ela-3.4.0 node_modules/underscore.string/chop.js
ela-3.3.1 node_modules/underscore.string/chop.js
ela-3.3.0 node_modules/underscore.string/chop.js
ela-3.2.0 node_modules/underscore.string/chop.js
ela-3.1.1 node_modules/underscore.string/chop.js
ela-3.1.0 node_modules/underscore.string/chop.js
ela-3.0.0 node_modules/underscore.string/chop.js
ela-2.0.0 node_modules/underscore.string/chop.js
ela-1.1.0 node_modules/underscore.string/chop.js