fix object
This commit is contained in:
@@ -3,10 +3,12 @@
|
|||||||
import TextAreaInput from "../UI/GUI/TextAreaInput.svelte";
|
import TextAreaInput from "../UI/GUI/TextAreaInput.svelte";
|
||||||
import { risuChatParser } from 'src/ts/parser';
|
import { risuChatParser } from 'src/ts/parser';
|
||||||
import { language } from 'src/lang';
|
import { language } from 'src/lang';
|
||||||
|
import { sleep } from 'src/ts/util';
|
||||||
let input = "";
|
let input = "";
|
||||||
let output = "";
|
let output = "";
|
||||||
const onInput = async () => {
|
const onInput = async () => {
|
||||||
try {
|
try {
|
||||||
|
await sleep(1)
|
||||||
output = risuChatParser(input, {
|
output = risuChatParser(input, {
|
||||||
consistantChar: true,
|
consistantChar: true,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -956,7 +956,11 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
|
|||||||
const agmts = arra.slice(2)
|
const agmts = arra.slice(2)
|
||||||
let current = arra[1]
|
let current = arra[1]
|
||||||
for(const arg of agmts){
|
for(const arg of agmts){
|
||||||
current = JSON.parse(current)[arg]
|
const parsed = JSON.parse(current)
|
||||||
|
if(parsed === null || (typeof(parsed) !== 'object' && !Array.isArray(parsed))){
|
||||||
|
return 'null'
|
||||||
|
}
|
||||||
|
current = parsed[arg]
|
||||||
if(!current){
|
if(!current){
|
||||||
return 'null'
|
return 'null'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user