Sha256: b317290f67fc9dbbe4d5d30ba1588dc1aab760d502fedb51bf2b27f00761024c
Contents?: true
Size: 904 Bytes
Versions: 7
Compression:
Stored size: 904 Bytes
Contents
/* * typeahead.js * https://github.com/twitter/typeahead.js * Copyright 2013-2014 Twitter, Inc. and other contributors; Licensed MIT */ var tokenizers = (function() { 'use strict'; return { nonword: nonword, whitespace: whitespace, obj: { nonword: getObjTokenizer(nonword), whitespace: getObjTokenizer(whitespace) } }; function whitespace(str) { str = _.toStr(str); return str ? str.split(/\s+/) : []; } function nonword(str) { str = _.toStr(str); return str ? str.split(/\W+/) : []; } function getObjTokenizer(tokenizer) { return function setKey(/* key, ... */) { var args = [].slice.call(arguments, 0); return function tokenize(o) { var tokens = []; _.each(args, function(k) { tokens = tokens.concat(tokenizer(_.toStr(o[k]))); }); return tokens; }; }; } })();
Version data entries
7 entries across 7 versions & 1 rubygems