![JAR search and dependency download from the Maven repository](/logo.png)
visualsearch.0.4.0.docs.inflector.html Maven / Gradle / Ivy
The newest version!
inflector.js Jump To … inflector.js
(function() {
var $ = jQuery; // Handle namespaced jQuery
Naive English transformations on words. Only used for a few transformations
in VisualSearch.js.
VS.utils.inflector = {
Delegate to the ECMA5 String.prototype.trim function, if available.
trim : function(s) {
return s.trim ? s.trim() : s.replace(/^\s+|\s+$/g, '');
},
Escape strings that are going to be used in a regex. Escapes punctuation
that would be incorrect in a regex.
escapeRegExp : function(s) {
return s.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
}
};
})();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy