josdejong/mathjs

Insufficient typing for `add`, `subtract`, `dotMultiply` etc

開放

#2,349 建立於 2021年11月9日

 (0 則留言) (3 個反應) (0 位負責人)JavaScript (1,314 個分叉)batch import
help wantedtypescript

倉庫指標

星標
 (15,065 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The functions

lack sufficiently fine-grained type definitions. In particular, this produces an error:

math.add([1, 2], [3, 4])[0];
// Element implicitly has an 'any' type because expression
// of type '0' can't be used to index type 'MathType'.
// Property '0' does not exist on type 'MathType'

while it should be clear that the result is a one-dimensional array.

Adding some overloads would make the TypeScript experience with Mathjs much smoother.

貢獻者指南