filestack-js 3.30.2 → 3.32.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.
@@ -104,6 +104,7 @@ export const ExtensionsMap = {
104
104
  'mxd',
105
105
  'indd',
106
106
  'vsm',
107
+ 'hpt',
107
108
  ],
108
109
  'application/oda': ['oda'],
109
110
  'application/oebps-package+xml': ['opf'],
@@ -103,11 +103,13 @@ export const uniqueId = (len: number = 10): string => {
103
103
  */
104
104
  export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Promise<string> => {
105
105
  let type;
106
+
106
107
  try {
107
108
  type = await fromBuffer(file);
108
109
  } catch(e) {
109
110
  console.warn("An exception occurred while processing the buffer:", e.message);
110
111
  }
112
+
111
113
  if (name && name.indexOf('.') > -1) {
112
114
  const mime = extensionToMime(name);
113
115
 
@@ -115,6 +117,7 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
115
117
  return mime;
116
118
  }
117
119
  }
120
+
118
121
  const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
119
122
 
120
123
  if (type && excludedMimetypes.indexOf(type.mime) === -1) {
@@ -137,6 +140,7 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
137
140
  return type.mime;
138
141
  }
139
142
 
143
+ return 'application/octet-stream';
140
144
  };
141
145
 
142
146
  /**