@twin.org/data-json-ld 0.0.1-next.33 → 0.0.1-next.34
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/dist/cjs/index.cjs +11 -5
- package/dist/esm/index.mjs +11 -5
- package/docs/changelog.md +14 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1962,11 +1962,17 @@ class JsonLdHelper {
|
|
|
1962
1962
|
}
|
|
1963
1963
|
else if (core.Is.object(document)) {
|
|
1964
1964
|
// Expand the document to ensure we have the full context for types
|
|
1965
|
-
// As the data types in the factories are
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1965
|
+
// As the data types in the factories are always fully qualified
|
|
1966
|
+
const expandedDocs = await JsonLdProcessor.expand(document);
|
|
1967
|
+
if (core.Is.arrayValue(expandedDocs)) {
|
|
1968
|
+
for (const expandedDoc of expandedDocs) {
|
|
1969
|
+
const expandedDataTypes = core.ArrayHelper.fromObjectOrArray(expandedDoc["@type"]);
|
|
1970
|
+
if (core.Is.arrayValue(expandedDataTypes)) {
|
|
1971
|
+
for (const expandedDataType of expandedDataTypes) {
|
|
1972
|
+
await dataCore.DataTypeHelper.validate("document", expandedDataType, document, validationFailures, options);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1970
1976
|
}
|
|
1971
1977
|
}
|
|
1972
1978
|
return validationFailures.length === 0;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1960,11 +1960,17 @@ class JsonLdHelper {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
else if (Is.object(document)) {
|
|
1962
1962
|
// Expand the document to ensure we have the full context for types
|
|
1963
|
-
// As the data types in the factories are
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1963
|
+
// As the data types in the factories are always fully qualified
|
|
1964
|
+
const expandedDocs = await JsonLdProcessor.expand(document);
|
|
1965
|
+
if (Is.arrayValue(expandedDocs)) {
|
|
1966
|
+
for (const expandedDoc of expandedDocs) {
|
|
1967
|
+
const expandedDataTypes = ArrayHelper.fromObjectOrArray(expandedDoc["@type"]);
|
|
1968
|
+
if (Is.arrayValue(expandedDataTypes)) {
|
|
1969
|
+
for (const expandedDataType of expandedDataTypes) {
|
|
1970
|
+
await DataTypeHelper.validate("document", expandedDataType, document, validationFailures, options);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1968
1974
|
}
|
|
1969
1975
|
}
|
|
1970
1976
|
return validationFailures.length === 0;
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/data-json-ld - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.34](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.33...data-json-ld-v0.0.1-next.34) (2025-06-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* support multiple type JSON-LD ([8f0d530](https://github.com/twinfoundation/data/commit/8f0d530f66302ab19413ecf968f170f97456e31e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/data-core bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
16
|
+
|
|
3
17
|
## [0.0.1-next.33](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.32...data-json-ld-v0.0.1-next.33) (2025-06-02)
|
|
4
18
|
|
|
5
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-json-ld",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.34",
|
|
4
4
|
"description": "Models which define the structure of JSON LD",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.1-next.
|
|
18
|
+
"@twin.org/data-core": "0.0.1-next.34",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next",
|