Version 1
[yaffs-website] / node_modules / underscore.string / strLeft.js
diff --git a/node_modules/underscore.string/strLeft.js b/node_modules/underscore.string/strLeft.js
new file mode 100644 (file)
index 0000000..0602984
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeft(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.indexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};