0.1.0 • Published 7 years ago
@express-love/map-values-async v0.1.0
Installation
npm install @express-love/map-values-asyncUsage
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
sourceObject 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
7 years ago