feat: build assets

This commit is contained in:
TrèsAbhi committed 2023-12-05 19:14:53 -06:00
1 parent aa78bc4045
commit 9df47777d0
12 files changed
+328 -214

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
import { readDVPL } from './readDVPL';
export async function readStringDVPL(file: string) {
const buffer = await readDVPL(file);
return buffer.toString();
}
+9
View File
@@ -0,0 +1,9 @@
import { XMLParser } from 'fast-xml-parser';
import { readStringDVPL } from './readStringDVPL';
export async function readXMLDVPL<Type>(file: string) {
const parser = new XMLParser();
const xml = await readStringDVPL(file);
return parser.parse(xml).root as Type;
}
+8
View File
@@ -0,0 +1,8 @@
import { parse } from 'yaml';
import { readStringDVPL } from './readStringDVPL';
export async function readYAMLDVPL<Type>(file: string) {
const yaml = await readStringDVPL(file);
return parse(yaml) as Type;
}