Add text editor v2 integration tests

This commit is contained in:
Aitor Moreno
2025-10-30 14:15:12 +01:00
committed by Elena Torro
parent 786f73767b
commit 876d5783cf
22 changed files with 1662 additions and 303 deletions

View File

@@ -0,0 +1,30 @@
export class Transit {
static parse(value) {
if (typeof value !== 'string')
return value
if (value.startsWith('~'))
return value.slice(2)
return value
}
static get(object, ...path) {
let aux = object;
for (const name of path) {
if (typeof name !== 'string') {
if (!(name in aux)) {
return undefined;
}
aux = aux[name];
} else {
const transitName = `~:${name}`;
if (!(transitName in aux)) {
return undefined;
}
aux = aux[transitName];
}
}
return this.parse(aux);
}
}