fix esbuild and typing issues

This commit is contained in:
A 2025-09-02 13:29:52 +08:00 committed by Bruno Miiller
parent f92bcd630d
commit c96de5ccbc
6 changed files with 7 additions and 7 deletions

View File

@ -57,7 +57,7 @@ esbuild
inject: ["./esbuild.injecthelper.mjs"],
format: "cjs",
// watch: !prod, // no longer valid in esbuild 0.17
target: "es2016",
target: "es2020",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,

View File

@ -78,7 +78,7 @@ const fromBlobPropsToEntity = (
let hash: undefined | string = undefined;
if (props.contentMD5 !== undefined) {
hash = arrayBufferToHex(props.contentMD5.buffer);
hash = arrayBufferToHex(props.contentMD5.buffer as ArrayBuffer);
}
const entity: Entity = {

View File

@ -575,7 +575,7 @@ export class FakeFsOnedriveFull extends FakeFs {
*/
async _putUint8ArrayByRange(
pathFragOrig: string,
payload: Uint8Array,
payload: Uint8Array<ArrayBuffer>,
rangeStart: number,
rangeEnd: number,
size: number

View File

@ -24,7 +24,7 @@ const getKeyIVFromPassword = async (
const k2 = await window.crypto.subtle.deriveBits(
{
name: "PBKDF2",
salt: salt,
salt: salt as Uint8Array<ArrayBuffer>,
iterations: rounds,
hash: "SHA-256",
},

View File

@ -729,7 +729,7 @@ export class FakeFsOnedrive extends FakeFs {
*/
async _putUint8ArrayByRange(
pathFragOrig: string,
payload: Uint8Array,
payload: Uint8Array<ArrayBuffer>,
rangeStart: number,
rangeEnd: number,
size: number

View File

@ -88,9 +88,9 @@ export const mkdirpInVault = async (thePath: string, vault: Vault) => {
* @returns ArrayBuffer
*/
export const bufferToArrayBuffer = (
b: Buffer | Uint8Array | ArrayBufferView
b: Buffer | Uint8Array<ArrayBuffer> | ArrayBufferView
) => {
return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength) as ArrayBuffer;
};
/**