New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

normalize-for-search

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-for-search - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

bower.json
{
"name": "normalize-for-search",
"version": "1.0.3",
"version": "1.0.4",
"main": "src/normalize.js",

@@ -5,0 +5,0 @@ "ignore": [

{
"name": "normalize-for-search",
"version": "1.0.3",
"version": "1.0.4",
"description": "Un-accents and un-umlauts characters in a string. Also preliminary converts the string to lower case. We use it for autocomplete: both for the matched strings -- on the server side, when indexing; and for the strings the user types into a text input in the browser.",

@@ -5,0 +5,0 @@ "main": "src/normalize.js",

@@ -7,41 +7,4 @@ /* jshint bitwise: false, maxcomplexity: 100 */

var normalizeForSearch = function (s) {
// Production steps of ECMA-262, Edition 5, 15.4.4.19
// Reference: http://es5.github.com/#x15.4.4.19
if (!Array.prototype.map) {
Array.prototype.map = function (callback, thisArg) {
var T, A, k, O, len, kValue, mappedValue;
if ((this === null) || (typeof this === 'undefined')) {
throw new TypeError(' this is null or not defined');
}
O = Object(this);
len = O.length >>> 0;
if (typeof callback !== 'function') {
throw new TypeError(callback + ' is not a function');
}
if (thisArg) {
T = thisArg;
}
A = new Array(len);
k = 0;
while (k < len) {
if (k in O) {
kValue = O[k];
mappedValue = callback.call(T, kValue, k, O);
A[k] = mappedValue;
}
k = k + 1;
}
return A;
};
}
return Array.prototype.map.call(s.toLowerCase(), function (c) {
function filter(c) {
switch (c) {

@@ -97,3 +60,10 @@ case 'ä':

}
}).join('');
}
var normalized = '', i, l;
s = s.toLowerCase();
for (i = 0, l = s.length; i < l; i = i + 1) {
normalized = normalized + filter(s.charAt(i));
}
return normalized;
};

@@ -100,0 +70,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc