Commit Graph

103 Commits

Author SHA1 Message Date
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Marcin Biernat
45add58c66 Ramda defaultTo does not return null or undefined 2018-02-13 09:59:07 +01:00
Marcin Biernat
80c8b9cc63 Make ramda typings tests pass strict null checks 2018-02-08 15:34:51 +01:00
Andy
bef4d2b27d
Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Jakub Korzeniowski
a23c27a2dc Corrected the typings for R.partition (#23376) 2018-02-02 13:39:52 -08:00
Charles-Philippe Clermont
2037b3b9ba propEq with one argument returns a curried function (#22923) 2018-01-17 09:51:52 -08:00
Nikita Moshensky
39b90ab686 [ramda] fix path() return type according to documentation (#22963)
* [ramda] fix path() return type

* add tests
2018-01-17 09:37:58 -08:00
Ethan
2e1875bacf Ramda partial/partialRight: add overloads for 2–4 arg functions (#22737)
Gives better typing for some common cases, analogous to the overloads for R.compose.
2018-01-11 09:33:51 -08:00
Jonas Schürmann
6202e2389b Ramda: Tighten return type of reduced (#21771)
The previous return type of reduced caused very weak typing for the
function passed into reduce, basically allowing it to return anything
and not detecting type errors in that place.

This stricter definition of Reduced should fix that.
2018-01-08 10:44:19 -08:00
Oliver Joseph Ash
8e80f13320 Ramda: anyPass: use generic instead of any (#21870)
* Ramda: `anyPass`: use generic instead of any

* Lint
2018-01-02 16:28:22 -08:00
Paul van Brenk
696158d8eb
Merge pull request #22220 from googol/ramda/signature-fixes
Ramda: Fix signatures for nth, splitAt and splitEvery
2017-12-29 10:55:38 -08:00
Paul van Brenk
542acf24c3
Merge pull request #22332 from raynerd/fix-ramda-invoker-function
fix ramdajs invoker function signature
2017-12-28 11:54:45 -08:00
Miika Hänninen
134f9290a2
Ramda: add string overload for splitEvery
`splitEvery` works for either an array of any type or a string.

http://ramdajs.com/docs/#splitEvery
2017-12-28 10:53:31 +02:00
Miika Hänninen
4ab4a67990
Ramda: Fix splitAt signature
- `splitAt` accepts either arrays or strings, not any arbitrary T.
- the output will always be an array of two elements, so switched to
  using the tuple syntax there.
- ensures that the overloading after first partial application works

http://ramdajs.com/docs/#splitAt

fixup splitat
2017-12-28 10:52:30 +02:00
Miika Hänninen
558e10c909
Ramda: nth might return undefined
If the index points outside the range of the input array, the return
value will be undefined.

http://ramdajs.com/docs/#nth
2017-12-28 10:51:04 +02:00
Nikita Moshensky
01899e7f31 [ramda] type one of eqProps definitions the same as prop and add groupWith definition 2017-12-23 10:13:25 +02:00
Rayner Pupo
bb4b5a933c
Merge branch 'master' into fix-ramda-invoker-function 2017-12-22 22:38:37 -05:00
Rayner Pupo
18ebf4d5f8
update invoker function signature 2017-12-19 22:31:24 -05:00
Miika Hänninen
3de6da989a
Ramda: Replace Array<T> with ReadonlyArray<T> in input positions
Ramda never modifies its input arrays, so this allows the use of the
stricter ReadonlyArray<T>. All Array<T>s are compatible with
ReadonlyArray<T>, so this won't break them.

Return types are left as Array<T>, since the user should be free to do
what they want with the results.
2017-12-15 15:14:33 +02:00
Bowden Kelly
4b03b0bd04
Merge pull request #21949 from charlespwd/fix/index-by
Improve Ramda's indexBy type inference
2017-12-08 09:14:20 -08:00
Bowden Kelly
1690d47549
Merge pull request #21486 from nenadalm/ramda
[ramda]: Fix `prop` type
2017-12-06 10:52:35 -08:00
Charles-P. Clermont
06313d255b Improve indexBy type inference 2017-12-04 12:13:45 -05:00
Nathan Shively-Sanders
1b0f0b363a
Merge pull request #20658 from jvanbruegge/patch-1
ramda: Add applyTo (WIP)
2017-11-14 11:18:54 -08:00
Miloslav Nenadal
3903644020 [ramda]: Fix prop type 2017-11-13 17:38:52 +01:00
Daniel Rosenwasser
ced7ded999
Merge pull request #21260 from pelotom/ramda-mapped-types
[ramda] Use mapped types for pluck, prop and props
2017-11-11 15:47:35 -08:00
Daniel Rosenwasser
87d7955d6f
Merge pull request #21138 from MazeChaZer/ramda-min-max-return-type-polymorphism
Ramda: Enable return type polymorphism for min/max
2017-11-10 20:46:07 -08:00
Jan van Brügge
81f249f1d3
Fix trailing whitespace 2017-11-09 13:12:32 +01:00
Angelo Ocana
dd669cd78b Ramda: Remove return Any for partial/partialRight
Remove return **Any** signature for **partial** and **partialRight** as
asked by @samsonkeung

483c1ab97d (r148995006)

483c1ab97d (r148995018)
2017-11-06 10:29:25 -05:00
Angelo Ocana
483c1ab97d Ramda: Make partial and partialRight binary fns
Change Added to Ramda 0.18.0

Pull Request: https://github.com/ramda/ramda/pull/1433
Upgrade guide: https://github.com/ramda/ramda/issues/1436
2017-11-05 21:35:52 -05:00
Tom Crockett
cb51b88dec [ramda] Use mapped types for pluck, prop and props (resolves #21238) 2017-11-05 15:47:06 -08:00
Ron Buckton
740f7f95a9
Merge pull request #19825 from MazeChaZer/patch-2
Ramda: Tighten type signature for `append`
2017-11-03 22:38:26 -07:00
Ron Buckton
3f46cf99db
Merge pull request #20819 from cmaddalozzo/master
Add generics to memoize, partial, and once
2017-11-03 22:35:36 -07:00
Curtis Maddalozzo
6ba640f40f Use default value for generic to remove redundant type signature 2017-11-01 09:57:23 +00:00
Jonas Schürmann
e26351b49f Ramda: Enable return type polymorphism for min/max 2017-10-31 13:19:46 +01:00
Ron Buckton
337b048a5b
Merge pull request #21096 from LiamGoodacre/update/ramda-contributors
Remove myself from ramda contributors
2017-10-30 17:02:30 -07:00
Liam Goodacre
ba33e49fa7 Remove myself from ramda contributors 2017-10-28 22:31:24 +01:00
Samson Keung
b0d60e347d up version 2017-10-28 14:22:59 -07:00
Samson Keung
da80f707e2 add typing for endsWith 2017-10-28 14:17:43 -07:00
c4605
74be8a1d63 ramda: R.nAry support curry (#20707) 2017-10-23 14:52:59 -07:00
samsonkeung
2091df4cbf @type/ramda: Add type definition for startsWith (#20594)
* added type definition for startsWith in Ramda

* linting
2017-10-23 12:56:46 -07:00
Jonas Schürmann
7669a80182 Ramda: Tighten type signature for append
The Ramda documentation clearly states that the element to append an the elements in the list should have the same type.
The previous type definition unnecessarily weakened type safety. For example this error could not be detected by TypeScript:

interface A {
    id: number
}
const list: A[] = []
R.append({idd: 2}, list)

Which seems ridiculous. If one wanted an intersection type, one could explicity define it to be used for the list/element type. Additionally, the function `prepend` already is as strict as this proposal, that should probably be consistent.

I also deleted a redundant line.
2017-10-23 11:47:57 +02:00
Curtis Maddalozzo
0937f4ba44 Add generics to memoize, partial, and once 2017-10-22 15:58:22 +01:00
Jan van Brügge
27fd582d60 Add applyTo 2017-10-17 22:30:11 +02:00
Jakub Korzeniowski
15dda2c9c9 [ramda] Improved definitions of type, head and last functions (#20332)
* Improved definitions of type, head and last functions

* Version bump

* Oops

* Linting

* no-unnecessary-type-assertion

* Removed version bump
2017-10-12 13:52:50 -07:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Andy
102bcc67fa ramda: Fix lint (#20367) 2017-10-06 10:22:09 -07:00
Nathan Shively-Sanders
b8ea87c68e Strict function variance fixes round 1 2017-10-02 15:50:34 -07:00
Honza Břečka
49f1f3aeeb ramda: fix prop function definition (#20099) 2017-10-02 10:39:01 -07:00
Cort Spellman
1066f6fb82 [ramda]: Correct order of reducing-fn params in reduceRight (#18798)
The reducing function in Ramda's reduceRight has signature
(elem: T, acc: TResult) => TResult,
as per https://github.com/ramda/ramda/blob/v0.24.0/src/reduceRight.js.

The order of the parameters was switched at
68d1dc19fb
2017-09-24 15:39:09 +09:00
guillaumep
da9afa6cdb More verbose definition for pathOr 2017-09-19 14:53:38 -04:00