Version 1
[yaffs-website] / node_modules / underscore.string / chop.js
diff --git a/node_modules/underscore.string/chop.js b/node_modules/underscore.string/chop.js
new file mode 100644 (file)
index 0000000..73e17eb
--- /dev/null
@@ -0,0 +1,6 @@
+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];
+};