Version 1
[yaffs-website] / node_modules / underscore.string / words.js
diff --git a/node_modules/underscore.string/words.js b/node_modules/underscore.string/words.js
new file mode 100644 (file)
index 0000000..be55c9c
--- /dev/null
@@ -0,0 +1,7 @@
+var isBlank = require('./isBlank');
+var trim = require('./trim');
+
+module.exports = function words(str, delimiter) {
+  if (isBlank(str)) return [];
+  return trim(str, delimiter).split(delimiter || /\s+/);
+};