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

11 lines
250 B
JavaScript
Raw Normal View History

var makeString = require('./helper/makeString');
module.exports = function(str, substr) {
str = makeString(str);
substr = makeString(substr);
if (str.length === 0 || substr.length === 0) return 0;
return str.split(substr).length - 1;
};