1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-15 04:44:05 +00:00

Loose JSON parsing. Many UI improvements.

This commit is contained in:
2023-02-19 17:26:32 +01:00
parent 7ac1587c95
commit 78540622ee
25 changed files with 211 additions and 130 deletions

View File

@ -1,5 +1,6 @@
import { isInt } from '$lib/math';
import { canBeObjectId, int32, int64, uint64 } from '$lib/mongo';
import { jsonLooseParse } from '$lib/strings';
export default function input(node, { autofocus, type, onValid, onInvalid, mandatory } = {
autofocus: false,
@ -26,7 +27,7 @@ export default function input(node, { autofocus, type, onValid, onInvalid, manda
switch (type) {
case 'json':
try {
JSON.parse(node.value);
jsonLooseParse(node.value);
return false;
}
catch {