@twin.org/data-json-ld 0.0.1-next.10 → 0.0.1-next.11

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.
@@ -1581,23 +1581,6 @@ class JsonLdProcessor {
1581
1581
  this._redirects.push({ from, to });
1582
1582
  }
1583
1583
  }
1584
- /**
1585
- * Extract a property from the JSON-LD.
1586
- * @param nodeObject The JSON-LD node object to extract from.
1587
- * @param propertyNames The possible names for the property.
1588
- * @param deleteProperty Delete the property from the object, defaults to true.
1589
- * @returns The properties if available.
1590
- */
1591
- static extractProperty(nodeObject, propertyNames, deleteProperty = true) {
1592
- let retVal;
1593
- for (const prop of propertyNames) {
1594
- retVal ??= nodeObject[prop];
1595
- if (deleteProperty) {
1596
- delete nodeObject[prop];
1597
- }
1598
- }
1599
- return retVal;
1600
- }
1601
1584
  /**
1602
1585
  * Combine contexts.
1603
1586
  * @param context1 The first JSON-LD context to combine.
@@ -1579,23 +1579,6 @@ class JsonLdProcessor {
1579
1579
  this._redirects.push({ from, to });
1580
1580
  }
1581
1581
  }
1582
- /**
1583
- * Extract a property from the JSON-LD.
1584
- * @param nodeObject The JSON-LD node object to extract from.
1585
- * @param propertyNames The possible names for the property.
1586
- * @param deleteProperty Delete the property from the object, defaults to true.
1587
- * @returns The properties if available.
1588
- */
1589
- static extractProperty(nodeObject, propertyNames, deleteProperty = true) {
1590
- let retVal;
1591
- for (const prop of propertyNames) {
1592
- retVal ??= nodeObject[prop];
1593
- if (deleteProperty) {
1594
- delete nodeObject[prop];
1595
- }
1596
- }
1597
- return retVal;
1598
- }
1599
1582
  /**
1600
1583
  * Combine contexts.
1601
1584
  * @param context1 The first JSON-LD context to combine.
@@ -1,5 +1,5 @@
1
1
  import type { RemoteDocument, Url } from "jsonld/jsonld-spec";
2
- import type { IJsonLdContextDefinitionElement, IJsonLdContextDefinitionRoot, IJsonLdDocument, IJsonLdNodeObject } from "../models/IJsonLdDocument";
2
+ import type { IJsonLdContextDefinitionElement, IJsonLdContextDefinitionRoot, IJsonLdDocument } from "../models/IJsonLdDocument";
3
3
  /**
4
4
  * JSON-LD Processor.
5
5
  */
@@ -31,14 +31,6 @@ export declare class JsonLdProcessor {
31
31
  * @param to The URL to redirect to.
32
32
  */
33
33
  static addRedirect(from: RegExp, to: string): void;
34
- /**
35
- * Extract a property from the JSON-LD.
36
- * @param nodeObject The JSON-LD node object to extract from.
37
- * @param propertyNames The possible names for the property.
38
- * @param deleteProperty Delete the property from the object, defaults to true.
39
- * @returns The properties if available.
40
- */
41
- static extractProperty<T>(nodeObject: IJsonLdNodeObject, propertyNames: string[], deleteProperty?: boolean): T | undefined;
42
34
  /**
43
35
  * Combine contexts.
44
36
  * @param context1 The first JSON-LD context to combine.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/data-json-ld - Changelog
2
2
 
3
- ## v0.0.1-next.10
3
+ ## v0.0.1-next.11
4
4
 
5
5
  - Initial Release
@@ -96,38 +96,6 @@ The URL to redirect to.
96
96
 
97
97
  ***
98
98
 
99
- ### extractProperty()
100
-
101
- > `static` **extractProperty**\<`T`\>(`nodeObject`, `propertyNames`, `deleteProperty`): `undefined` \| `T`
102
-
103
- Extract a property from the JSON-LD.
104
-
105
- #### Type Parameters
106
-
107
- • **T**
108
-
109
- #### Parameters
110
-
111
- • **nodeObject**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)
112
-
113
- The JSON-LD node object to extract from.
114
-
115
- • **propertyNames**: `string`[]
116
-
117
- The possible names for the property.
118
-
119
- • **deleteProperty**: `boolean` = `true`
120
-
121
- Delete the property from the object, defaults to true.
122
-
123
- #### Returns
124
-
125
- `undefined` \| `T`
126
-
127
- The properties if available.
128
-
129
- ***
130
-
131
99
  ### combineContexts()
132
100
 
133
101
  > `static` **combineContexts**(`context1`, `context2`): `undefined` \| [`IJsonLdContextDefinitionRoot`](../type-aliases/IJsonLdContextDefinitionRoot.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-json-ld",
3
- "version": "0.0.1-next.10",
3
+ "version": "0.0.1-next.11",
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.10",
18
+ "@twin.org/data-core": "0.0.1-next.11",
19
19
  "@twin.org/entity": "next",
20
20
  "@twin.org/nameof": "next",
21
21
  "@twin.org/web": "next",