mime-bytes 0.1.1 → 0.2.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.
@@ -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
@@ -1090,7 +1090,7 @@ export const CONTENT_TYPE_MAPPINGS = [
1090
1090
  [['md'], 'text/markdown', 'utf-8'],
1091
1091
  [['scss'], 'text/x-scss', 'utf-8'],
1092
1092
  [['sh'], 'application/x-sh', 'utf-8'],
1093
- [['sql'], 'application/sql', 'utf-8'],
1093
+ [['sql'], 'application/x-sql', 'utf-8'],
1094
1094
  [['yaml'], 'application/x-yaml', 'utf-8'],
1095
1095
  [['yml'], 'application/x-yaml', 'utf-8'],
1096
1096
  [['jsx'], 'text/jsx', 'utf-8'],
@@ -254,7 +254,7 @@ class FileTypeDetector {
254
254
  if (lastDot !== -1) {
255
255
  const extension = filename.substring(lastDot + 1);
256
256
  // Check for generic text files that might have specific content types
257
- if (magicResult.name === 'text' && magicResult.charset) {
257
+ if (magicResult.mimeType === 'text/plain' && magicResult.charset) {
258
258
  const contentType = (0, file_types_registry_1.getContentTypeForExtension)(extension, magicResult.charset);
259
259
  if (contentType) {
260
260
  // Enhance the result with charset-aware content type
@@ -1099,7 +1099,7 @@ exports.CONTENT_TYPE_MAPPINGS = [
1099
1099
  [['md'], 'text/markdown', 'utf-8'],
1100
1100
  [['scss'], 'text/x-scss', 'utf-8'],
1101
1101
  [['sh'], 'application/x-sh', 'utf-8'],
1102
- [['sql'], 'application/sql', 'utf-8'],
1102
+ [['sql'], 'application/x-sql', 'utf-8'],
1103
1103
  [['yaml'], 'application/x-yaml', 'utf-8'],
1104
1104
  [['yml'], 'application/x-yaml', 'utf-8'],
1105
1105
  [['jsx'], 'text/jsx', 'utf-8'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mime-bytes",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "Lightning-fast file type detection using magic bytes (file signatures) with a focus on stream processing and minimal memory usage",
6
6
  "main": "index.js",
@@ -34,5 +34,5 @@
34
34
  "@types/glob": "^8.1.0",
35
35
  "glob": "^11.0.2"
36
36
  },
37
- "gitHead": "52ec8086bb7da9908e858d8b89e9766a61d4365f"
37
+ "gitHead": "d3f4befdbf70969bef95d742dbdbe131a064919c"
38
38
  }