From 09df9cfbe85506681ca86c00faea79c9131f19ac Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:23:54 +1000 Subject: [PATCH 1/8] Update lunr.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A(n) [type] error occurred while [attempting to] {verb} {noun}. {cannot, can not, can't, could not} → unable to https://review.jami.net/c/jami-jams/+/29065/comment/2857ea48_cb8361d6/ --- lunr.js | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lunr.js b/lunr.js index 6aa370fb..ff1b0e22 100644 --- a/lunr.js +++ b/lunr.js @@ -106,7 +106,7 @@ lunr.utils.asString = function (obj) { * Clones an object. * * Will create a copy of an existing object such that any mutations - * on the copy cannot affect the original. + * on the copy are unable to affect the original. * * Only shallow objects are supported, passing a nested object to this * function will cause a TypeError. @@ -487,12 +487,12 @@ lunr.tokenizer.separator = /[\s\-]+/ * should return undefined, the rest of the pipeline will not be called with * this token. * - * For serialisation of pipelines to work, all functions used in an instance of + * For serialization of pipelines to work, all functions used in an instance of * a pipeline should be registered with lunr.Pipeline. Registered functions can - * then be loaded. If trying to load a serialised pipeline that uses functions + * then be loaded. If attempting to load a serialized pipeline that uses functions * that are not registered an error will be thrown. * - * If not planning on serialising the pipeline then registering pipeline functions + * If not planning on serializing the pipeline then registering pipeline functions * is not necessary. * * @constructor @@ -528,7 +528,7 @@ lunr.Pipeline.registeredFunctions = Object.create(null) * Register a function with the pipeline. * * Functions that are used in the pipeline should be registered if the pipeline - * needs to be serialised, or a serialised pipeline needs to be loaded. + * needs to be serialized, or a serialized pipeline needs to be loaded. * * Registering a function does not add it to a pipeline, functions must still be * added to instances of the pipeline for them to be used when running a pipeline. @@ -555,30 +555,30 @@ lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { var isRegistered = fn.label && (fn.label in this.registeredFunctions) if (!isRegistered) { - lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + lunr.utils.warn('Function is not registered with pipeline. This may cause errors when serializing the index.\n', fn) } } /** - * Loads a previously serialised pipeline. + * Loads a previously serialized pipeline. * * All functions to be loaded must already be registered with lunr.Pipeline. - * If any function from the serialised data has not been registered then an + * If any function from the serialized data has not been registered then an * error will be thrown. * - * @param {Object} serialised - The serialised pipeline to load. + * @param {Object} serialized - The serialized pipeline to load. * @returns {lunr.Pipeline} */ -lunr.Pipeline.load = function (serialised) { +lunr.Pipeline.load = function (serialized) { var pipeline = new lunr.Pipeline - serialised.forEach(function (fnName) { + serialized.forEach(function (fnName) { var fn = lunr.Pipeline.registeredFunctions[fnName] if (fn) { pipeline.add(fn) } else { - throw new Error('Cannot load unregistered function: ' + fnName) + throw new Error('An error occurred while loading unregistered function: ' + fnName) } }) @@ -615,7 +615,7 @@ lunr.Pipeline.prototype.after = function (existingFn, newFn) { var pos = this._stack.indexOf(existingFn) if (pos == -1) { - throw new Error('Cannot find existingFn') + throw new Error('An error occurred while finding existingFn.') } pos = pos + 1 @@ -636,7 +636,7 @@ lunr.Pipeline.prototype.before = function (existingFn, newFn) { var pos = this._stack.indexOf(existingFn) if (pos == -1) { - throw new Error('Cannot find existingFn') + throw new Error('An error occurred while finding existingFn.') } this._stack.splice(pos, 0, newFn) @@ -717,7 +717,7 @@ lunr.Pipeline.prototype.reset = function () { } /** - * Returns a representation of the pipeline ready for serialisation. + * Returns a representation of the pipeline ready for serialization. * * Logs a warning if the function has not been registered. * @@ -1816,7 +1816,7 @@ lunr.TokenSet.Builder.prototype.minimize = function (downTo) { node.parent.edges[node.char] = this.minimizedNodes[childKey] } else { // Cache the key for this node since - // we know it can't change anymore + // we know it is unable to change anymore node.child._str = childKey this.minimizedNodes[childKey] = node.child @@ -1922,7 +1922,7 @@ lunr.Index = function (attrs) { * For more programmatic querying use lunr.Index#query. * * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. - * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @throws {lunr.QueryParseError} If the passed query string was unable to be parsed. * @returns {lunr.Index~Result[]} */ lunr.Index.prototype.search = function (queryString) { @@ -2286,7 +2286,7 @@ lunr.Index.load = function (serializedIndex) { pipeline = lunr.Pipeline.load(serializedIndex.pipeline) if (serializedIndex.version != lunr.version) { - lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + lunr.utils.warn("Version mismatch when loading serialized index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") } for (var i = 0; i < serializedVectors.length; i++) { @@ -2409,7 +2409,7 @@ lunr.Builder.prototype.ref = function (ref) { * @param {object} attributes - Optional attributes associated with this field. * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. - * @throws {RangeError} fieldName cannot contain unsupported characters '/' + * @throws {RangeError} fieldName was unable to contain unsupported characters '/' */ lunr.Builder.prototype.field = function (fieldName, attributes) { if (/\//.test(fieldName)) { @@ -2611,8 +2611,8 @@ lunr.Builder.prototype.createFieldVectors = function () { scoreWithPrecision = Math.round(score * 1000) / 1000 // Converts 1.23456789 to 1.234. // Reducing the precision so that the vectors take up less - // space when serialised. Doing it now so that they behave - // the same before and after serialisation. Also, this is + // space when serialized. Doing it now so that they behave + // the same before and after serialization. Also, this is // the fastest approach to reducing a number's precision in // JavaScript. From 6c5317b0a21d90029b2158280d84d62ac6dc5a74 Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:26:44 +1000 Subject: [PATCH 2/8] Update pipeline.js --- lib/pipeline.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/pipeline.js b/lib/pipeline.js index e6654838..70ea37fc 100644 --- a/lib/pipeline.js +++ b/lib/pipeline.js @@ -22,12 +22,12 @@ * should return undefined, the rest of the pipeline will not be called with * this token. * - * For serialisation of pipelines to work, all functions used in an instance of + * For serialization of pipelines to work, all functions used in an instance of * a pipeline should be registered with lunr.Pipeline. Registered functions can - * then be loaded. If trying to load a serialised pipeline that uses functions + * then be loaded. If trying to load a serialized pipeline that uses functions * that are not registered an error will be thrown. * - * If not planning on serialising the pipeline then registering pipeline functions + * If not planning on serializing the pipeline then registering pipeline functions * is not necessary. * * @constructor @@ -63,7 +63,7 @@ lunr.Pipeline.registeredFunctions = Object.create(null) * Register a function with the pipeline. * * Functions that are used in the pipeline should be registered if the pipeline - * needs to be serialised, or a serialised pipeline needs to be loaded. + * needs to be serialized, or a serialized pipeline needs to be loaded. * * Registering a function does not add it to a pipeline, functions must still be * added to instances of the pipeline for them to be used when running a pipeline. @@ -90,24 +90,24 @@ lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { var isRegistered = fn.label && (fn.label in this.registeredFunctions) if (!isRegistered) { - lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serializing the index.\n', fn) } } /** - * Loads a previously serialised pipeline. + * Loads a previously serialized pipeline. * * All functions to be loaded must already be registered with lunr.Pipeline. - * If any function from the serialised data has not been registered then an + * If any function from the serialized data has not been registered then an * error will be thrown. * - * @param {Object} serialised - The serialised pipeline to load. + * @param {Object} serialized - The serialized pipeline to load. * @returns {lunr.Pipeline} */ -lunr.Pipeline.load = function (serialised) { +lunr.Pipeline.load = function (serialized) { var pipeline = new lunr.Pipeline - serialised.forEach(function (fnName) { + serialized.forEach(function (fnName) { var fn = lunr.Pipeline.registeredFunctions[fnName] if (fn) { @@ -252,7 +252,7 @@ lunr.Pipeline.prototype.reset = function () { } /** - * Returns a representation of the pipeline ready for serialisation. + * Returns a representation of the pipeline ready for serialization. * * Logs a warning if the function has not been registered. * From d35fda3681166399698f0fca349ca24554d32f5a Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:27:31 +1000 Subject: [PATCH 3/8] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit serialis… (en-GB) → serializ… (en-US) --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 5d96567b..b652a4b7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -459,7 +459,7 @@ lunr.Index.load = function (serializedIndex) { pipeline = lunr.Pipeline.load(serializedIndex.pipeline) if (serializedIndex.version != lunr.version) { - lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + lunr.utils.warn("Version mismatch when loading serialized index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") } for (var i = 0; i < serializedVectors.length; i++) { From d9a0932006156b588ea676119a6c17a425bc72a9 Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:28:16 +1000 Subject: [PATCH 4/8] Update builder.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit serialis… (en-GB) → serializ… (en-US) --- lib/builder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/builder.js b/lib/builder.js index a06ebc91..f0a3b76d 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -292,8 +292,8 @@ lunr.Builder.prototype.createFieldVectors = function () { scoreWithPrecision = Math.round(score * 1000) / 1000 // Converts 1.23456789 to 1.234. // Reducing the precision so that the vectors take up less - // space when serialised. Doing it now so that they behave - // the same before and after serialisation. Also, this is + // space when serialized. Doing it now so that they behave + // the same before and after serialization. Also, this is // the fastest approach to reducing a number's precision in // JavaScript. From 45a45690a0e38240d5f95da8d69c0310a3fe4fff Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:29:21 +1000 Subject: [PATCH 5/8] Update builder.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cannot → unable to --- lib/builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/builder.js b/lib/builder.js index f0a3b76d..bb6aac04 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -90,7 +90,7 @@ lunr.Builder.prototype.ref = function (ref) { * @param {object} attributes - Optional attributes associated with this field. * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. - * @throws {RangeError} fieldName cannot contain unsupported characters '/' + * @throws {RangeError} fieldName is unable to contain unsupported characters '/' */ lunr.Builder.prototype.field = function (fieldName, attributes) { if (/\//.test(fieldName)) { From 4b6e449fed7b6d3ff863080450f6cc9885f38ec4 Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:31:10 +1000 Subject: [PATCH 6/8] Update chai.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cannot → unable to --- test/env/chai.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/env/chai.js b/test/env/chai.js index 1d30296a..28e6232d 100644 --- a/test/env/chai.js +++ b/test/env/chai.js @@ -1,4 +1,4 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Date: Thu, 19 Sep 2024 06:31:47 +1000 Subject: [PATCH 7/8] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cannot → unable to --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index b652a4b7..5b3485c8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -95,7 +95,7 @@ lunr.Index = function (attrs) { * For more programmatic querying use lunr.Index#query. * * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. - * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @throws {lunr.QueryParseError} If the passed query string was unable to be parsed. * @returns {lunr.Index~Result[]} */ lunr.Index.prototype.search = function (queryString) { From 32cf4a780c54bf4e9d777f055369f3072f8b6c1e Mon Sep 17 00:00:00 2001 From: ovari <17465872+ovari@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:33:49 +1000 Subject: [PATCH 8/8] Update utils.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cannot → unable to --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 20ddf3c6..ba04c476 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -49,7 +49,7 @@ lunr.utils.asString = function (obj) { * Clones an object. * * Will create a copy of an existing object such that any mutations - * on the copy cannot affect the original. + * on the copy are unable to affect the original. * * Only shallow objects are supported, passing a nested object to this * function will cause a TypeError.