mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: augment
This commit is contained in:
1 parent
f70864a0db
commit
1cc15f64b0
9 files changed
+63
-75
No files matched your search
@@ -1,6 +0,0 @@
|
||||
import { readDVPLFile } from './readDVPLFile';
|
||||
|
||||
export async function readStringDVPL(file: string) {
|
||||
const buffer = await readDVPLFile(file);
|
||||
return buffer.toString();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
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) as Type;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { readFile } from 'fs/promises';
|
||||
import { parse } from 'yaml';
|
||||
|
||||
export async function readYAML<Type>(file: string) {
|
||||
const yaml = (await readFile(file)).toString();
|
||||
return parse(yaml) as Type;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
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