mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
[TS] Enable strict mode (#3136)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// @ts-strict-ignore
|
||||
export function getFromFlacBuffer(buffer: ArrayBuffer): Record<string, string> {
|
||||
const dataView = new DataView(buffer)
|
||||
|
||||
@@ -6,6 +5,7 @@ export function getFromFlacBuffer(buffer: ArrayBuffer): Record<string, string> {
|
||||
const signature = String.fromCharCode(...new Uint8Array(buffer, 0, 4))
|
||||
if (signature !== 'fLaC') {
|
||||
console.error('Not a valid FLAC file')
|
||||
// @ts-expect-error fixme ts strict error
|
||||
return
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ export function getFromFlacBuffer(buffer: ArrayBuffer): Record<string, string> {
|
||||
if (isLastBlock) break
|
||||
}
|
||||
|
||||
// @ts-expect-error fixme ts strict error
|
||||
return vorbisComment
|
||||
}
|
||||
|
||||
@@ -36,6 +37,7 @@ export function getFromFlacFile(file: File): Promise<Record<string, string>> {
|
||||
return new Promise((r) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = function (event) {
|
||||
// @ts-expect-error fixme ts strict error
|
||||
const arrayBuffer = event.target.result as ArrayBuffer
|
||||
r(getFromFlacBuffer(arrayBuffer))
|
||||
}
|
||||
@@ -64,6 +66,7 @@ function parseVorbisComment(dataView: DataView): Record<string, string> {
|
||||
const ind = comment.indexOf('=')
|
||||
const key = comment.substring(0, ind)
|
||||
|
||||
// @ts-expect-error fixme ts strict error
|
||||
comments[key] = comment.substring(ind + 1)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @ts-strict-ignore
|
||||
export function getFromPngBuffer(buffer: ArrayBuffer) {
|
||||
// Get the PNG data as a Uint8Array
|
||||
const pngData = new Uint8Array(buffer)
|
||||
@@ -46,6 +45,7 @@ export function getFromPngFile(file: File) {
|
||||
return new Promise<Record<string, string>>((r) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = (event) => {
|
||||
// @ts-expect-error fixme ts strict error
|
||||
r(getFromPngBuffer(event.target.result as ArrayBuffer))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user