@twin.org/data-json-ld 0.0.1-next.22 → 0.0.1-next.23
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
CHANGED
|
@@ -1582,10 +1582,13 @@ class JsonLdProcessor {
|
|
|
1582
1582
|
*/
|
|
1583
1583
|
static async expand(compacted) {
|
|
1584
1584
|
try {
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1585
|
+
if (core.Is.object(compacted)) {
|
|
1586
|
+
const expanded = await jsonLd.expand(core.ObjectHelper.removeEmptyProperties(compacted), {
|
|
1587
|
+
documentLoader: JsonLdProcessor.DOCUMENT_LOADER
|
|
1588
|
+
});
|
|
1589
|
+
return expanded;
|
|
1590
|
+
}
|
|
1591
|
+
return [];
|
|
1589
1592
|
}
|
|
1590
1593
|
catch (err) {
|
|
1591
1594
|
if (core.Is.object(err) &&
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1580,10 +1580,13 @@ class JsonLdProcessor {
|
|
|
1580
1580
|
*/
|
|
1581
1581
|
static async expand(compacted) {
|
|
1582
1582
|
try {
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1583
|
+
if (Is.object(compacted)) {
|
|
1584
|
+
const expanded = await jsonLd.expand(ObjectHelper.removeEmptyProperties(compacted), {
|
|
1585
|
+
documentLoader: JsonLdProcessor.DOCUMENT_LOADER
|
|
1586
|
+
});
|
|
1587
|
+
return expanded;
|
|
1588
|
+
}
|
|
1589
|
+
return [];
|
|
1587
1590
|
}
|
|
1588
1591
|
catch (err) {
|
|
1589
1592
|
if (Is.object(err) &&
|
|
@@ -26,7 +26,7 @@ export declare class JsonLdProcessor {
|
|
|
26
26
|
* @param compacted The compacted JSON-LD document to expand.
|
|
27
27
|
* @returns The expanded JSON-LD document.
|
|
28
28
|
*/
|
|
29
|
-
static expand<T
|
|
29
|
+
static expand<T>(compacted: T): Promise<IJsonLdNodeObject[]>;
|
|
30
30
|
/**
|
|
31
31
|
* Add a redirect to use during document resolution.
|
|
32
32
|
* @param from The URL to redirect from.
|
package/docs/changelog.md
CHANGED
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.23",
|
|
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.23",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next",
|