Skip to content

Commit

Permalink
feat(types): add postMap to MapPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Mar 6, 2021
1 parent 7ba77ce commit bbdd895
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Empty file.
11 changes: 11 additions & 0 deletions packages/types/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ export interface MapPlugin<TKey = unknown> {
destinationObj?: TDestination
): [sourceInstance: TSource, destinationInstance: TDestination];

/**
* An optional post-map function to post-process the destination after map
*
* @param destination - a key to be used to identify the information about a particular Destination
* @param destinationObj - a plain object that takes the shape of the destination
*/
postMap?<TDestination extends Dictionary<TDestination> = any>(
destination: TKey,
destinationObj?: TDestination
): TDestination;

/**
* An optional pre-mapArray function to prepare the sourceArray before mapArray
*
Expand Down

0 comments on commit bbdd895

Please sign in to comment.