@fedify/vocab-tools 2.4.1 → 2.4.2-dev.2357
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/deno.json +1 -1
- package/dist/mod.cjs +14 -1
- package/dist/mod.js +14 -1
- package/package.json +1 -1
- package/src/__snapshots__/class.test.ts.deno.snap +1118 -0
- package/src/__snapshots__/class.test.ts.node.snap +1118 -0
- package/src/__snapshots__/class.test.ts.snap +1118 -0
- package/src/constructor.ts +13 -0
package/src/constructor.ts
CHANGED
|
@@ -211,6 +211,19 @@ export async function* generateCloner(
|
|
|
211
211
|
/**
|
|
212
212
|
* Clones this instance, optionally updating it with the given values.
|
|
213
213
|
*
|
|
214
|
+
* This is a shallow copy: property arrays are copied, but nested objects
|
|
215
|
+
* and URLs are shared with this instance. Dereferencing accessors can cache
|
|
216
|
+
* fetched objects in the instance whose accessor is called. Hydrating a
|
|
217
|
+
* shared nested object through the clone can affect the original as well,
|
|
218
|
+
* and can change JSON-LD output when either is embedded in another
|
|
219
|
+
* object. Hydrating a top-level property of the clone does not update this
|
|
220
|
+
* instance's property.
|
|
221
|
+
*
|
|
222
|
+
* To resolve properties without sharing nested objects, serialize and
|
|
223
|
+
* re-parse the instance before hydration rather than using this method.
|
|
224
|
+
* See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability)
|
|
225
|
+
* for details, including how cached JSON-LD affects serialization.
|
|
226
|
+
*
|
|
214
227
|
* A clone never inherits a signed JSON-LD representation retained by
|
|
215
228
|
* \`signObject()\`: the clone may differ from the document that the proof
|
|
216
229
|
* covers, so embedding the original secured JSON in a parent document
|