-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
气不过,想了想还是提一嘴吧。
(!) Cannot call a namespace ('JSONBigInt')
src/common/sign.ts (6:22)
4: import * as JSONBigInt from "json-bigint"
5:
6: const JSONbigNative = JSONBigInt({ useNativeBigInt: true })
^
7:
8: /**
(!) Cannot call a namespace ('JSONBigInt')
src/common/http/http_connection.ts (12:22)
10: import * as JSONBigInt from "json-bigint"
11:
12: const JSONbigNative = JSONBigInt({ useNativeBigInt: true })
^
13: /**
14: * @inner
(!) Cannot call a namespace ('isStream')
src/common/http/http_connection.ts (180:8)
178: async function convertReadStreamToBuffer(data: any): Promise<void> {
179: for (const key in data) {
180: if (isStream(data[key])) {
^
181: data[key] = await getStream.buffer(data[key])
182: }
(!) Cannot call a namespace ('isStream')
src/common/http/http_connection.ts (227:50)
225:
226: function isObject(x: any): boolean {
227: return typeof x === "object" && !isArray(x) && !isStream(x) && !isBuffer(x) && x !== null
^
228: }
见过 CJS require 见过 default import,还没见过全导入进来当函数调用的。请根据库自己的 example 和 export 来修改代码。
另外我注意到 http_connection.ts 的 isObject 属最差实践,应该使用 Typescript is 语法来对 x 进行约束。并将 x 的参数类型改为 unknown。库本身可能存在很多处这样的问题,恕我不能一一指出(贵司未配置 eslint),还请慢慢修复。
rehiy, nick-jy-huang, lazylwz, nick-vsx, gytxtx and 13 more
Metadata
Metadata
Assignees
Labels
No labels