From 9d17546a00d9cc51c8cc46a97186e45e30c31b37 Mon Sep 17 00:00:00 2001 From: Miloslav Nenadal Date: Mon, 3 Jul 2017 13:54:03 +0200 Subject: [PATCH 1/3] [ramda]: More detailed isNil definition --- types/ramda/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index cb0241bea7..e0fbd22d4a 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -813,7 +813,7 @@ declare namespace R { /** * Checks if the input value is null or undefined. */ - isNil(value: any): boolean; + isNil(value: any): value is null | undefined; /** * Returns a string made by inserting the `separator` between each From cab8d0e70e0f06e66f57d1131af4b23716910cc3 Mon Sep 17 00:00:00 2001 From: Miloslav Nenadal Date: Tue, 4 Jul 2017 10:10:09 +0200 Subject: [PATCH 2/3] [ramda]: Add forEachObjIndexed definition --- types/ramda/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index e0fbd22d4a..35b74de5f2 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -628,6 +628,12 @@ declare namespace R { forEach(fn: (x: T) => void, list: T[]): T[]; forEach(fn: (x: T) => void): (list: T[]) => T[]; + /** + * Iterate over an input object, calling a provided function fn for each key and value in the object. + */ + forEachObjIndexed(fn: (value: T[keyof T], key: keyof T, obj: T) => void, obj: T): T; + forEachObjIndexed(fn: (value: T[keyof T], key: keyof T, obj: T) => void): (obj: T) => T; + /** * Creates a new object out of a list key-value pairs. */ From acc192069ecc8ddd7bd8d214f7916bf3a98b1fa0 Mon Sep 17 00:00:00 2001 From: Miloslav Nenadal Date: Tue, 4 Jul 2017 14:06:50 +0200 Subject: [PATCH 3/3] [ramda]: Add startsWith definition --- types/ramda/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 35b74de5f2..e30c95f8be 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1508,6 +1508,12 @@ declare namespace R { splitWhen(pred: (val: T) => boolean, list: U[]): U[][]; splitWhen(pred: (val: T) => boolean): (list: U[]) => U[][]; + /** + * Checks if a list starts with the provided values + */ + startsWith(a: any, list: any): boolean; + startsWith(a: any): (list: any) => boolean; + /** * Subtracts two numbers. Equivalent to `a - b` but curried. */