Skip to content

Commit

Permalink
Add lunr to package.json (#1238)
Browse files Browse the repository at this point in the history
* Update lunr.js

* Add lunr dependency to package.json

allows to simply `npm install` all deps
  • Loading branch information
krOoze authored Jun 29, 2020
1 parent fe464cb commit ae68123
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/chunkindex/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Portions of the chunked.js script are taken from
These portions are copyright Scott Jehl, Filament Group, Inc., under an MIT
license.

The lunr.js script is taken from the 'lunr' npm package, version 2.3.6. It
The lunr.js script is taken from the 'lunr' npm package, version 2.3.8. It
is copyright Oliver Nightingale, under an MIT license.
16 changes: 10 additions & 6 deletions config/chunkindex/lunr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.6
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.8
* Copyright (C) 2019 Oliver Nightingale
* @license MIT
*/
Expand Down Expand Up @@ -54,7 +54,7 @@ var lunr = function (config) {
return builder.build()
}

lunr.version = "2.3.6"
lunr.version = "2.3.8"
/*!
* lunr.utils
* Copyright (C) 2019 Oliver Nightingale
Expand Down Expand Up @@ -424,7 +424,7 @@ lunr.tokenizer = function (obj, metadata) {
})
}

var str = obj.toString().trim().toLowerCase(),
var str = obj.toString().toLowerCase(),
len = str.length,
tokens = []

Expand Down Expand Up @@ -509,8 +509,8 @@ lunr.Pipeline.registeredFunctions = Object.create(null)
* or mutate (or add) metadata for a given token.
*
* A pipeline function can indicate that the passed token should be discarded by returning
* null. This token will not be passed to any downstream pipeline functions and will not be
* added to the index.
* null, undefined or an empty string. This token will not be passed to any downstream pipeline
* functions and will not be added to the index.
*
* Multiple tokens can be returned by returning an array of tokens. Each token will be passed
* to any downstream pipeline functions and all will returned tokens will be added to the index.
Expand Down Expand Up @@ -673,7 +673,7 @@ lunr.Pipeline.prototype.run = function (tokens) {
for (var j = 0; j < tokens.length; j++) {
var result = fn(tokens[j], j, tokens)

if (result === void 0 || result === '') continue
if (result === null || result === void 0 || result === '') continue

if (Array.isArray(result)) {
for (var k = 0; k < result.length; k++) {
Expand Down Expand Up @@ -1606,6 +1606,10 @@ lunr.TokenSet.fromString = function (str) {
* Converts this TokenSet into an array of strings
* contained within the TokenSet.
*
* This is not intended to be used on a TokenSet that
* contains wildcards, in these cases the results are
* undefined and are likely to cause an infinite loop.
*
* @returns {string[]}
*/
lunr.TokenSet.prototype.toArray = function () {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"devDependencies": {
"escape-string-regexp": "^2.0.0",
"he": "^1.2.0"
"he": "^1.2.0",
"lunr": "2.3.8"
}
}

0 comments on commit ae68123

Please sign in to comment.