mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
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.