Skip to content

Allowed return type for custom detectors are to narrow #692

@joeried

Description

@joeried

Description

I have implemented a custom detector that also works without any problems.

However, the typescript types seem to be a bit too restrictive for the return value. Custom detectors must return a FileTypeResult (which limits them to already existing extensions/mine-types).

Am I mistaken, or shouldn't the FileTypeResult type actually be extendable somehow?

Existing Issue Check

  • I have searched the existing issues and could not find any related to my problem.

File-Type Scope Acknowledgment

  • I understand that file-type detects binary file types and not text or other formats.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions