inferred-types 0.52.13 → 0.52.15

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.
@@ -1,9 +1,9 @@
1
- import { Keys, Dictionary, ObjectKey, RequiredProps } from "inferred-types/types";
1
+ import { ObjectKey, RequiredKeysTuple, AnyObject, IsWideContainer, IsEqual, EmptyObject } from "inferred-types/types";
2
2
  /**
3
3
  * **HasRequiredProps**`<T>`
4
4
  *
5
- * Receives an object and returns true/false based on whether
6
- * the type has required properties or not.
5
+ * Receives `T` and returns true/false based on whether
6
+ * the `T` is an object _and_ has at least one required property on it.
7
7
  */
8
- export type HasRequiredProps<T extends object> = T extends Dictionary ? Keys<RequiredProps<T>> extends readonly ObjectKey[] ? Keys<RequiredProps<T>>["length"] extends 0 ? false : true : false : false;
8
+ export type HasRequiredProps<T extends AnyObject> = IsWideContainer<T> extends true ? IsEqual<T, EmptyObject> extends true ? false : boolean : RequiredKeysTuple<T> extends readonly ObjectKey[] ? RequiredKeysTuple<T>["length"] extends 0 ? false : true : false;
9
9
  //# sourceMappingURL=HasRequiredProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HasRequiredProps.d.ts","sourceRoot":"","sources":["../../../../src/types/boolean-logic/operators/HasRequiredProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,MAAM,IACd,CAAC,SAAS,UAAU,GACtB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,SAAS,EAAE,GACjD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACxC,KAAK,GACL,IAAI,GACN,KAAK,GACP,KAAK,CAAC"}
1
+ {"version":3,"file":"HasRequiredProps.d.ts","sourceRoot":"","sources":["../../../../src/types/boolean-logic/operators/HasRequiredProps.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,OAAO,EACP,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,SAAS,IACjB,eAAe,CAAC,CAAC,CAAC,SAAS,IAAI,GACjC,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,OAAO,GAEtD,iBAAiB,CAAC,CAAC,CAAC,SAAS,SAAS,SAAS,EAAE,GAC/C,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACtC,KAAK,GACL,IAAI,GACN,KAAK,CAAC"}