type-fns 1.21.3 → 1.21.4

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.
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from './companions/pick';
14
14
  export * from './guards/assure';
15
15
  export * from './types/DropFirst';
16
16
  export * from './types/Empty';
17
+ export * from './types/HasMaybe';
17
18
  export * from './types/Literalize';
18
19
  export * from './types/PickAny';
19
20
  export * from './types/PickOne';
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ __exportStar(require("./companions/pick"), exports);
30
30
  __exportStar(require("./guards/assure"), exports);
31
31
  __exportStar(require("./types/DropFirst"), exports);
32
32
  __exportStar(require("./types/Empty"), exports);
33
+ __exportStar(require("./types/HasMaybe"), exports);
33
34
  __exportStar(require("./types/Literalize"), exports);
34
35
  __exportStar(require("./types/PickAny"), exports);
35
36
  __exportStar(require("./types/PickOne"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,mDAAiC;AACjC,uDAAqC;AACrC,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,wDAAsC;AACtC,0DAAwC;AACxC,oDAAkC;AAClC,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,wDAAsC;AACtC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,mDAAiC;AACjC,uDAAqC;AACrC,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,wDAAsC;AACtC,0DAAwC;AACxC,oDAAkC;AAClC,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,mDAAiC;AACjC,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,wDAAsC;AACtC,qDAAmC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * makes the listed key(s) `K` of `T` optional — the make-maybe companion of the
3
+ * make-required (`HasMetadata`) / omit (`OmitMetadata`) trio.
4
+ *
5
+ * use when a value's key is authored without it, then bound at a later
6
+ * lifecycle stage (e.g. a domain key like `exid` known only at activation).
7
+ *
8
+ * for example, `HasMaybe<{ role: string; exid: string }, 'exid'>` produces
9
+ * `{ role: string; exid?: string }`.
10
+ *
11
+ * note:
12
+ * - this type preserves all non-`K` keys exactly (required keys stay required)
13
+ * - this type only loosens the listed `K` — it does not add keys and does not
14
+ * touch any key outside `K`
15
+ * - `K extends keyof T` — a key not on `T` is a compile error
16
+ */
17
+ export type HasMaybe<T extends Record<string, any>, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=HasMaybe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasMaybe.js","sourceRoot":"","sources":["../../src/types/HasMaybe.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "type-fns",
3
3
  "author": "ehmpathy",
4
4
  "description": "A set of types, type checks, and type guards for simpler, safer, and easier to read code.",
5
- "version": "1.21.3",
5
+ "version": "1.21.4",
6
6
  "repository": "ehmpathy/type-fns",
7
7
  "homepage": "https://github.com/ehmpathy/type-fns",
8
8
  "keywords": [
@@ -55,7 +55,7 @@
55
55
  "preversion": "npm run prepush",
56
56
  "postversion": "git push origin HEAD --tags --no-verify",
57
57
  "prepare:husky": "husky install && chmod ug+x .husky/*",
58
- "prepare:rhachet": "rhachet init --keys --hooks --roles mechanic behaver driver reviewer librarian ergonomist architect",
58
+ "prepare:rhachet": "rhachet init --hooks --roles mechanic behaver driver architect ergonomist reviewer dreamer dispatcher",
59
59
  "prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi",
60
60
  "test:lint:cycles": "dpdm --no-warning --no-tree --exit-code circular:1 --exclude '^$' 'src/**/*.ts'",
61
61
  "upgrade:rhachet": "rhachet upgrade"
@@ -87,12 +87,13 @@
87
87
  "esbuild-register": "3.6.0",
88
88
  "husky": "8.0.3",
89
89
  "jest": "30.2.0",
90
- "rhachet": "1.39.9",
91
- "rhachet-brains-anthropic": "0.4.0",
90
+ "rhachet": "1.43.1",
91
+ "rhachet-brains-anthropic": "0.4.1",
92
+ "rhachet-brains-fireworksai": "0.1.3",
92
93
  "rhachet-brains-xai": "0.3.3",
93
- "rhachet-roles-bhrain": "0.23.11",
94
- "rhachet-roles-bhuild": "0.17.1",
95
- "rhachet-roles-ehmpathy": "1.34.25",
94
+ "rhachet-roles-bhrain": "0.30.2",
95
+ "rhachet-roles-bhuild": "0.21.25",
96
+ "rhachet-roles-ehmpathy": "1.38.1",
96
97
  "test-fns": "1.15.8",
97
98
  "ts-jest": "29.1.3",
98
99
  "ts-node": "10.9.2",