chore: YAML 解析兼容(保持类型)

This commit is contained in:
xream 2024-01-31 03:27:07 +08:00
parent a84007d39e
commit 31b6dd0507
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.197",
"version": "2.14.198",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -4,7 +4,15 @@ function retry(fn, content, ...args) {
try {
return fn(content, ...args);
} catch (e) {
return fn(content.replace(/!<str>/g, ''), ...args);
return fn(
dump(
fn(
content.replace(/!<str>\s*/g, '__SubStoreJSYAMLString__'),
...args,
),
).replace(/__SubStoreJSYAMLString__/g, ''),
...args,
);
}
}