hotypes 0.6.4 → 0.6.5

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
@@ -57,5 +57,7 @@ yarn add hotypes
57
57
  - UnpackedAsyncIterable
58
58
  - UnpackedPromise
59
59
  - UnpackedPromiseLike
60
+ - ToStruct
61
+ - Prettify
60
62
 
61
63
  *The `Unpacked` prefix comes from [this official article](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#type-inference-in-conditional-types)*
package/lib/index.d.ts CHANGED
@@ -41,3 +41,5 @@ export * from './unpacked-iterable';
41
41
  export * from './unpacked-async-iterable';
42
42
  export * from './unpacked-promise-like';
43
43
  export * from './unpacked-promise';
44
+ export * from './to-struct';
45
+ export * from './prettify';
package/lib/index.js CHANGED
@@ -57,4 +57,6 @@ __exportStar(require("./unpacked-iterable"), exports);
57
57
  __exportStar(require("./unpacked-async-iterable"), exports);
58
58
  __exportStar(require("./unpacked-promise-like"), exports);
59
59
  __exportStar(require("./unpacked-promise"), exports);
60
+ __exportStar(require("./to-struct"), exports);
61
+ __exportStar(require("./prettify"), exports);
60
62
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,iDAA8B;AAC9B,4CAAyB;AACzB,kDAA+B;AAC/B,yCAAsB;AACtB,iDAA8B;AAC9B,uDAAoC;AACpC,yDAAsC;AACtC,+DAA4C;AAC5C,yCAAsB;AACtB,kDAA+B;AAC/B,qDAAkC;AAClC,sDAAmC;AACnC,4DAAyC;AACzC,4EAAyD;AACzD,mEAAgD;AAChD,iEAA8C;AAC9C,iEAA8C;AAC9C,8DAA2C;AAC3C,0CAAuB;AACvB,8CAA2B;AAC3B,sDAAmC;AACnC,kDAA+B;AAC/B,uDAAoC;AACpC,6DAA0C;AAC1C,kDAA+B;AAC/B,mDAAgC;AAChC,wCAAqB;AACrB,iDAA8B;AAC9B,4CAAyB;AACzB,yDAAsC;AACtC,0DAAuC;AACvC,yCAAsB;AACtB,iDAA8B;AAC9B,iDAA8B;AAC9B,+DAA4C;AAC5C,8DAA2C;AAC3C,mDAAgC;AAChC,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,0DAAuC;AACvC,qDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,iDAA8B;AAC9B,4CAAyB;AACzB,kDAA+B;AAC/B,yCAAsB;AACtB,iDAA8B;AAC9B,uDAAoC;AACpC,yDAAsC;AACtC,+DAA4C;AAC5C,yCAAsB;AACtB,kDAA+B;AAC/B,qDAAkC;AAClC,sDAAmC;AACnC,4DAAyC;AACzC,4EAAyD;AACzD,mEAAgD;AAChD,iEAA8C;AAC9C,iEAA8C;AAC9C,8DAA2C;AAC3C,0CAAuB;AACvB,8CAA2B;AAC3B,sDAAmC;AACnC,kDAA+B;AAC/B,uDAAoC;AACpC,6DAA0C;AAC1C,kDAA+B;AAC/B,mDAAgC;AAChC,wCAAqB;AACrB,iDAA8B;AAC9B,4CAAyB;AACzB,yDAAsC;AACtC,0DAAuC;AACvC,yCAAsB;AACtB,iDAA8B;AAC9B,iDAA8B;AAC9B,+DAA4C;AAC5C,8DAA2C;AAC3C,mDAAgC;AAChC,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,0DAAuC;AACvC,qDAAkC;AAClC,8CAA2B;AAC3B,6CAA0B"}
@@ -0,0 +1,3 @@
1
+ export declare type Prettify<T> = T extends Function ? T : {
2
+ [Key in keyof T]: T[Key];
3
+ } & {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=prettify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prettify.js","sourceRoot":"","sources":["../src/prettify.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare type ToStruct<T> = T extends Function ? T : {
2
+ [Key in keyof T]: ToStruct<T[Key]>;
3
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=to-struct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-struct.js","sourceRoot":"","sources":["../src/to-struct.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotypes",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Higher order types for TypeScript",
5
5
  "keywords": [
6
6
  "higher-order",
@@ -20,9 +20,7 @@
20
20
  "sideEffects": false,
21
21
  "scripts": {
22
22
  "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src __tests__",
23
- "test": "jest --config jest.config.js",
24
- "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
25
- "test:coverage": "jest --coverage --config jest.config.js",
23
+ "test": "tsc --noEmit && jest --config jest.config.js",
26
24
  "prepublishOnly": "run-s clean build",
27
25
  "clean": "run-p clean:*",
28
26
  "clean:build": "rimraf lib",
package/src/index.ts CHANGED
@@ -41,3 +41,5 @@ export * from './unpacked-iterable'
41
41
  export * from './unpacked-async-iterable'
42
42
  export * from './unpacked-promise-like'
43
43
  export * from './unpacked-promise'
44
+ export * from './to-struct'
45
+ export * from './prettify'
@@ -0,0 +1,6 @@
1
+ export type Prettify<T> =
2
+ T extends Function
3
+ ? T
4
+ : {
5
+ [Key in keyof T]: T[Key]
6
+ } & {}
@@ -0,0 +1,6 @@
1
+ export type ToStruct<T> =
2
+ T extends Function
3
+ ? T
4
+ : {
5
+ [Key in keyof T]: ToStruct<T[Key]>
6
+ }