Last 12 weeks · 0 commits
4 of 6 standards met
Adds TypeScript type definitions for the package. Existing types on DefinitelyTyped (for v3) return generic Vinyl instances. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8feddddbbb2915816ac5787f50b65d267e9e40cf/types/vinyl-file/index.d.ts#L78-L79 This is inconsistent with upstream types, which narrow based on provided options. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/vinyl/index.d.ts#L55-L60 Since narrowing is more correct (and can eliminate redundant checks) I've applied it here. There is however a problem with the current implementation, it relies on . The following cases fail without the flag enabled. doesn't report this as a problem, presumably due to it operating under strict mode. TODO [x] ~Fix incorrect return type when ~ This is also a problem DefinitelyTyped has to deal with and is enabled by default over there (see https://github.com/DefinitelyTyped/DefinitelyTyped#tsconfigjson). I'm happy to consider this not working without as an unsupported scenario, if this is a dealbreaker happy to change back to a merge generic return type. Resolves #9
Currently types for this package can be sourced from DefinitelyTyped, however they are out of date. I'm happy to get them updated (matching semantics of other sindresorhus ESM packages which include types, e.g. https://github.com/sindresorhus/debounce-fn). If however maintainers are open to including types in the package, I'm happy to put a PR together. Module declaration types for v4
Repository: sindresorhus/vinyl-file. Description: Create a Vinyl file from an actual file Stars: 43, Forks: 4. Primary language: JavaScript. Languages: JavaScript (62.6%), TypeScript (37.4%). License: MIT. Latest release: v5.0.0 (3y ago). Open PRs: 0, open issues: 0. Last activity: 3y ago. Community health: 85%. Top contributors: sindresorhus, SamVerschueren, floatdrop, pioug, Silic0nS0ldier, Richienb.