Skip to content

Commit

Permalink
feat(empty): add empty function
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Oct 11, 2019
1 parent 0dcd586 commit 7c34ec9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ export const keys: <T>(dictionary: ReadonlyDictionary<T>) => string[] = Object.k

export const values: <T>(dictionary: ReadonlyDictionary<T>) => T[] = Object.values;

export const entries: <T>(dictionary: ReadonlyDictionary<T>) => Array<[string, T]> = Object.entries;
export const entries: <T>(dictionary: ReadonlyDictionary<T>) => Array<[string, T]> = Object.entries;

export function empty<T>(dictionary: ReadonlyDictionary<T>): boolean {
return keys(dictionary).length === 0;
}

0 comments on commit 7c34ec9

Please sign in to comment.