anorgatarrak-wordpress-theme/node_modules/underscore.string/strLeft.js

9 lines
232 B
JavaScript
Raw Normal View History

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