Commit b7f4cac
Fix TypeScript type errors in source files (#20)
TypeScript strict type checking was enabled but the codebase had 7 type
errors preventing successful compilation.
**Fixed type errors:**
- **decompress.js**: Added explicit `Buffer[]` type annotation for
chunks array to resolve implicit `any[]` inference
- **ffmpeg.js, node.js**: Added missing return statements to match JSDoc
`Promise<string>` declarations
- **main.js**: Added null check for `semver.coerce()` result and
eliminated redundant coerce call
- **request.js**: Added undefined check for `res.statusCode` before
comparison
**Example fix (main.js):**
```javascript
// Before: called coerce twice, missing null check
} else if (semver.valid(semver.coerce(options.version))) {
options.version = semver.coerce(options.version).version;
// After: single call with proper null handling
} else {
const coerced = semver.coerce(options.version);
if (coerced && semver.valid(coerced)) {
options.version = coerced.version;
```
All changes maintain existing runtime behavior while satisfying
TypeScript's strict type checking requirements.
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ayushmanchhabra <14110965+ayushmanchhabra@users.noreply.github.com>1 parent ab6b164 commit b7f4cac
5 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | 57 | | |
60 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments