add topping selection, defaultID WIP
This commit is contained in:
parent
2d753502f6
commit
3b4dec5e61
10 changed files with 331 additions and 56 deletions
29
client/src/app/shared/helpers/copy.ts
Normal file
29
client/src/app/shared/helpers/copy.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
export async function copy(source: any) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(source);
|
||||
// alert("copied");
|
||||
} catch (error) {
|
||||
console.error("Async: Could not copy text: ", error);
|
||||
}
|
||||
}
|
||||
|
||||
export function transformToTSV(data: any){
|
||||
let csv = "";
|
||||
if(Array.isArray(data)){
|
||||
for(let i = 0; i < data.length; i++){
|
||||
for(const key in data[i]){
|
||||
csv += data[i][key] + "\t";
|
||||
}
|
||||
csv += "\n";
|
||||
}
|
||||
} else {
|
||||
for(const key in data){
|
||||
csv += data[key] + "\t";
|
||||
}
|
||||
}
|
||||
|
||||
// for(const key in data){
|
||||
// csv += key + "\t" + data[key] + "\t";
|
||||
// }
|
||||
return csv;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue