json放行

This commit is contained in:
tianmo committed 2026-09-11 14:02:48 +08:00
1 parent 99d85a9e6d
commit ba0f48c543
6 files changed
+52 -15

No files matched your search

+2 -2
View File
@@ -138,9 +138,9 @@ function classifySkeletonJson(filePath) {
try { fs.readSync(fd, buffer, 0, length, 0); } finally { fs.closeSync(fd); }
const text = buffer.toString('utf8');
const hasSkeletonKey = /"skeleton"\s*:/i.test(text);
const hasSkeletonVersion = /"skeleton"\s*:\s*\{[\s\S]{0,8192}?"spine"\s*:/i.test(text);
const versionMatch = text.match(/"skeleton"\s*:\s*\{[\s\S]{0,8192}?"spine"\s*:\s*"(\d+\.\d+(?:\.\d+)?(?:[^"\\]|\\.)*)"/i);
let kind;
if (hasSkeletonVersion) {
if (versionMatch) {
kind = 'spine';
} else if (stat.size > JSON_PROBE_BYTES) {
kind = 'other';