mime-bytes 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  // Main file type detector class with stream-focused API
2
+ import { detectCharset, FILE_TYPES, getContentTypeByExtension, getContentTypeForExtension, getFileTypeByExtension, getFileTypesByCategory } from './file-types-registry';
2
3
  import { peek } from './peak';
3
- import { FILE_TYPES, getFileTypeByExtension, getFileTypesByCategory, getContentTypeByExtension, detectCharset, getContentTypeForExtension } from './file-types-registry';
4
- import { compareBytes } from './utils/magic-bytes';
5
4
  import { normalizeExtension } from './utils/extensions';
5
+ import { compareBytes } from './utils/magic-bytes';
6
6
  import { resolveMimeAlias } from './utils/mime-types';
7
7
  export class FileTypeDetector {
8
8
  fileTypes;
@@ -248,7 +248,7 @@ export class FileTypeDetector {
248
248
  if (lastDot !== -1) {
249
249
  const extension = filename.substring(lastDot + 1);
250
250
  // Check for generic text files that might have specific content types
251
- if (magicResult.name === 'text' && magicResult.charset) {
251
+ if (magicResult.mimeType === 'text/plain' && magicResult.charset) {
252
252
  const contentType = getContentTypeForExtension(extension, magicResult.charset);
253
253
  if (contentType) {
254
254
  // Enhance the result with charset-aware content type