0.1.0 • Published 6 years ago
@express-love/map-values-async v0.1.0
Installation
npm install @express-love/map-values-async
Usage
mapValuesAsync
Creates a shallow clone of the specified source
object. Any properties of
the source object that are promises will be replaced with the resolved value.
Parameters
source
Object An object with properties that might be promises
Examples
const result = await mapValuesAsync({
a: Promise.resolve('apples'),
b: Promise.resolve('bananas'),
c: 'corn',
});
expect(result).toEqual({
a: 'apples',
b: 'bananas',
c: 'corn',
});
Returns Object A clone of source
with the promise properties replaced with their
0.1.0
6 years ago