hotypes 0.4.6 → 0.4.7

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/README.md CHANGED
@@ -49,6 +49,7 @@ It is highly recommended to read test cases to make sure you understand what typ
49
49
  - MapPropsExtendType
50
50
  - MapPropsToNonNullable
51
51
  - Mixin
52
+ - MixinAll
52
53
  - NonNullableKeys
53
54
  - NullableKeys
54
55
  - OmitPropsByType
package/lib/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './map-props-by-key-to-optional';
16
16
  export * from './map-props-extend-type';
17
17
  export * from './map-props-to-non-nullable';
18
18
  export * from './mixin';
19
+ export * from './mixin-all';
19
20
  export * from './non-nullable-keys';
20
21
  export * from './nullable-keys';
21
22
  export * from './omit-props-by-type';
package/lib/index.js CHANGED
@@ -32,6 +32,7 @@ __exportStar(require("./map-props-by-key-to-optional"), exports);
32
32
  __exportStar(require("./map-props-extend-type"), exports);
33
33
  __exportStar(require("./map-props-to-non-nullable"), exports);
34
34
  __exportStar(require("./mixin"), exports);
35
+ __exportStar(require("./mixin-all"), exports);
35
36
  __exportStar(require("./non-nullable-keys"), exports);
36
37
  __exportStar(require("./nullable-keys"), exports);
37
38
  __exportStar(require("./omit-props-by-type"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,kDAA+B;AAC/B,yCAAsB;AACtB,iDAA8B;AAC9B,yDAAsC;AACtC,6DAA0C;AAC1C,qDAAkC;AAClC,yCAAsB;AACtB,4EAAyD;AACzD,mEAAgD;AAChD,8CAA2B;AAC3B,qEAAkD;AAClD,qDAAkC;AAClC,sDAAmC;AACnC,iEAA8C;AAC9C,0DAAuC;AACvC,8DAA2C;AAC3C,0CAAuB;AACvB,sDAAmC;AACnC,kDAA+B;AAC/B,uDAAoC;AACpC,2DAAwC;AACxC,kDAA+B;AAC/B,mDAAgC;AAChC,yDAAsC;AACtC,0DAAuC;AACvC,iDAA8B;AAC9B,+DAA4C;AAC5C,yCAAsB;AACtB,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,kDAA+B;AAC/B,yCAAsB;AACtB,iDAA8B;AAC9B,yDAAsC;AACtC,6DAA0C;AAC1C,qDAAkC;AAClC,yCAAsB;AACtB,4EAAyD;AACzD,mEAAgD;AAChD,8CAA2B;AAC3B,qEAAkD;AAClD,qDAAkC;AAClC,sDAAmC;AACnC,iEAA8C;AAC9C,0DAAuC;AACvC,8DAA2C;AAC3C,0CAAuB;AACvB,8CAA2B;AAC3B,sDAAmC;AACnC,kDAA+B;AAC/B,uDAAoC;AACpC,2DAAwC;AACxC,kDAA+B;AAC/B,mDAAgC;AAChC,yDAAsC;AACtC,0DAAuC;AACvC,iDAA8B;AAC9B,+DAA4C;AAC5C,yCAAsB;AACtB,iDAA8B"}
@@ -0,0 +1,2 @@
1
+ import { Mixin } from './mixin';
2
+ export declare type MixinAll<Tuple extends any[], Result = {}> = Tuple extends [infer First, ...infer Rest] ? MixinAll<Rest, Mixin<Result, First>> : Result;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mixin-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixin-all.js","sourceRoot":"","sources":["../src/mixin-all.ts"],"names":[],"mappings":""}
package/lib/mixin.d.ts CHANGED
@@ -1 +1,3 @@
1
- export declare type Mixin<Base, Other> = Pick<Base, Exclude<keyof Base, keyof Other>> & Other;
1
+ export declare type Mixin<Base, Other> = {
2
+ [Key in keyof (Base & Other)]: Key extends keyof Other ? Other[Key] : Key extends keyof Base ? Base[Key] : never;
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotypes",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Higher order types for TypeScript",
5
5
  "keywords": [
6
6
  "higher-order",
@@ -41,9 +41,9 @@
41
41
  "@commitlint/cli": "^17.0.3",
42
42
  "@commitlint/config-conventional": "^17.0.3",
43
43
  "@types/jest": "^27.4.1",
44
- "@typescript-eslint/eslint-plugin": "^5.32.0",
45
- "@typescript-eslint/parser": "^5.32.0",
46
- "eslint": "^8.21.0",
44
+ "@typescript-eslint/eslint-plugin": "^5.34.0",
45
+ "@typescript-eslint/parser": "^5.34.0",
46
+ "eslint": "^8.22.0",
47
47
  "husky": "^4.3.8",
48
48
  "jest": "^27.5.1",
49
49
  "npm-run-all": "^4.1.5",