olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.87k stars 546 forks source link

Switch to strict mode and fix `this` usage issue #516

Open irnc opened 2 years ago

irnc commented 2 years ago

Fixes https://github.com/olivernn/lunr.js/issues/324 (allowing lunr.js import as module and usage in other strict environments) by switching lunr itself to strict mode and fixing this usage.

wrapper_end was updated to the latest version of template, which uses self to access window and thus works in strict mode.

lurn.utils.warn was changed as in https://github.com/olivernn/lunr.js/pull/411.

Added tests check conditional usage of console. Tests succeed in both Node and browser.