This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add apps to fills endpoint * Add apps to fill endpoint
- Loading branch information
Showing
6 changed files
with
107 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const _ = require('lodash'); | ||
|
||
const { FILL_ATTRIBUTION_TYPE } = require('../constants'); | ||
|
||
const formatFillAttributionType = type => { | ||
if (type === undefined) { | ||
return undefined; | ||
} | ||
|
||
const matchingKey = _.findKey(FILL_ATTRIBUTION_TYPE, value => type === value); | ||
|
||
if (matchingKey === undefined) { | ||
throw new Error(`Unrecognised fill attribution type: ${type}`); | ||
} | ||
|
||
return matchingKey.toLowerCase(); | ||
}; | ||
|
||
module.exports = formatFillAttributionType; |
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