Skip to content

Commit

Permalink
feat(utilities): add utility functions to make for cleaner consuming …
Browse files Browse the repository at this point in the history
…code
  • Loading branch information
dancrumb committed May 7, 2024
1 parent 3072264 commit 6c9057e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/utilities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* This is the identity function - it returns whatever you pass in
*/
export const identity = <T>(t: T) => t
/**
* {@link identity}
*/
export const asIs = identity

/**
* This function returns undefined, whatever you pass in
*/
export const drop = (t: unknown) => undefined
/**
* {@link drop}
*/
export const asUndefined = drop;


export const logError = (e: Error) => {
console.error(e)
}

0 comments on commit 6c9057e

Please sign in to comment.