@coasys/ad4m 0.12.0-rc1-dev → 0.12.0-rc1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +4 -2
- package/lib/index.js +4 -2
- package/lib/src/model/Ad4mModel.js +4 -2
- package/package.json +1 -1
- package/src/model/Ad4mModel.ts +4 -2
package/lib/index.cjs
CHANGED
|
@@ -20676,8 +20676,10 @@ class Ad4mModel {
|
|
|
20676
20676
|
console.warn(`Failed to resolve expression for ${propName}:`, e);
|
|
20677
20677
|
}
|
|
20678
20678
|
}
|
|
20679
|
-
else if (typeof value === 'string' && value.startsWith('literal://')) {
|
|
20680
|
-
//
|
|
20679
|
+
else if (propMeta.resolveLanguage === 'literal' && typeof value === 'string' && value.startsWith('literal://')) {
|
|
20680
|
+
// Only parse literal URIs when resolveLanguage is explicitly 'literal'.
|
|
20681
|
+
// Without this guard, properties pointing to baseExpressions of other models
|
|
20682
|
+
// (which may be literal:// strings) would get unwrapped, breaking link URI validation.
|
|
20681
20683
|
try {
|
|
20682
20684
|
const parsed = Literal.fromUrl(value).get();
|
|
20683
20685
|
value = parsed.data !== undefined ? parsed.data : parsed;
|
package/lib/index.js
CHANGED
|
@@ -20672,8 +20672,10 @@ class Ad4mModel {
|
|
|
20672
20672
|
console.warn(`Failed to resolve expression for ${propName}:`, e);
|
|
20673
20673
|
}
|
|
20674
20674
|
}
|
|
20675
|
-
else if (typeof value === 'string' && value.startsWith('literal://')) {
|
|
20676
|
-
//
|
|
20675
|
+
else if (propMeta.resolveLanguage === 'literal' && typeof value === 'string' && value.startsWith('literal://')) {
|
|
20676
|
+
// Only parse literal URIs when resolveLanguage is explicitly 'literal'.
|
|
20677
|
+
// Without this guard, properties pointing to baseExpressions of other models
|
|
20678
|
+
// (which may be literal:// strings) would get unwrapped, breaking link URI validation.
|
|
20677
20679
|
try {
|
|
20678
20680
|
const parsed = Literal.fromUrl(value).get();
|
|
20679
20681
|
value = parsed.data !== undefined ? parsed.data : parsed;
|
|
@@ -672,8 +672,10 @@ export class Ad4mModel {
|
|
|
672
672
|
console.warn(`Failed to resolve expression for ${propName}:`, e);
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
else if (typeof value === 'string' && value.startsWith('literal://')) {
|
|
676
|
-
//
|
|
675
|
+
else if (propMeta.resolveLanguage === 'literal' && typeof value === 'string' && value.startsWith('literal://')) {
|
|
676
|
+
// Only parse literal URIs when resolveLanguage is explicitly 'literal'.
|
|
677
|
+
// Without this guard, properties pointing to baseExpressions of other models
|
|
678
|
+
// (which may be literal:// strings) would get unwrapped, breaking link URI validation.
|
|
677
679
|
try {
|
|
678
680
|
const parsed = Literal.fromUrl(value).get();
|
|
679
681
|
value = parsed.data !== undefined ? parsed.data : parsed;
|
package/package.json
CHANGED
package/src/model/Ad4mModel.ts
CHANGED
|
@@ -844,8 +844,10 @@ export class Ad4mModel {
|
|
|
844
844
|
} catch (e) {
|
|
845
845
|
console.warn(`Failed to resolve expression for ${propName}:`, e);
|
|
846
846
|
}
|
|
847
|
-
} else if (typeof value === 'string' && value.startsWith('literal://')) {
|
|
848
|
-
//
|
|
847
|
+
} else if (propMeta.resolveLanguage === 'literal' && typeof value === 'string' && value.startsWith('literal://')) {
|
|
848
|
+
// Only parse literal URIs when resolveLanguage is explicitly 'literal'.
|
|
849
|
+
// Without this guard, properties pointing to baseExpressions of other models
|
|
850
|
+
// (which may be literal:// strings) would get unwrapped, breaking link URI validation.
|
|
849
851
|
try {
|
|
850
852
|
const parsed = Literal.fromUrl(value).get();
|
|
851
853
|
value = parsed.data !== undefined ? parsed.data : parsed;
|