hotypes 0.4.3 → 0.4.6

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
@@ -41,6 +41,7 @@ It is highly recommended to read test cases to make sure you understand what typ
41
41
  - Last
42
42
  - MapNullablePropsToOptionalNullable
43
43
  - MapNullablePropsToOptional
44
+ - MapProps
44
45
  - MapPropsByKeyToNonOptional
45
46
  - MapPropsByKeyToOptional
46
47
  - MapPropsByKey
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './keys-extend-type';
8
8
  export * from './last';
9
9
  export * from './map-nullable-props-to-optional-nullable';
10
10
  export * from './map-nullable-props-to-optional';
11
+ export * from './map-props';
11
12
  export * from './map-props-by-key-to-non-optional';
12
13
  export * from './map-props-by-key';
13
14
  export * from './map-props-by-type';
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -20,6 +24,7 @@ __exportStar(require("./keys-extend-type"), exports);
20
24
  __exportStar(require("./last"), exports);
21
25
  __exportStar(require("./map-nullable-props-to-optional-nullable"), exports);
22
26
  __exportStar(require("./map-nullable-props-to-optional"), exports);
27
+ __exportStar(require("./map-props"), exports);
23
28
  __exportStar(require("./map-props-by-key-to-non-optional"), exports);
24
29
  __exportStar(require("./map-props-by-key"), exports);
