lucaong / minisearch

Tiny and powerful JavaScript full-text search engine for browser and Node
https://lucaong.github.io/minisearch/
MIT License
4.67k stars 133 forks source link

Ensure that loadJS can be subclassed #179

Closed maccman closed 1 year ago

lucaong commented 1 year ago

Thank you for this @maccman ! I will need to merge this with the changes in #183 , but I can include this in the next release.

lucaong commented 1 year ago

I merged the conflicts with latest master.

@maccman that said, I think that in order to achieve what you want, it is enough to change MiniSearch.loadJS(...) to this.loadJS(...) inside loadJSON (see here). That avoids introducing an instance method.

If so, I prepared and merged another pull request, also adding a test for it.

lucaong commented 1 year ago

Thanks again @maccman . I am closing this in favor of #185 , but feel free to comment on this if something is left out.