mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
@type/ramda: Add type definition for startsWith (#20594)
* added type definition for startsWith in Ramda * linting
This commit is contained in:
parent
76c122d1a4
commit
2091df4cbf
7
types/ramda/index.d.ts
vendored
7
types/ramda/index.d.ts
vendored
@ -10,6 +10,7 @@
|
||||
// Jordan Quagliatini <https://github.com/1M0reBug>
|
||||
// Simon Højberg <https://github.com/hojberg>
|
||||
// Charles-Philippe Clermont <https://github.com/charlespwd>
|
||||
// Samson Keung <https://github.com/samsonkeung>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@ -1638,8 +1639,10 @@ declare namespace R {
|
||||
/**
|
||||
* Checks if a list starts with the provided values
|
||||
*/
|
||||
startsWith(a: any, list: any): boolean;
|
||||
startsWith(a: any): (list: any) => boolean;
|
||||
startsWith(a: string, list: string): boolean;
|
||||
startsWith(a: string): (list: string) => boolean;
|
||||
startsWith<T>(a: T | T[], list: T[]): boolean;
|
||||
startsWith<T>(a: T | T[]): (list: T[]) => boolean;
|
||||
|
||||
/**
|
||||
* Subtracts two numbers. Equivalent to `a - b` but curried.
|
||||
|
||||
@ -1883,6 +1883,15 @@ class Rectangle {
|
||||
const b: number[][] = R.splitWhen(R.equals(2))([1, 2, 3, 1, 2, 3]); // => [[1], [2, 3, 1, 2, 3]]
|
||||
};
|
||||
|
||||
() => {
|
||||
R.startsWith("a", "abc"); // => true
|
||||
R.startsWith("a")("abc"); // => true
|
||||
R.startsWith(1, [1, 2, 3]); // => true
|
||||
R.startsWith(1)([1, 2, 3]); // => true
|
||||
R.startsWith([1], [1, 2, 3]); // => true
|
||||
R.startsWith([1])([1, 2, 3]); // => true
|
||||
};
|
||||
|
||||
() => {
|
||||
R.add(2, 3); // => 5
|
||||
R.add(7)(10); // => 17
|
||||
|
||||
Loading…
Reference in New Issue
Block a user