Code coverage report for master/chop.js

Statements: 100% (6 / 6)      Branches: 100% (4 / 4)      Functions: 100% (1 / 1)      Lines: 100% (5 / 5)      Ignored: none     

All files » master/ » chop.js
1 2 3 4 5 6 71 5 4 4 4    
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];
};