From e7fa87bcc0052e1e99c6894e7e27a122374956b3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 28 May 2017 16:27:34 +0200 Subject: documentation and tslint settings to check for docs --- src/helpers.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/helpers.ts') 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(xs: T[], f: (x: T) => U[]): U[] { return xs.reduce((acc: U[], next: T) => [...f(next), ...acc], []); } -- cgit v1.2.3