Skip to content

Commit

Permalink
fix(keys): that if collection is Promise then is not resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
yisraelx committed Jun 26, 2018
1 parent 47594dc commit 1e89c39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/keys/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import _keys from '@promises/_keys';
* ```
*/
function keys(collection: IOptionalPromise<ArrayLike<any> | IDictionary<any>>): Promise<string[]> {
let keys = _keys(collection);
return Promise.resolve(keys);
return Promise.resolve(collection).then((collection: ArrayLike<any> | IDictionary<any>) => {
let keys: string[] = _keys(collection);
return Promise.resolve(keys);
});
}

export default keys;

0 comments on commit 1e89c39

Please sign in to comment.