Skip to content

Commit

Permalink
config param removal (#627)
Browse files Browse the repository at this point in the history
* config param removal

* doc
  • Loading branch information
izulin committed Apr 9, 2021
1 parent e6cf049 commit 82c0053
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- GPU.js constructor needs to be provided directly to engine configuration. (#355)
- A deprecated config option vlookupThreshold has been removed. (#620)

### Added
- Added support for row and column reordering. (#343)
Expand Down
22 changes: 1 addition & 21 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,6 @@ export interface ConfigParams {
* @category Engine
*/
useStats: boolean,
/**
* Determines minimum number of elements a range must have in order to use binary search.
* Shorter ranges will be searched naively.
* Used by VLOOKUP, HLOOKUP and MATCH functions.
*
* @default 20
*
* @category Engine
*
* @deprecated Use {@link binarySearchThreshold} instead.
*/
vlookupThreshold: number,
/**
* Determines minimum number of elements a range must have in order to use binary search.
* Shorter ranges will be searched naively.
Expand Down Expand Up @@ -421,7 +409,6 @@ export class Config implements ConfigParams, ParserConfig {
precisionRounding: 14,
useColumnIndex: false,
useStats: false,
vlookupThreshold: 20,
binarySearchThreshold: 20,
nullDate: {year: 1899, month: 12, day: 30},
undoLimit: 20,
Expand Down Expand Up @@ -493,8 +480,6 @@ export class Config implements ConfigParams, ParserConfig {
/** @inheritDoc */
public readonly useStats: boolean
/** @inheritDoc */
public readonly vlookupThreshold: number
/** @inheritDoc */
public readonly binarySearchThreshold: number
/** @inheritDoc */
public readonly nullDate: SimpleDate
Expand Down Expand Up @@ -567,7 +552,6 @@ export class Config implements ConfigParams, ParserConfig {
precisionEpsilon,
precisionRounding,
useColumnIndex,
vlookupThreshold,
binarySearchThreshold,
nullDate,
useStats,
Expand Down Expand Up @@ -611,9 +595,7 @@ export class Config implements ConfigParams, ParserConfig {
this.validateNumberToBeAtLeast(this.precisionEpsilon, 'precisionEpsilon', 0)
this.useColumnIndex = this.valueFromParam(useColumnIndex, 'boolean', 'useColumnIndex')
this.useStats = this.valueFromParam(useStats, 'boolean', 'useStats')
this.vlookupThreshold = this.valueFromParam(vlookupThreshold, 'number', 'vlookupThreshold')
this.validateNumberToBeAtLeast(this.vlookupThreshold, 'vlookupThreshold', 1)
this.binarySearchThreshold = this.valueFromParam(binarySearchThreshold ?? vlookupThreshold, 'number', 'vlookupThreshold')
this.binarySearchThreshold = this.valueFromParam(binarySearchThreshold, 'number', 'binarySearchThreshold')
this.validateNumberToBeAtLeast(this.binarySearchThreshold, 'binarySearchThreshold', 1)
this.parseDateTime = this.valueFromParam(parseDateTime, 'function', 'parseDateTime')
this.stringifyDateTime = this.valueFromParam(stringifyDateTime, 'function', 'stringifyDateTime')
Expand Down Expand Up @@ -641,8 +623,6 @@ export class Config implements ConfigParams, ParserConfig {
})
this.validateNumberToBeAtLeast(this.maxColumns, 'maxColumns', 1)

this.warnDeprecatedIfUsed(vlookupThreshold, 'vlookupThreshold', 'v.0.3.0', 'binarySearchThreshold')

this.checkIfParametersNotInConflict(
{value: this.decimalSeparator, name: 'decimalSeparator'},
{value: this.functionArgSeparator, name: 'functionArgSeparator'},
Expand Down
7 changes: 0 additions & 7 deletions test/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ describe('Config', () => {
expect(() => new Config({ undoLimit: -1 })).toThrowError('Config parameter undoLimit should be at least 0')
})

it('#vlookupThreshold', () => {
expect(() => new Config({ vlookupThreshold: 1 })).not.toThrowError()
expect(() => new Config({ vlookupThreshold: 42 })).not.toThrowError()
expect(() => new Config({ vlookupThreshold: Infinity })).not.toThrowError()
expect(() => new Config({ vlookupThreshold: 0 })).toThrowError('Config parameter vlookupThreshold should be at least 1')
})

it('#binarySearchThreshold', () => {
expect(() => new Config({ binarySearchThreshold: 1 })).not.toThrowError()
expect(() => new Config({ binarySearchThreshold: 42 })).not.toThrowError()
Expand Down

0 comments on commit 82c0053

Please sign in to comment.