file-type 3.7.0 → 3.8.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.
- package/index.js +14 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -282,14 +282,26 @@ module.exports = function (buf) {
|
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
if (
|
|
285
|
+
if (
|
|
286
|
+
(buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46) &&
|
|
287
|
+
(
|
|
288
|
+
(buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) ||
|
|
289
|
+
(buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F)
|
|
290
|
+
)
|
|
291
|
+
) {
|
|
286
292
|
return {
|
|
287
293
|
ext: 'woff',
|
|
288
294
|
mime: 'application/font-woff'
|
|
289
295
|
};
|
|
290
296
|
}
|
|
291
297
|
|
|
292
|
-
if (
|
|
298
|
+
if (
|
|
299
|
+
(buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32) &&
|
|
300
|
+
(
|
|
301
|
+
(buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) ||
|
|
302
|
+
(buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F)
|
|
303
|
+
)
|
|
304
|
+
) {
|
|
293
305
|
return {
|
|
294
306
|
ext: 'woff2',
|
|
295
307
|
mime: 'application/font-woff'
|