25
30
  __exportStar(require("./map-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,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,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,3 @@
1
+ export declare type MapProps<T, NewType> = {
2
+ [Key in keyof T]: NewType;
3
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=map-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-props.js","sourceRoot":"","sources":["../src/map-props.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotypes",
3
- "version": "0.4.3",
3
+ "version": "0.4.6",
4
4
  "description": "Higher order types for TypeScript",
5
5
  "keywords": [
6
6
  "higher-order",
@@ -16,6 +16,7 @@
16
16
  "repository": "git@github.com:BlackGlory/hotypes.git",
17
17
  "author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
18
18
  "license": "MIT",
19
+ "sideEffects": false,
19
20
  "scripts": {
20
21
  "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src __tests__",
21
22
  "test": "jest --config jest.config.js",
@@ -36,21 +37,21 @@
36
37
  }
37
38
  },
38
39
  "devDependencies": {
39
- "@commitlint/cli": "^15.0.0",
40
- "@commitlint/config-conventional": "^15.0.0",
41
- "@types/jest": "^27.0.2",
42
- "@typescript-eslint/eslint-plugin": "^5.4.0",
43
- "@typescript-eslint/parser": "^5.4.0",
44
- "eslint": "^8.2.0",
40
+ "@blackglory/pass": "^1.0.1",
41
+ "@commitlint/cli": "^17.0.3",
42
+ "@commitlint/config-conventional": "^17.0.3",
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",
45
47
  "husky": "^4.3.8",
46
- "jest": "^27.3.1",
48
+ "jest": "^27.5.1",
47
49
  "npm-run-all": "^4.1.5",
48
50
  "rimraf": "^3.0.2",
49
- "standard-version": "^9.3.2",
50
- "ts-jest": "^27.0.7",
51
+ "standard-version": "^9.5.0",
52
+ "ts-jest": "^27.1.3",
51
53
  "tscpaths": "^0.0.9",
52
- "tsd": "^0.18.0",
53
- "tslib": "^2.3.1",
54
- "typescript": "^4.5.2"
54
+ "tslib": "^2.4.0",
55
+ "typescript": "^4.7.4"
55
56
  }
56
57
  }
package/CHANGELOG.md DELETED
@@ -1,212 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [0.4.3](https://github.com/BlackGlory/hotypes/compare/v0.4.2...v0.4.3) (2021-11-18)
6
-
7
-
8
- ### Features
9
-
10
- * improve KeysExtendType ([89bfbcd](https://github.com/BlackGlory/hotypes/commit/89bfbcdaec3208271e7d7114d1f954fdf49ef3f1))
11
-
12
- ### [0.4.2](https://github.com/BlackGlory/hotypes/compare/v0.4.1...v0.4.2) (2021-08-10)
13
-
14
-
15
- ### Features
16
-
17
- * add Mixin ([324a979](https://github.com/BlackGlory/hotypes/commit/324a979004a08cd1cd31756faf0e775d48994346))
18
-
19
- ### [0.4.1](https://github.com/BlackGlory/hotypes/compare/v0.4.0...v0.4.1) (2021-08-10)
20
-
21
-
22
- ### Features
23
-
24
- * add MapPropsByKey, ReplacePropsByKey ([9ae1466](https://github.com/BlackGlory/hotypes/commit/9ae1466ddf9342754390cf2bb862cf126ff552f0))
25
-
26
- ## [0.4.0](https://github.com/BlackGlory/hotypes/compare/v0.3.3...v0.4.0) (2021-07-03)
27
-
28
-
29
- ### ⚠ BREAKING CHANGES
30
-
31
- * move a batch of types to justypes
32
-
33
- ### Features
34
-
35
- * move a batch of types to justypes ([c1e5c68](https://github.com/BlackGlory/hotypes/commit/c1e5c688cc092ed2edc9123c5aa86a14bb5e4249))
36
-
37
- ### [0.3.3](https://github.com/BlackGlory/hotypes/compare/v0.3.2...v0.3.3) (2021-06-25)
38
-
39
-
40
- ### Features
41
-
42
- * add OmitPropsByType, OmitPropsExtendType ([2fa95f5](https://github.com/BlackGlory/hotypes/commit/2fa95f577fa87d5f7f8222fbcb31a8d4352dcfdf))
43
-
44
- ### [0.3.2](https://github.com/BlackGlory/hotypes/compare/v0.3.1...v0.3.2) (2021-06-22)
45
-
46
-
47
- ### Features
48
-
49
- * add MapNullablePropsToOptionalNullable ([0d052a1](https://github.com/BlackGlory/hotypes/commit/0d052a1a5d0ca00e192fdd816db86b01f2745988))
50
-
51
- ### [0.3.1](https://github.com/BlackGlory/hotypes/compare/v0.3.0...v0.3.1) (2021-06-22)
52
-
53
- ## [0.3.0](https://github.com/BlackGlory/hotypes/compare/v0.2.3...v0.3.0) (2021-06-22)
54
-
55
-
56
- ### ⚠ BREAKING CHANGES
57
-
58
- * rename MapPropsExtendTypeToOptional to MapPropsByKeyToOptional
59
-
60
- * rename MapPropsExtendTypeToOptional to MapPropsByKeyToOptional ([f08998c](https://github.com/BlackGlory/hotypes/commit/f08998ccaf3300b5f5b30999b8a48ad0ffeef75f))
61
-
62
- ### [0.2.3](https://github.com/BlackGlory/hotypes/compare/v0.2.2...v0.2.3) (2021-06-20)
63
-
64
-
65
- ### Features
66
-
67
- * add ReplacePropsByType ([adaa1ad](https://github.com/BlackGlory/hotypes/commit/adaa1addee71bf2c22103b2eb7733d3b55b9fbb3))
68
- * add ReplaceType ([34ce004](https://github.com/BlackGlory/hotypes/commit/34ce004da7c91572bdea4457abad7b6a590879c0))
69
-
70
- ### [0.2.2](https://github.com/BlackGlory/hotypes/compare/v0.2.1...v0.2.2) (2021-05-22)
71
-
72
-
73
- ### Bug Fixes
74
-
75
- * script ([aad2e72](https://github.com/BlackGlory/hotypes/commit/aad2e72df701ac1860800a15af1d3a72c4627d8c))
76
-
77
- ### [0.2.1](https://github.com/BlackGlory/hotypes/compare/v0.2.0...v0.2.1) (2021-05-16)
78
-
79
-
80
- ### Features
81
-
82
- * add UnpackedAsyncIterable, UnpackedIterable ([5c6da42](https://github.com/BlackGlory/hotypes/commit/5c6da42daeaf2bea85430828122872b8180036e0))
83
-
84
- ## [0.2.0](https://github.com/BlackGlory/hotypes/compare/v0.1.9...v0.2.0) (2021-05-07)
85
-
86
-
87
- ### ⚠ BREAKING CHANGES
88
-
89
- * rename RequiredKeys => MapPropsByKeyToNonOptional
90
- * rename MapNullablePropsToOptionalProps => MapNullablePropsToOptional
91
- * rename MapPropsExtendTypeToPartial => MapPropsExtendTypeToOptional
92
- * rename PartialKeys => MapPropsExtendTypeToPartial
93
- * rename ConstructorReturnType => ReturnTypeOfConstructor
94
- * rename ExcludeKeysExtendType => KeysExcludeExtendType
95
- * rename ExcludeKeysByType => KeysExcludeByType
96
- * rename GetKeysExtendType => KeysExtendType
97
- * rename GetKeysByType => KeysByType
98
- * rename GetFunctionKeys => FunctionKeys
99
- * rename MapProps => MapPropsExtendType
100
- * rename MapPropsStrict => MapPropsByType
101
- * rename MapNullablePropsToNonNullableProps => MapPropsToNonNullable
102
- * rename Keys => GetKeysExtendType
103
- * rename FunctionKeys => GetFunctionKeys
104
- * rename ExcludeNullable => NonNullable
105
- * rename ExcludeKeys => ExcludeKeysExtendType
106
- * rename ExcludeKeysStrict => ExcludeKeysByType
107
- * rename KeysStrict => GetKeysByType
108
-
109
- ### Bug Fixes
110
-
111
- * filenames ([b594e15](https://github.com/BlackGlory/hotypes/commit/b594e159094a0558749b41dc5737a2bd6652a9c6))
112
- * type MapNullablePropsToOptional ([fffdbd8](https://github.com/BlackGlory/hotypes/commit/fffdbd8e52191a5bc9943a09c74fa18f6cca67ce))
113
- * type OptinalKeys ([9c36904](https://github.com/BlackGlory/hotypes/commit/9c36904fe1226386f5a5e7b9a5bed7c75eecb685))
114
-
115
-
116
- * rename ConstructorReturnType => ReturnTypeOfConstructor ([00336b1](https://github.com/BlackGlory/hotypes/commit/00336b1dcd433a7933940060ae01f2428f47ea53))
117
- * rename ExcludeKeys => ExcludeKeysExtendType ([2e1bb5f](https://github.com/BlackGlory/hotypes/commit/2e1bb5f5464dd113161d191e5372ade393e337b3))
118
- * rename ExcludeKeysByType => KeysExcludeByType ([94fb347](https://github.com/BlackGlory/hotypes/commit/94fb347617ebd5aead336df3682399447ab68ca1))
119
- * rename ExcludeKeysExtendType => KeysExcludeExtendType ([3ece321](https://github.com/BlackGlory/hotypes/commit/3ece32156a506ee4fe35d5c862d7021f89627339))
120
- * rename ExcludeKeysStrict => ExcludeKeysByType ([4a34407](https://github.com/BlackGlory/hotypes/commit/4a3440759c7ffff9939d207fe30a54f5cf19c2ac))
121
- * rename ExcludeNullable => NonNullable ([cfb3b7c](https://github.com/BlackGlory/hotypes/commit/cfb3b7cd7817539dc9280c98b4db04c5dacf86f9))
122
- * rename FunctionKeys => GetFunctionKeys ([4798f98](https://github.com/BlackGlory/hotypes/commit/4798f9849a87f06e0002fe2b74ca128f3d7d6504))
123
- * rename GetFunctionKeys => FunctionKeys ([eedca79](https://github.com/BlackGlory/hotypes/commit/eedca798fff2997d83a4cfd0610c5707f883ea87))
124
- * rename GetKeysByType => KeysByType ([a4d37eb](https://github.com/BlackGlory/hotypes/commit/a4d37eb6f45447954dbe217db9ef487051cf1c57))
125
- * rename GetKeysExtendType => KeysExtendType ([41e277e](https://github.com/BlackGlory/hotypes/commit/41e277eb0b2d740dff0cc84195f1be93c0ff9631))
126
- * rename Keys => GetKeysExtendType ([f7c93ee](https://github.com/BlackGlory/hotypes/commit/f7c93eeafec7efa60f8922692b75934e69662c95))
127
- * rename KeysStrict => GetKeysByType ([6101a08](https://github.com/BlackGlory/hotypes/commit/6101a08a17abb253f2ebaae4cf54712fdf04a627))
128
- * rename MapNullablePropsToNonNullableProps => MapPropsToNonNullable ([e371106](https://github.com/BlackGlory/hotypes/commit/e371106ef2f9927516950a3d07d8fabcb2252da1))
129
- * rename MapNullablePropsToOptionalProps => MapNullablePropsToOptional ([5658780](https://github.com/BlackGlory/hotypes/commit/5658780084d08c16ff466095f65500efc13f0150))
130
- * rename MapProps => MapPropsExtendType ([b55a062](https://github.com/BlackGlory/hotypes/commit/b55a062682df5fd555af1fb636a4e86717206105))
131
- * rename MapPropsExtendTypeToPartial => MapPropsExtendTypeToOptional ([c1aa1c1](https://github.com/BlackGlory/hotypes/commit/c1aa1c1223a3ddef924b57c165b977d7bf3a85e1))
132
- * rename MapPropsStrict => MapPropsByType ([c38c31b](https://github.com/BlackGlory/hotypes/commit/c38c31ba7230c67fa57c36be0d89accdf4e7555d))
133
- * rename PartialKeys => MapPropsExtendTypeToPartial ([7b66e82](https://github.com/BlackGlory/hotypes/commit/7b66e8252bd98b01b28ac04f849112c01f13796f))
134
- * rename RequiredKeys => MapPropsByKeyToNonOptional ([9098cf8](https://github.com/BlackGlory/hotypes/commit/9098cf89fb0687d90c4aae59ca86f33b02f6c86d))
135
-
136
- ### [0.1.9](https://github.com/BlackGlory/hotypes/compare/v0.1.8...v0.1.9) (2021-04-25)
137
-
138
-
139
- ### Features
140
-
141
- * add RequiredKeys ([f838f43](https://github.com/BlackGlory/hotypes/commit/f838f43c918ff2a36dcad7b378f2862bab253ca8))
142
-
143
- ### [0.1.8](https://github.com/BlackGlory/hotypes/compare/v0.1.7...v0.1.8) (2021-04-25)
144
-
145
-
146
- ### Features
147
-
148
- * improve PartialKeys ([7c727c5](https://github.com/BlackGlory/hotypes/commit/7c727c550ca7210f28c8be95367a5f2eb5006084))
149
-
150
- ### [0.1.7](https://github.com/BlackGlory/hotypes/compare/v0.1.6...v0.1.7) (2021-04-25)
151
-
152
-
153
- ### Features
154
-
155
- * improve PartialKeys ([ef60fd2](https://github.com/BlackGlory/hotypes/commit/ef60fd2dbaf87a564b28dc5d101918fbb58364d9))
156
-
157
- ### [0.1.6](https://github.com/BlackGlory/hotypes/compare/v0.1.5...v0.1.6) (2021-04-25)
158
-
159
-
160
- ### Features
161
-
162
- * add PartialKeys ([a8deda3](https://github.com/BlackGlory/hotypes/commit/a8deda36bb58fc14ee1cb4f5e1ae90962005ec71))
163
-
164
- ### [0.1.5](https://github.com/BlackGlory/hotypes/compare/v0.1.4...v0.1.5) (2021-04-20)
165
-
166
-
167
- ### Features
168
-
169
- * add Dictionary ([da93343](https://github.com/BlackGlory/hotypes/commit/da9334331ad13848e18e789356838f0ff602b807))
170
-
171
- ### [0.1.4](https://github.com/BlackGlory/hotypes/compare/v0.1.3...v0.1.4) (2021-03-17)
172
-
173
-
174
- ### Bug Fixes
175
-
176
- * fix FunctionKeys ([ecb2c84](https://github.com/BlackGlory/hotypes/commit/ecb2c842b733176b055090bc4a75fddacf2c833f))
177
-
178
- ### [0.1.3](https://github.com/BlackGlory/hotypes/compare/v0.1.2...v0.1.3) (2021-03-17)
179
-
180
-
181
- ### Features
182
-
183
- * add WithDefault ([af164a3](https://github.com/BlackGlory/hotypes/commit/af164a36155ad4d1b28d8877447b8656b8837e40))
184
-
185
- ### [0.1.2](https://github.com/BlackGlory/hotypes/compare/v0.1.1...v0.1.2) (2021-03-17)
186
-
187
-
188
- ### Bug Fixes
189
-
190
- * entry ([a1bd948](https://github.com/BlackGlory/hotypes/commit/a1bd9487205e509b0c7edd7cd000d3b8aabdc159))
191
-
192
- ### [0.1.1](https://github.com/BlackGlory/hotypes/compare/v0.1.0...v0.1.1) (2021-03-17)
193
-
194
-
195
- ### Bug Fixes
196
-
197
- * build ([bc62f15](https://github.com/BlackGlory/hotypes/commit/bc62f1555bfdf7e50b055f2efaaf00cdcf320ba9))
198
-
199
- ## 0.1.0 (2021-03-17)
200
-
201
-
202
- ### ⚠ BREAKING CHANGES
203
-
204
- * remove Json
205
-
206
- ### Features
207
-
208
- * add Last ([4407fb1](https://github.com/BlackGlory/hotypes/commit/4407fb129271419730cb433f2b41770c5b023191))
209
- * add Tail ([757820d](https://github.com/BlackGlory/hotypes/commit/757820d3ec161b6b3f03c4524679344cb0086422))
210
- * init ([197af85](https://github.com/BlackGlory/hotypes/commit/197af85eb8872af8cab36607695c5694e0921216))
211
- * move Json to justypes ([7f408b5](https://github.com/BlackGlory/hotypes/commit/7f408b5766d588c7d7cb57c2d392df4c8831bd69))
212
- * rename First to Head ([dee1531](https://github.com/BlackGlory/hotypes/commit/dee1531036734b39bc4d897a7fcbb46d8d91c3a2))