How to use the include function from underscore.string
Find comprehensive JavaScript underscore.string.include code examples handpicked from public code repositorys.
GitHub: ticup/emotional
294 295 296 297 298 299 300 301 302 303
if (w == "(!)") { a.push([[w], 0.0, 1.0, 1.0, 1, IRONY]); } // EMOTICONS: {("grin", +1.0): set((":-D", ":D"))} // if ((!w.match(/^[0-9]+$/i)) && (w.length <= 5) && _str.include(PUNCTUATION, w)) { Object.keys(EMOTICONS).forEach(function (type) { if (_.contains(EMOTICONS[type].e, w.toLowerCase())) { a.push([[w], EMOTICONS[type].p, 1.0, 1.0, 1, MOOD]); }
7
36
4
981 982 983 984 985 986 987 988 989 990
s.lstrip = s.ltrim; s.rstrip = s.rtrim; s.center = s.lrpad; s.rjust = s.lpad; s.ljust = s.rpad; s.contains = s.include; s.q = s.quote; s.toBool = s.toBoolean; s.camelcase = s.camelize; s.mapChars = s.map;
0
6
0
GitHub: drschwabe/gamegrid
717 718 719 720 721 722 723 724 725 726
t.equals( firstGridDotCount , 9, 'There are 9 dots representing 9 blank cells ' ) t.equals( firstGridEdgeCount , 6, 'There are 6 brackets representing 6 edges') //gg.insertEnty(3, 'H') console.log( grids[1] ) var secondGridHasHero = _s.include( grids[1], 'H') var cellsBeforeHero = _s( grids[1] ).strLeft('H' ).count('.') var cellsAfterHero = _s( grids[1] ).strRight('H' ).count('.') t.ok(secondGridHasHero, 'Hero is in the grid')
0
4
0
26 27 28 29 30 31 32 33 34 35
if (_.isEmpty(project)) { // See if we have a partial match with exactly one project. var projectNames = _.pluck(data2, 'name'); var matchingProjects = _.filter(projectNames, function (value) { return _s.include(value, projectName); }); console.log('Might mean: '); console.log(matchingProjects);
0
1
0
68 69 70 71 72 73 74 75 76 77
throw `Sorry, year undefined for ${JSON.stringify(r)}`; } if (!_.isUndefined(r.month)) { let mn = _.find(months, v => { return $.include(r.month.toLowerCase(), v.short); }); if (!_.isUndefined(mn)) { r.month = mn.long; }
0
0
2
underscore.string.slugify is the most popular function in underscore.string (323 examples)