mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
add songrequest options
This commit is contained in:
12
src/Utils.ts
12
src/Utils.ts
@@ -21,3 +21,15 @@ export function copyToClipboard(text: string) {
|
||||
message.warning('当前环境不支持自动复制, 请手动选择并复制')
|
||||
}
|
||||
}
|
||||
export function objectsToCSV(arr: any[]) {
|
||||
const array = [Object.keys(arr[0])].concat(arr)
|
||||
return array
|
||||
.map((row) => {
|
||||
return Object.values(row)
|
||||
.map((value) => {
|
||||
return typeof value === 'string' ? JSON.stringify(value) : value
|
||||
})
|
||||
.toString()
|
||||
})
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user