Как избавиться от ошибки в WebStorm для Got JS extended - PullRequest
0 голосов
/ 19 апреля 2020

Я расширяю Получил JS, чтобы добавить некоторые параметры по умолчанию:

const api = got.extend({
    prefixUrl: "http://localhost:3000/v1/"
});

, но WebStorm показывает ошибку:

Argument type {headers: prefixUrl: string} is not assignable to parameter type Got 
| ExtendOptions   Assigned type doesn't contain call signatures 

enter image description here

и когда я использую его в своем коде, возникает ошибка

let response = await api("polls", { method: "POST", json: body });

enter image description here

Как можно Я избавляюсь от этих ошибок?

...