trie-search
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -6,3 +6,3 @@ { | ||
"description": "A trie implementation that maps keys to objects for rapid retrieval by phrases. Most common use will be for typeahead searches.", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"main": "index.js", | ||
@@ -9,0 +9,0 @@ "url": "https://github.com/joshjung/trie-search", |
@@ -52,10 +52,3 @@ var HashArray = require('hasharray'); | ||
if (this.options.splitOnRegEx !== undefined) | ||
{ | ||
phrases = val.split(this.options.splitOnRegEx); | ||
for (var i = 0, l = phrases.length; i < l; i++) | ||
this.map(phrases[i], obj) | ||
} | ||
else this.map(val, obj); | ||
this.map(val, obj); | ||
} | ||
@@ -98,2 +91,12 @@ }, | ||
map: function (key, value) { | ||
if (this.options.splitOnRegEx && this.options.splitOnRegEx.test(key)) | ||
{ | ||
var phrases = key.split(this.options.splitOnRegEx); | ||
for (var i = 0, l = phrases.length; i < l; i++) | ||
this.map(phrases[i], value); | ||
return; | ||
} | ||
if (this.options.cache) | ||
@@ -100,0 +103,0 @@ this.clearCache(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8993279
1608