Typescript error when `postData` is missing
- Linguagem predominante
- TypeScript
- Estrelas
- 1.2k
- Forks
- 242
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
From the example:
```
const snippet = new HTTPSnippet({
method: 'GET',
url: 'http://mockbin.com/request',
});
const options = { indent: '\t' };
const output = snippet.convert('shell', 'curl', options);
console.log(output);
```
I get a typescript error
```
Argument of type '{ method: string; url: string; }' is not assignable to parameter of type 'HarRequest | HarEntry'.
Type '{ method: string; url: string; }' is not assignable to type 'HarRequest'.
Property 'postData' is missing in type '{ method: string; url: string; }' but required in type '{ postData: any; }'.ts(2345)
httpsnippet.d.ts(19, 5): 'postData' is declared here.
```
Guia de contribuição
Direção de pesquisa
Start with the TypeScript declaration referenced in the error, httpsnippet.d.ts, and compare its HarRequest definition with the example that constructs HTTPSnippet without postData. Verify the corrected typing by compiling the shown example and confirming that the missing-postData error is gone.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- typescript
- Domínio
- developer-experience
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 48/100