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.

贡献者指南