Functions
binMd5
- binMd5(data: any): string
Parameters
Returns string
copyText
- copyText(text?: string): void
Parameters
Returns void
dataURLtoBlob
- dataURLtoBlob(dataURL: string): Blob
Parameters
Returns Blob
downloadContent
- downloadContent(filename: string, content: Blob): void
- downloadContent(filename: string, content: string | ArrayBuffer | Buffer, type: string): void
Parameters
filename: string
content: Blob
Returns void
Parameters
filename: string
content: string | ArrayBuffer | Buffer
type: string
Returns void
downloadDataURL
- downloadDataURL(filename: string, dataURL: string): void
Parameters
filename: string
dataURL: string
Returns void
encodeMarkdownLink
- encodeMarkdownLink(path: string): string
Parameters
Returns string
escapeMd
- escapeMd(str: string): string
Parameters
Returns string
fileToBase64URL
- fileToBase64URL(file: Blob | File): Promise<string>
Parameters
Returns Promise<string>
getLogger
- getLogger(subject: string): { debug: (...args: any) => void; error: (...args: any) => void; info: (...args: any) => void; log: (...args: any) => void; warn: (...args: any) => void }
Parameters
Returns { debug: (...args: any) => void; error: (...args: any) => void; info: (...args: any) => void; log: (...args: any) => void; warn: (...args: any) => void }
debug: (...args: any) => void
error: (...args: any) => void
info: (...args: any) => void
log: (...args: any) => void
warn: (...args: any) => void
md5
- md5(content: any): string
Parameters
Returns string
objectInsertAfterKey
- objectInsertAfterKey(obj: {}, key: string, content: {}): {}
Parameters
obj: {}
key: string
content: {}
Returns {}
quote
- quote(str: string, quote?: string): string
Parameters
str: string
quote: string = '`'
Returns string
removeQuery
- removeQuery(url: string): string
Parameters
Returns string
sleep
- sleep(ms: number): Promise<unknown>
Parameters
Returns Promise<unknown>
strToBase64
- strToBase64(str: string): string
Parameters
Returns string
waitCondition
- waitCondition(fn: () => boolean | Promise<boolean>, interval?: number, timeout?: number): Promise<void> | { cancel: any }
Parameters
fn: () => boolean | Promise<boolean>
- (): boolean | Promise<boolean>
Returns boolean | Promise<boolean>
interval: number = 30
timeout: number = 10000
Returns Promise<void> | { cancel: any }
quote string