Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give API access to FileTypeParser#detectors #704

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

Borewit
Copy link
Collaborator

@Borewit Borewit commented Dec 15, 2024

This gives the user more control to determine the sequence of detectors.

API change:

  • FileTypeParser.detectors changed from Iterable<Detector> to Detector[].

Resolves: #628

@Borewit Borewit added the improvement Improvement of existing functionality label Dec 15, 2024
@Borewit Borewit self-assigned this Dec 15, 2024
@Borewit Borewit added enhancement Add new functionality and removed improvement Improvement of existing functionality labels Dec 15, 2024
@Borewit Borewit force-pushed the grant-access-detector-array branch from bd85412 to f08c857 Compare December 15, 2024 21:21
core.d.ts Outdated Show resolved Hide resolved
core.d.ts Outdated Show resolved Hide resolved
core.d.ts Outdated Show resolved Hide resolved
core.d.ts Outdated Show resolved Hide resolved
core.js Outdated Show resolved Hide resolved
@Borewit Borewit force-pushed the grant-access-detector-array branch 3 times, most recently from 4b27ec9 to 3fdd033 Compare December 17, 2024 13:12
@Borewit Borewit requested a review from sindresorhus December 17, 2024 13:13
@Borewit Borewit added the API change Major change, dependents may need to update their code label Dec 18, 2024
core.d.ts Outdated Show resolved Hide resolved
core.d.ts Outdated Show resolved Hide resolved
core.d.ts Outdated Show resolved Hide resolved
@Borewit Borewit force-pushed the grant-access-detector-array branch 2 times, most recently from e59f6a0 to cd992e9 Compare December 18, 2024 15:21
@Borewit Borewit requested a review from sindresorhus December 18, 2024 15:24
Use hash for class method member reference.
Simplify code comments.

Co-authored-by: Sindre Sorhus <[email protected]>
@Borewit Borewit force-pushed the grant-access-detector-array branch from cd992e9 to 4b3d9fb Compare December 18, 2024 16:48
@Borewit Borewit requested a review from sindresorhus December 18, 2024 16:48
@sindresorhus
Copy link
Owner

sindresorhus commented Dec 18, 2024

Still out of sync: https://github.com/sindresorhus/file-type/pull/704/files#diff-5a831ea67cf5cf8703b0de46901ab25bd191f56b320053be9332d9a3b0d01d15R343

The A custom detector is a function that allows specifying custom detection mechanisms. part.

@sindresorhus sindresorhus changed the title Give API access to FileTypeParser.detectors Give API access to FileTypeParser#detectors Dec 19, 2024
@sindresorhus sindresorhus merged commit 7e72bbc into main Dec 19, 2024
6 checks passed
@sindresorhus sindresorhus deleted the grant-access-detector-array branch December 19, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Major change, dependents may need to update their code enhancement Add new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom detectors running after default detectors
2 participants