mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
Use JSON.parse instead of resolveJsonModule.
And fix typo.
This commit is contained in:
parent
43e0716b85
commit
e98db72efa
|
|
@ -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
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ export function register() {
|
|||
|
||||
R.Config("custom_mdb_path", {
|
||||
name: "Custom MDB PATH",
|
||||
desc: "You need to enabled Custom MDB option first. USE ABSOLUTE PATH !!",
|
||||
desc: "You need to enable Custom MDB option first. USE ABSOLUTE PATH !!",
|
||||
type: "string",
|
||||
default: "",
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user