mirror of
https://github.com/codedread/bitjs
synced 2025-10-06 02:39:55 +02:00
Update file sniffer.js for public class fields
This commit is contained in:
parent
660810b03d
commit
d4d854847f
1 changed files with 9 additions and 4 deletions
|
@ -43,11 +43,16 @@ const fileSignatures = {
|
||||||
* numbers above), then the mimeType field will be set.
|
* numbers above), then the mimeType field will be set.
|
||||||
*/
|
*/
|
||||||
class Node {
|
class Node {
|
||||||
/** @param {number} value */
|
/** @type {string} */
|
||||||
|
mimeType;
|
||||||
|
|
||||||
|
/** @type {Object<number, Node>} */
|
||||||
|
children = {};
|
||||||
|
|
||||||
|
/** @param {number} value The byte that this Node points at. */
|
||||||
constructor(value) {
|
constructor(value) {
|
||||||
|
/** @type {number} */
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.children = {};
|
|
||||||
this.mimeType = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +103,7 @@ export function initialize() {
|
||||||
/**
|
/**
|
||||||
* Finds the likely MIME type represented by the ArrayBuffer.
|
* Finds the likely MIME type represented by the ArrayBuffer.
|
||||||
* @param {ArrayBuffer} ab
|
* @param {ArrayBuffer} ab
|
||||||
* @return {string} The MIME type of the buffer, or undefined.
|
* @returns {string} The MIME type of the buffer, or undefined.
|
||||||
*/
|
*/
|
||||||
export function findMimeType(ab) {
|
export function findMimeType(ab) {
|
||||||
if (!root) {
|
if (!root) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue