@bitblit/ratchet-common 6.1.171-alpha → 6.1.174-alpha

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.
@@ -0,0 +1,3 @@
1
+ import { RequireAll } from "./require-all.ts";
2
+ import { Exact } from "./exact.ts";
3
+ export type ExactAndRequireAll<T> = Exact<RequireAll<T>>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=exact-and-require-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exact-and-require-all.js","sourceRoot":"","sources":["../../src/typing/exact-and-require-all.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export type Exact<T extends object> = T & Partial<Record<Exclude<string, keyof T>, never>>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=exact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exact.js","sourceRoot":"","sources":["../../src/typing/exact.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export type RequireAll<T> = {
2
+ [K in keyof T]-?: NonNullable<T[K]>;
3
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=require-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-all.js","sourceRoot":"","sources":["../../src/typing/require-all.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitblit/ratchet-common",
3
- "version": "6.1.171-alpha",
3
+ "version": "6.1.174-alpha",
4
4
  "description": "Common tools for general use",
5
5
  "type": "module",
6
6
  "files": [
@@ -0,0 +1,9 @@
1
+ import { RequireAll } from "./require-all.ts";
2
+ import { Exact } from "./exact.ts";
3
+
4
+ /**
5
+ * This is used in a "satisfy" clause to make sure that an object
6
+ * contains all the fields in T and does not contain any fields
7
+ * not in T
8
+ */
9
+ export type ExactAndRequireAll<T> = Exact<RequireAll<T>>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This is used in a "satisfy" clause to make sure that an object
3
+ * DOES NOT contain any fields that the referred type doesn't have
4
+ */
5
+ export type Exact<T extends object> =
6
+ T & Partial<Record<Exclude<string, keyof T>, never>>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This is used in a "satisfy" clause to make sure that an object
3
+ * MUST contain all fields that the referred type does have
4
+ */
5
+ export type RequireAll<T> = {
6
+ [K in keyof T]-?: NonNullable<T[K]>;
7
+ };