Page MenuHomestyx hydra

TypeaheadNormalizer.js
No OneTemporary

TypeaheadNormalizer.js

/**
* @requires javelin-install
* @provides javelin-typeahead-normalizer
* @javelin
*/
/**
* @group control
*/
JX.install('TypeaheadNormalizer', {
statics : {
/**
* Normalizes a string by lowercasing it and stripping out extra spaces
* and punctuation.
*
* @param string
* @return string Normalized string.
*/
normalize : function(str) {
return ('' + str)
.toLocaleLowerCase()
.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g, '')
.replace(/ +/g, ' ')
.replace(/^\s*|\s*$/g, '');
}
}
});

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 24, 2:42 PM (15 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
399710
Default Alt Text
TypeaheadNormalizer.js (572 B)

Event Timeline