UNPKG

@aws-cdk-testing/cli-integ

Version:

Integration tests for the AWS CDK CLI

15 lines (14 loc) 289 B
/** * Return a memoized version of an function with 0 arguments. * * Async-safe. */ export function memoize0<A>(fn: () => Promise<A>): () => Promise<A> { let promise: Promise<A> | undefined; return () => { if (!promise) { promise = fn(); } return promise; }; }