Skip to content

Commit

Permalink
fix: better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jul 8, 2022
1 parent 0c40bda commit 21d61bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/vat-data/src/kind-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,26 @@ harden(provideKindHandle);
* the original's values.
*
* When the original is not a CopyRecord, some edge cases to be aware of
* * No matter how mutable the original object, the returned object is
* hardened.
* * Only the string-named enumerable own properties of the original
* are mapped. All other properties are ignored.
* * If any of the original properties were accessors, `Object.entries`
* will cause its `getter` to be called and will use the resulting
* value.
* * No matter whether the original property was an accessor, writable,
* or configurable, all the properties of the returned object will be
* writable, configurable, data properties.
* non-writable, non-configurable, data properties.
* * No matter what the original object may have inherited from, and
* no matter whether it was a special kind of object such as an array,
* the returned object will always be a plain object inheriting directly
* from `Object.prototype` and whose state is only these new mapped
* own properties.
*
* With these differences, even if the original object was not a CopyRecord,
* if all the mapped values are Passable, then the returned object will be
* a CopyRecord.
*
* @template V, U
* @param {Record<string,V>} original
* @param {(value: V, key?: string) => U} mapFn
Expand Down

0 comments on commit 21d61bd

Please sign in to comment.