lucene-query-builder
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -10,5 +10,5 @@ import { Filter, Options, QueryParams } from './types'; | ||
* | ||
* @param {Options} options - The options to configure the QueryBuilder. | ||
* @param {Options} [options={}] - Optional options to configure the QueryBuilder. | ||
*/ | ||
constructor(options: Options); | ||
constructor(options?: Options); | ||
/** | ||
@@ -15,0 +15,0 @@ * Builds a query string based on the provided parameters. |
@@ -14,6 +14,11 @@ "use strict"; | ||
* | ||
* @param {Options} options - The options to configure the QueryBuilder. | ||
* @param {Options} [options={}] - Optional options to configure the QueryBuilder. | ||
*/ | ||
constructor(options) { | ||
this.options = options; | ||
constructor(options = {}) { | ||
const defaultOptions = { | ||
fuzzyLetters: 5, | ||
fuzzyLevel: 1, | ||
urlEncoded: false, | ||
}; | ||
this.options = Object.assign(Object.assign({}, defaultOptions), options); | ||
} | ||
@@ -20,0 +25,0 @@ /** |
@@ -10,5 +10,5 @@ import { Filter, Options, QueryParams } from './types'; | ||
* | ||
* @param {Options} options - The options to configure the QueryBuilder. | ||
* @param {Options} [options={}] - Optional options to configure the QueryBuilder. | ||
*/ | ||
constructor(options: Options); | ||
constructor(options?: Options); | ||
/** | ||
@@ -15,0 +15,0 @@ * Builds a query string based on the provided parameters. |
@@ -11,6 +11,11 @@ import { processPhrase } from './functions/processPhrase'; | ||
* | ||
* @param {Options} options - The options to configure the QueryBuilder. | ||
* @param {Options} [options={}] - Optional options to configure the QueryBuilder. | ||
*/ | ||
constructor(options) { | ||
this.options = options; | ||
constructor(options = {}) { | ||
const defaultOptions = { | ||
fuzzyLetters: 5, | ||
fuzzyLevel: 1, | ||
urlEncoded: false, | ||
}; | ||
this.options = Object.assign(Object.assign({}, defaultOptions), options); | ||
} | ||
@@ -17,0 +22,0 @@ /** |
{ | ||
"name": "lucene-query-builder", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Library to build lucene queries in a typescript friendly way", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js", |
33288
686