mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-18 23:10:51 +01:00
removed haex-pass components
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import type { LocationQueryValue, RouteLocationRawI18n } from 'vue-router'
|
||||
import type { RouteLocationRawI18n } from 'vue-router'
|
||||
|
||||
/* export const bytesToBase64DataUrlAsync = async (
|
||||
bytes: Uint8Array,
|
||||
@ -27,26 +27,6 @@ export const blobToImageAsync = (blob: Blob): Promise<HTMLImageElement> => {
|
||||
})
|
||||
}
|
||||
|
||||
export const deepToRaw = <T extends Record<string, any>>(sourceObj: T): T => {
|
||||
const objectIterator = (input: any): any => {
|
||||
if (Array.isArray(input)) {
|
||||
return input.map((item) => objectIterator(item))
|
||||
}
|
||||
if (isRef(input) || isReactive(input) || isProxy(input)) {
|
||||
return objectIterator(toRaw(input))
|
||||
}
|
||||
if (input && typeof input === 'object') {
|
||||
return Object.keys(input).reduce((acc, key) => {
|
||||
acc[key as keyof typeof acc] = objectIterator(input[key])
|
||||
return acc
|
||||
}, {} as T)
|
||||
}
|
||||
return input
|
||||
}
|
||||
|
||||
return objectIterator(sourceObj)
|
||||
}
|
||||
|
||||
export const readableFileSize = (sizeInByte: number | string = 0) => {
|
||||
if (!sizeInByte) {
|
||||
return '0 KB'
|
||||
|
||||
Reference in New Issue
Block a user