mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-09-08 19:25:36 -05:00
Use JSON.parse instead of resolveJsonModule.
And fix typo.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import * as path from "path";
|
||||
import { readXML } from './helper';
|
||||
import { music } from "./mdb_ex.json"
|
||||
import { readJSON, readXML } from './helper';
|
||||
|
||||
export async function processData() {
|
||||
const { music } = await readJSON(path.resolve(__dirname, './mdb_ex.json'))
|
||||
return {
|
||||
music,
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as path from "path";
|
||||
import { readXML } from './helper';
|
||||
import { music } from "./mdb_mt.json"
|
||||
import { readJSON, readXML } from './helper';
|
||||
|
||||
export async function processData() {
|
||||
const { music } = await readJSON(path.resolve(__dirname, './mdb_ex.json'))
|
||||
return {
|
||||
music,
|
||||
};
|
||||
|
||||
@@ -2,4 +2,10 @@ export async function readXML(path: string) {
|
||||
const xml = await IO.ReadFile(path, 'utf-8');
|
||||
const json = U.parseXML(xml, false)
|
||||
return json
|
||||
}
|
||||
|
||||
export async function readJSON(path: string) {
|
||||
const str = await IO.ReadFile(path, 'utf-8');
|
||||
const json = JSON.parse(str)
|
||||
return json
|
||||
}
|
||||
Reference in New Issue
Block a user