MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / undefinedMap

Function undefinedMap

shared/src/utility.ts:23–31  ·  view source on GitHub ↗
(
	t: T | undefined,
	f: (_: T) => R,
)

Source from the content-addressed store, hash-verified

21}
22
23export function undefinedMap<T, R>(
24 t: T | undefined,
25 f: (_: T) => R,
26): R | undefined {
27 if (t === undefined) {
28 return t as undefined
29 }
30 return f(t)
31}
32
33export function nullMap<T, R>(t: T | null, f: (_: T) => R): R | null {
34 if (t === null) {

Callers 7

getPostFunction · 0.90
getTemplateFunction · 0.90
getNookFunction · 0.90
cardToDocTypeFunction · 0.90
getMediaFunction · 0.90
getTemplateFunction · 0.90
getTemplateIdByRemoteIdFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected