-
Notifications
You must be signed in to change notification settings - Fork 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update license headers and address review comments
Signed-off-by: Craig Perkins <cwperx@amazon.com>
- Loading branch information
Showing
5 changed files
with
15 additions
and
24 deletions.
There are no files selected for viewing
8 changes: 1 addition & 7 deletions
8
src/plugins/saved_objects_management/public/lib/filter_query.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 5 additions & 9 deletions
14
src/plugins/saved_objects_management/public/lib/filter_query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Any modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
export function filterQuery(allowedVals: string[], requestedVals: string[]): string[] { | ||
const filteredVals = allowedVals.filter((val) => !requestedVals || requestedVals.includes(val)); | ||
export function filterQuery(allowedVals: string[], requestedVals?: string[]): string[] { | ||
const filteredVals = requestedVals | ||
? allowedVals.filter((val) => requestedVals.includes(val)) | ||
: allowedVals; | ||
return filteredVals; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters