临时性修复()

This commit is contained in:
RT15548
2025-12-21 17:53:56 +08:00
committed by GitHub
parent f077277fd3
commit e481b50403
2 changed files with 3385 additions and 3375 deletions

View File

@@ -405,8 +405,14 @@ export function lwbAssignVarPath(path, value) {
if (globalThis.LWB_Guard?.loadRules) {
const res = globalThis.LWB_Guard.loadRules(vParsed, rootName);
if (res?.cleanValue !== undefined) vParsed = res.cleanValue;
if (res?.rulesDelta && globalThis.LWB_Guard?.applyDelta) {
globalThis.LWB_Guard.applyDelta(res.rulesDelta);
if (res?.rulesDelta && typeof res.rulesDelta === 'object') {
if (globalThis.LWB_Guard?.applyDeltaTable) {
globalThis.LWB_Guard.applyDeltaTable(res.rulesDelta);
} else if (globalThis.LWB_Guard?.applyDelta) {
for (const [p, d] of Object.entries(res.rulesDelta)) {
globalThis.LWB_Guard.applyDelta(p, d);
}
}
globalThis.LWB_Guard.save?.();
}
}

View File

@@ -1329,7 +1329,11 @@ export function rulesLoadFromTree(valueTree, basePath) {
String(t).trim().startsWith('$') ? String(t).trim() : ('$' + String(t).trim())
);
const targetPath = curAbs ? `${curAbs}.${targetToken}` : targetToken;
const baseNorm = normalizePath(curAbs || '');
const tokenNorm = normalizePath(targetToken);
const targetPath = (baseNorm && (tokenNorm === baseNorm || tokenNorm.startsWith(baseNorm + '.')))
? tokenNorm
: (curAbs ? `${curAbs}.${targetToken}` : targetToken);
const absPath = normalizePath(targetPath);
const delta = parseDirectivesTokenList(dirs);