mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: ts and composition api for single instance components
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
const arrayToFile = args => {
|
||||
export const arrayToFile = (args: {
|
||||
type: 'csv' | 'json';
|
||||
content: object[];
|
||||
filename: string;
|
||||
}) => {
|
||||
let mime;
|
||||
let content;
|
||||
|
||||
@ -33,5 +37,3 @@ const arrayToFile = args => {
|
||||
downloadLink.click();
|
||||
downloadLink.remove();
|
||||
};
|
||||
|
||||
export default arrayToFile;
|
@ -1,16 +1,17 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { toRaw } from 'vue';
|
||||
|
||||
/**
|
||||
* @param {*} val
|
||||
* @param {Boolean} json converts the value in JSON object (default true)
|
||||
*/
|
||||
export function unproxify (val, json = true) {
|
||||
export function unproxify (val: any, json = true): any {
|
||||
if (json)// JSON conversion
|
||||
return JSON.parse(JSON.stringify(val));
|
||||
else if (Array.isArray(val))// If array
|
||||
return toRaw(val);
|
||||
else if (typeof val === 'object') { // If object
|
||||
const result = {};
|
||||
const result: any = {};
|
||||
for (const key in val)
|
||||
result[key] = toRaw(val[key]);
|
||||
|
Reference in New Issue
Block a user