This repository was archived by the owner on Feb 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
add better documentation to --filter #414
Copy link
Copy link
Open
Description
related to
Line 320 in 4e5c19b
| filter: F.string({description: 'filter property by partial string matching, ex: name=foo'}), |
after reading
Lines 64 to 77 in fd0ca55
| if (this.options.filter) { | |
| /* eslint-disable-next-line prefer-const */ | |
| let [header, regex] = this.options.filter!.split('=') | |
| const isNot = header[0] === '-' | |
| if (isNot) header = header.substr(1) | |
| const col = this.findColumnFromHeader(header) | |
| if (!col || !regex) throw new Error('Filter flag has an invalid value') | |
| rows = rows.filter((d: any) => { | |
| const re = new RegExp(regex) | |
| const val = d[col!.key] | |
| const match = val.match(re) | |
| return isNot ? !match : match | |
| }) | |
| } |
I was able to deduce the
!= doesn't exist in the query language and a prepended - will do the trick
this could have been subverted if the help message would direct me to documentation on how the filter query language works
Metadata
Metadata
Assignees
Labels
No labels