Skip to content

Commit

Permalink
specific checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Despont committed Nov 26, 2024
1 parent 0be87fc commit 94e46ed
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,11 +1116,14 @@ class BootstrapTable {
}

if (typeof value === 'string' || typeof value === 'number') {
if (
(this.options.strictSearch && `${value}`.toLowerCase() === searchText) ||
(this.options.regexSearch && Utils.regexCompare(value, rawSearchText))
) {
return true
if (this.options.strictSearch) {
if ((`${value}`).toLowerCase() === searchText) {

Check failure on line 1120 in src/bootstrap-table.js

View workflow job for this annotation

GitHub Actions / test

Unnecessary parentheses around expression
return true
}
} else if (this.options.regexSearch) {
if (Utils.regexCompare(value, rawSearchText)) {
return true
}
} else {
const largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm
const matches = largerSmallerEqualsRegex.exec(this.searchText)
Expand Down

0 comments on commit 94e46ed

Please sign in to comment.