Comparing version 0.0.9 to 0.1.0
@@ -65,3 +65,2 @@ /** | ||
callback(null, this); | ||
} else { | ||
@@ -171,3 +170,3 @@ // Convert the file into one giant string to search through later | ||
// Build the regex and run the search | ||
return searchData(new RegExp(kanji), "kanji"); | ||
return searchData(new RegExp("^" + kanji + "$"), "kanji"); | ||
} | ||
@@ -190,3 +189,3 @@ }; | ||
} else { | ||
return aggregate(this.data, this.type(), "kana"); | ||
return aggregate(this.data, "kana"); | ||
} | ||
@@ -199,3 +198,3 @@ }, | ||
} else { | ||
return aggregate(this.data, this.type(), "romaji"); | ||
return aggregate(this.data, "romaji"); | ||
} | ||
@@ -208,3 +207,3 @@ }, | ||
} else { | ||
return aggregate(this.data, this.type(), "kanji"); | ||
return aggregate(this.data, "kanji"); | ||
} | ||
@@ -225,9 +224,5 @@ }, | ||
var aggregate = function(entries, type, key) { | ||
var aggregate = function(entries, key) { | ||
return entries.map(function(entry) { | ||
if (type === "unknown" || | ||
entry.type === type || | ||
entry.type === "unknown") { | ||
return entry[key]; | ||
} | ||
return entry[key]; | ||
}).filter(function(name) { | ||
@@ -234,0 +229,0 @@ return !!name; |
{ | ||
"name": "enamdict", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"description": "Look up Romaji names and correct surname/given name usage.", | ||
@@ -5,0 +5,0 @@ "main": "enamdict.js", |
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
12956
347