-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds findAll finder to test utils (#330)
- Loading branch information
1 parent
97dee37
commit 4a5fb2a
Showing
5 changed files
with
643 additions
and
31 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const pluralizationMap = { | ||
Board: "Boards", | ||
BoardItem: "BoardItems", | ||
ItemsPalette: "ItemsPalettes", | ||
PaletteItem: "PaletteItems", | ||
}; | ||
|
||
function pluralizeComponentName(componentName) { | ||
if (!(componentName in pluralizationMap)) { | ||
throw new Error(`Could not find the plural case for ${componentName}.`); | ||
} | ||
|
||
return pluralizationMap[componentName]; | ||
} | ||
|
||
export { pluralizeComponentName }; |
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
Oops, something went wrong.