kbrsh / wade

:ocean: Blazing fast 1kb search library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: e.toLowerCase is not a function

opened this issue · comments

Error:

TypeError: e.toLowerCase is not a function wade:6:1485
	a https://unpkg.com/wade:6:1485
	s.process https://unpkg.com/wade:6:2116
	s https://unpkg.com/wade:6:1925

Code:

var entries = [
	{
	"title":"Example",
	"link":"Example"
	},	{
	"title":"Example",
	"link":"http://example.com"
	},	{
	"title":"Example",
	"link":"http://example.com"
	}
]
var search = Wade(entries)

Please note that Wade is a text-only search engine, and that you must give it an array of strings. In your case you're giving it an array of objects, which explains the error: objects don't generally have an toLowerCase function. see also #7

Yup, @MMeent is correct. An array of strings must be passed, as Wade only supports searching string arrays as of now.

That means your array will have to look more like:

["Example", "Another Example", "Last Example"]

Closing in favor or #7.