* Methods will be called with the resulting object as their this
* value.
*
- * LazyLoader objects have the same prototype as the passed methods
+ * `LazyLoader` objects have the same prototype as the passed methods
* object.
*/
export class LazyLoader extends null {
/**
- * Constructs a new LazyLoader object.
+ * Constructs a new `LazyLoader` object.
*
* ☡ This function throws if the provided value is not an object.
*/
* object.
*
* The resulting object is proxied to enforce types (for example,
- * its `enumerable` property, if defined, will always be a
+ * its `.enumerable` property, if defined, will always be a
* boolean).
*/
constructor(O) {
* descriptors on the enumerable own properties of the provided
* additional objects.
*
- * ※ This differs from Object.defineProperties in that it can take
+ * ※ This differs from `Object.defineProperties` in that it can take
* multiple source objects.
*/
defineOwnProperties,
* Defines an own property on the provided object on the provided
* property key using the provided property descriptor.
*
- * ※ This is an alias for Object.defineProperty.
+ * ※ This is an alias for `Object.defineProperty`.
*/
defineProperty: defineOwnProperty,
* properties as nonconfigurable and (if data properties)
* nonwritable, and returns the object.
*
- * ※ This is an alias for Object.freeze.
+ * ※ This is an alias for `Object.freeze`.
*/
freeze,
* provided property key on the provided object, or null if none
* exists.
*
- * ※ This is an alias for Object.getOwnPropertyDescriptor.
+ * ※ This is an alias for `Object.getOwnPropertyDescriptor`.
*/
getOwnPropertyDescriptor,
* Returns the property descriptors for the own properties on the
* provided object.
*
- * ※ This is an alias for Object.getOwnPropertyDescriptors.
+ * ※ This is an alias for `Object.getOwnPropertyDescriptors`.
*/
getOwnPropertyDescriptors,
*
* ☡ This includes both enumerable and non·enumerable properties.
*
- * ※ This is an alias for Object.getOwnPropertyNames.
+ * ※ This is an alias for `Object.getOwnPropertyNames`.
*/
getOwnPropertyNames: getOwnPropertyStrings,
*
* ☡ This includes both enumerable and non·enumerable properties.
*
- * ※ This is an alias for Object.getOwnPropertySymbols.
+ * ※ This is an alias for `Object.getOwnPropertySymbols`.
*/
getOwnPropertySymbols,
/**
* Returns the prototype of the provided object.
*
- * ※ This is an alias for Object.getPrototypeOf.
+ * ※ This is an alias for `Object.getPrototypeOf`.
*/
getPrototypeOf: getPrototype,
* Returns whether the provided object has an own property with the
* provided property key.
*
- * ※ This is an alias for Object.hasOwn.
+ * ※ This is an alias for `Object.hasOwn`.
*/
hasOwn: hasOwnProperty,
/**
* Returns whether the provided object is extensible.
*
- * ※ This is an alias for Object.isExtensible.
+ * ※ This is an alias for `Object.isExtensible`.
*/
- isExtensible,
+ isExtensible: isExtensibleObject,
/**
* Returns whether the provided object is frozen.
*
- * ※ This is an alias for Object.isFrozen.
+ * ※ This is an alias for `Object.isFrozen`.
*/
- isFrozen,
+ isFrozen: isFrozenObject,
/**
* Returns whether the provided object is sealed.
*
- * ※ This is an alias for Object.isSealed.
+ * ※ This is an alias for `Object.isSealed`.
*/
- isSealed,
+ isSealed: isSealedObject,
/**
* Returns an array of key~value pairs for the enumerable,
* string‐valued property keys on the provided object.
*
- * ※ This is an alias for Object.entries.
+ * ※ This is an alias for `Object.entries`.
*/
entries: namedEntries,
* Returns an array of the enumerable, string‐valued property keys on
* the provided object.
*
- * ※ This is an alias for Object.keys.
+ * ※ This is an alias for `Object.keys`.
*/
keys: namedKeys,
* Returns an array of property values for the enumerable,
* string‐valued property keys on the provided object.
*
- * ※ This is an alias for Object.values.
+ * ※ This is an alias for `Object.values`.
*/
values: namedValues,
* Returns a new object with the provided prototype and property
* descriptors.
*
- * ※ This is an alias for Object.create.
+ * ※ This is an alias for `Object.create`.
*/
create: objectCreate,
/**
* Returns a new object with the provided property keys and values.
*
- * ※ This is an alias for Object.fromEntries.
+ * ※ This is an alias for `Object.fromEntries`.
*/
fromEntries: objectFromEntries,
* Marks the provided object as non·extensible, and returns the
* object.
*
- * ※ This is an alias for Object.preventExtensions.
+ * ※ This is an alias for `Object.preventExtensions`.
*/
preventExtensions,
* Marks the provided object as non·extensible and marks all its
* properties as nonconfigurable, and returns the object.
*
- * ※ This is an alias for Object.seal.
+ * ※ This is an alias for `Object.seal`.
*/
seal,
* Sets the values of the enumerable own properties of the provided
* additional objects on the provided object.
*
- * ※ This is an alias for Object.assign.
+ * ※ This is an alias for `Object.assign`.
*/
assign: setPropertyValues,
* Sets the prototype of the provided object to the provided value
* and returns the object.
*
- * ※ This is an alias for Object.setPrototypeOf.
+ * ※ This is an alias for `Object.setPrototypeOf`.
*/
setPrototypeOf: setPrototype,
} = Object;
* Removes the provided property key from the provided object and
* returns the object.
*
- * ※ This function differs from Reflect.deleteProperty and the
+ * ※ This function differs from `Reflect.deleteProperty` and the
* `delete` operator in that it throws if the deletion is
* unsuccessful.
*
/**
* Returns an array of property keys on the provided object.
*
- * ※ This is effectively an alias for Reflect.ownKeys, except that
+ * ※ This is effectively an alias for `Reflect.ownKeys`, except that
* it does not require that the argument be an object.
*/
getOwnPropertyKeys,
* Returns the value of the provided property key on the provided
* object.
*
- * ※ This is effectively an alias for Reflect.get, except that it
+ * ※ This is effectively an alias for `Reflect.get`, except that it
* does not require that the argument be an object.
*/
getPropertyValue,
* Returns whether the provided property key exists on the provided
* object.
*
- * ※ This is effectively an alias for Reflect.has, except that it
+ * ※ This is effectively an alias for `Reflect.has`, except that it
* does not require that the argument be an object.
*
* ※ This includes properties present on the prototype chain.
* Sets the provided property key to the provided value on the
* provided object and returns the object.
*
- * ※ This function differs from Reflect.set in that it throws if the
- * setting is unsuccessful.
+ * ※ This function differs from `Reflect.set` in that it throws if
+ * the setting is unsuccessful.
*
* ☡ This function throws if the first argument is not an object.
*/
* property with the same getter *and* setter.
*
* The prototype for the resulting object will be taken from the
- * `prototype` property of the provided constructor, or the
- * `prototype` of the `constructor` of the provided object if the
+ * `.prototype` property of the provided constructor, or the
+ * `.prototype` of the `.constructor` of the provided object if the
* provided constructor is undefined. If the used constructor has a
- * nonnullish `Symbol.species`, that will be used instead. If the
+ * nonnullish `.[Symbol.species]`, that will be used instead. If the
* used constructor or species is nullish or does not have a
- * `prototype` property, the prototype is set to null.
+ * `.prototype` property, the prototype is set to null.
*
* ※ The prototype of the provided object itself is ignored.
*/
// O is not null or undefined.
//
// (If not provided, the constructor will be the value of
- // getting the `constructor` property of O.)
+ // getting the `.constructor` property of O.)
const species = constructor?.[SPECIES] ?? constructor;
return preventExtensions(
objectCreate(