diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 16:27:34 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 21:55:16 +0200 |
commit | e7fa87bcc0052e1e99c6894e7e27a122374956b3 (patch) | |
tree | 56c243d08ae357533ebdb4fbf41211aa0fc914ce /src/helpers.ts | |
parent | 08bd3dc0e8a3c2370e4e8abbaa241eaafc144f4c (diff) |
documentation and tslint settings to check for docs
Diffstat (limited to 'src/helpers.ts')
-rw-r--r-- | src/helpers.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/helpers.ts b/src/helpers.ts index e5eb40211..eff5fa731 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -83,6 +83,10 @@ export function canonicalJson(obj: any): string { } +/** + * Check for deep equality of two objects. + * Only arrays, objects and primitives are supported. + */ export function deepEquals(x: any, y: any): boolean { if (x === y) { return true; @@ -98,6 +102,10 @@ export function deepEquals(x: any, y: any): boolean { } +/** + * Map from a collection to a list or results and then + * concatenate the results. + */ export function flatMap<T, U>(xs: T[], f: (x: T) => U[]): U[] { return xs.reduce((acc: U[], next: T) => [...f(next), ...acc], []); } |