forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript (v3): Ramdectomy (awsdocs#5481)
* JavaScript (v3): Ramdaectomy - Remove ramda usage from cognito-identity-provider. * JavaScript (v3): Ramdaectomy - Remove ramda usage from aurora-serverless-app. * JavaScript (v3): Ramdaectomy - Remove ramda usage from glue. * JavaScript (v3): Ramdaectomy - Remove ramda usage from lambda. * JavaScript (v3): Ramdaectomy - Remove ramda usage cmd-runner. * JavaScript (v3): Ramdaectomy - Remove remaining ramda usage. * JavaScript (v3): Ramdaectomy - Add missing copyright. --------- Co-authored-by: ford prior <[email protected]>
- Loading branch information
1 parent
8e1fbe4
commit 341c6ad
Showing
51 changed files
with
12,602 additions
and
14,821 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
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
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
30 changes: 10 additions & 20 deletions
30
javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/parse-item.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,24 +1,14 @@ | ||
import { pipe, zipWith, fromPairs } from "ramda"; | ||
import { Item } from "src/types/item.js"; | ||
import { Item } from "../types/item.js"; | ||
|
||
const makePairs = (key: string, value: DBRecordValue) => { | ||
if (key === "archived") { | ||
return [key, Boolean(value.longValue)]; | ||
} else { | ||
return [key, value.stringValue]; | ||
} | ||
const parseItem = (record: DBRecord): Item => { | ||
return { | ||
id: `${record[0].stringValue}`, | ||
description: `${record[1].stringValue}`, | ||
guide: `${record[2].stringValue}`, | ||
status: `${record[3].stringValue}`, | ||
name: `${record[4].stringValue}`, | ||
archived: Boolean(record[5].longValue), | ||
}; | ||
}; | ||
|
||
const parseItem: (record: DBRecord) => Item = pipe( | ||
zipWith(makePairs, [ | ||
"id", | ||
"description", | ||
"guide", | ||
"status", | ||
"name", | ||
"archived", | ||
]), | ||
fromPairs | ||
); | ||
|
||
export { parseItem }; |
Oops, something went wrong.