|
1 | 1 | _section: Property Utilities |
2 | 2 |
|
3 | | -_property: ethers.utils.checkProperties() => void |
| 3 | +This is a collection of utility functions used for handling |
| 4 | +properties in a platform-safe way. |
| 5 | + |
| 6 | +The next major version of ethers will no longer be compatible |
| 7 | +with ES3, so many of these will be removed in favor of the |
| 8 | +built-in options available in ES2015 and above. |
| 9 | + |
| 10 | +_property: ethers.utils.checkProperties(object, check) => void |
| 11 | + |
| 12 | +Checks that //object// only contains properties included |
| 13 | +in //check//, and throws [INVALID_ARGUMENT](errors--invalid-argument) if not. |
4 | 14 |
|
5 | 15 | _property: ethers.utils.deepCopy(anObject) => any |
| 16 | + |
| 17 | +Creates a recursive copy of //anObject//. Frozen (i.e. and other known |
| 18 | +immutable) objects are copied by reference. |
| 19 | + |
6 | 20 | _property: ethers.utils.defineReadOnly(anObject, name, value) => void |
| 21 | + |
| 22 | +Uses the ``Object.defineProperty`` method to set a read-only property |
| 23 | +on an object. |
| 24 | + |
7 | 25 | _property: ethers.utils.getStatic(aConstructor, key) => any |
| 26 | + |
| 27 | +Recursively check for a static method //key// on an inheritance chain |
| 28 | +from //aConstructor// to all ancestors. |
| 29 | + |
| 30 | +This is used to mimic behaviour in other languages where ``this`` in |
| 31 | +a static method will also search ancestors. |
| 32 | + |
8 | 33 | _property: ethers.utils.resolveProperties(anObject) => Promise<any> @<utils-resolveproperties> @SRC<properties> |
| 34 | + |
| 35 | +Retruns a Promise which resolves all child values on //anObject//. |
| 36 | + |
9 | 37 | _property: ethers.utils.shallowCopy(anObject) => any |
| 38 | + |
| 39 | +Returns a shallow copy of //anObject//. This is the same as |
| 40 | +using ``Object.assign({ }, anObject)``. |
0 commit comments