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

Change .getMime to .detect #38

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

moshen
Copy link
Owner

@moshen moshen commented Feb 19, 2024

This was done for a couple of reasons. As features have been added to WASMagic, the method name .getMime is no longer accurate. The user can get any number of available features from the passed Buffer. Second, consistency. Several other libmagic based libraries used the .detect method (though the signatures differ).

While on the surface this looks like a BREAKING CHANGE, it is not. The original .getMime method passes through to .detect. Though, it has been marked as deprecated.

This was done for a couple of reasons. As features have been added to
WASMagic, the method name `.getMime` is no longer accurate. The user
can get any number of available features from the passed `Buffer`.
Second, consistency. Several other `libmagic` based libraries used the
`.detect` method (though the signatures differ).

While on the surface this looks like a BREAKING CHANGE, it is not. The
original `.getMime` method passes through to `.detect`. Though, it has
been marked as deprecated.
@moshen moshen merged commit b8f3570 into 2024-02-19-release Feb 19, 2024
2 checks passed
@moshen moshen deleted the change-getmime-to-detect branch February 19, 2024 21:55
moshen added a commit that referenced this pull request Feb 25, 2024
This was done for a couple of reasons. As features have been added to
WASMagic, the method name `.getMime` is no longer accurate. The user
can get any number of available features from the passed `Buffer`.
Second, consistency. Several other `libmagic` based libraries used the
`.detect` method (though the signatures differ).

While on the surface this looks like a BREAKING CHANGE, it is not. The
original `.getMime` method passes through to `.detect`. Though, it has
been marked as deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant