Type declaration files missing for csv-stringify/lib/browser/sync
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 4.3k
- Forks
- 299
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 1
Description
Describe the bug
csv-stringfy 5.6.2
import csvStringify from 'csv-stringify/lib/browser/sync';
doesn't work in TypeScript since the type declarations are missing.
I had to add my own csv-stringify.d.ts:
declare module 'csv-stringify/lib/browser/sync' {
import { Input, Options } from 'csv-stringify';
function stringify(input: Input, options?: Options): string;
export = stringify;
}
To Reproduce
Just try to import 'csv-stringify/lib/browser/sync' in any TypeScript project.
Additional context
Looking at the directory structure of the npm package, it's clear that lib/browser/*.js don't have corresponding .d.ts declaration files.
$ tree node_modules/csv-stringify/
node_modules/csv-stringify/
├── CHANGELOG.md
├── LICENSE
├── README.md
├── lib
│ ├── browser
│ │ ├── index.js
│ │ └── sync.js
│ ├── es5
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── sync.d.ts
│ │ └── sync.js
│ ├── index.d.ts
│ ├── index.js
│ ├── sync.d.ts
│ └── sync.js
└── package.json
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing lib/browser/sync.js and lib/browser/index.js with the existing lib/sync.d.ts and lib/es5/sync.d.ts files. Reproduce the TypeScript import from the issue, then add the missing browser declarations and verify that both browser entry points can be imported without a declaration error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100