fix: switch to file-type v19.1.0 (#7459)

The official `file-type` package has replaced the usage of node:buffer with Uint8Array. This change allows it to run safely in the browser now.

Related to https://github.com/sindresorhus/file-type/issues/578
This commit is contained in:
lawvs
2024-07-12 10:27:48 +00:00
parent 5ede985a3a
commit 2f784ae539
3 changed files with 45 additions and 5 deletions

View File

@@ -57,6 +57,7 @@
"cmdk": "^1.0.0",
"css-spring": "^4.1.0",
"dayjs": "^1.11.10",
"file-type": "^19.1.0",
"foxact": "^0.2.33",
"fractional-indexing": "^3.2.0",
"fuse.js": "^7.0.0",

View File

@@ -16,9 +16,9 @@ import {
ViewBarIcon,
} from '@blocksuite/icons/rc';
import type { BlockModel } from '@blocksuite/store';
import { fileTypeFromBuffer } from '@sgtpooki/file-type';
import { useService } from '@toeverything/infra';
import clsx from 'clsx';
import { fileTypeFromBuffer } from 'file-type';
import { useErrorBoundary } from 'foxact/use-error-boundary';
import type { PropsWithChildren, ReactElement } from 'react';
import {