mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: build assets
This commit is contained in:
1 parent
aa78bc4045
commit
9df47777d0
12 files changed
+328
-214
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import { readDVPL } from './readDVPL';
|
||||
|
||||
export async function readStringDVPL(file: string) {
|
||||
const buffer = await readDVPL(file);
|
||||
return buffer.toString();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user