@orkestrel/contract 0.0.17 → 0.0.18

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.
@@ -906,6 +906,20 @@ function isNullableBoolean(value) {
906
906
  * wraps the check in {@link holds} (see ./helpers.js) so any such throw
907
907
  * yields `false` instead of escaping.
908
908
  *
909
+ * Narrows `value` to `InstanceType<C>`, which reads the constructor's last
910
+ * construct signature. Accepts the same constructors as `instanceOf`: a public
911
+ * or abstract construct signature returning an object (or `any`). A class with a
912
+ * private or protected constructor and the bare `AnyConstructor` are refused at the call.
913
+ * A value typed `Function` cannot be passed because the `Function` interface has
914
+ * no construct signature. The constructor `Function` can be passed through
915
+ * `FunctionConstructor`'s construct signature and narrows to `Function`.
916
+ * The false branch drops each member of the declared union that is a subtype
917
+ * of the instance type and keeps the rest, so a subclass that adds no member
918
+ * narrows its base out as well (and a subclass that adds only an optional member
919
+ * does not). A constructor whose instance type admits
920
+ * primitives structurally, such as `Object`, makes the false branch unsound;
921
+ * use `isObject` for that check.
922
+ *
909
923
  * @param value - The value to test
910
924
  * @param ctor - The constructor to test against
911
925
  * @returns True if `value instanceof ctor`; false otherwise, including on a