@alessiofrittoli/type-utils 1.5.0 → 1.6.0
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 +89 -47
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +23 -11
- package/scripts/publish.js +0 -2
package/README.md
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
1
|
# Type Utils ❇️
|
|
2
2
|
|
|
3
|
-
Version
|
|
3
|
+
[![NPM Latest Version][version-badge]][npm-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
|
|
4
|
+
|
|
5
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
6
|
+
|
|
7
|
+
[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Ftype-utils
|
|
8
|
+
[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Ftype-utils
|
|
9
|
+
[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Ftype-utils.svg
|
|
10
|
+
[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Ftype-utils
|
|
11
|
+
[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Ftype-utils
|
|
12
|
+
|
|
13
|
+
[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2
|
|
14
|
+
[sponsor-url]: https://github.com/sponsors/alessiofrittoli
|
|
4
15
|
|
|
5
16
|
## Lightweight TypeScript types utilities
|
|
6
17
|
|
|
7
18
|
### Table of Contents
|
|
8
19
|
|
|
9
|
-
- [Getting started](#
|
|
20
|
+
- [Getting started](#getting-started)
|
|
10
21
|
- [Utility types](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
- [ValueOf](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueof)
|
|
23
|
+
- [ValueOfKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueofkey)
|
|
24
|
+
- [OptionalKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#optionalkey)
|
|
25
|
+
- [Writeable](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#writeable)
|
|
26
|
+
- [RenameKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#renamekey)
|
|
27
|
+
- [ArgumentTypes](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#argumenttypes)
|
|
17
28
|
- [Extenders types](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- [
|
|
29
|
+
- [JSON](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#json)
|
|
30
|
+
- [JSON.stringify\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonstringifyt)
|
|
31
|
+
- [JSON.parse\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonparset)
|
|
32
|
+
- [Body](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#body)
|
|
33
|
+
- [Body.json\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#bodyjsont)
|
|
34
|
+
- [Development](#development)
|
|
35
|
+
- [Install depenendencies](#install-depenendencies)
|
|
36
|
+
- [Build the source code](#build-the-source-code)
|
|
37
|
+
- [ESLint](#eslint)
|
|
38
|
+
- [Contributing](#contributing)
|
|
24
39
|
- [Security](#security)
|
|
25
40
|
- [Credits](#made-with-)
|
|
26
41
|
|
|
@@ -48,10 +63,10 @@ If that fail, please, make sure to add `alessiofrittoli-env.d.ts` in the array o
|
|
|
48
63
|
|
|
49
64
|
```json
|
|
50
65
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
"compilerOptions": {
|
|
67
|
+
...
|
|
68
|
+
},
|
|
69
|
+
"include": [ ..., "alessiofrittoli-env.d.ts" ],
|
|
55
70
|
}
|
|
56
71
|
```
|
|
57
72
|
|
|
@@ -65,7 +80,29 @@ node node_modules/@alessiofrittoli/type-utils/scripts/postinstall/index.js
|
|
|
65
80
|
|
|
66
81
|
---
|
|
67
82
|
|
|
68
|
-
###
|
|
83
|
+
### Development
|
|
84
|
+
|
|
85
|
+
#### Install depenendencies
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
or using `pnpm`
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm i
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### Build the source code
|
|
98
|
+
|
|
99
|
+
Run the following command to test and build code for distribution.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pnpm build
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### [ESLint](https://www.npmjs.com/package/eslint)
|
|
69
106
|
|
|
70
107
|
warnings / errors check.
|
|
71
108
|
|
|
@@ -77,9 +114,14 @@ pnpm lint
|
|
|
77
114
|
|
|
78
115
|
### Contributing
|
|
79
116
|
|
|
80
|
-
Contributions are truly welcome
|
|
117
|
+
Contributions are truly welcome!
|
|
118
|
+
|
|
81
119
|
Please refer to the [Contributing Doc](./CONTRIBUTING.md) for more information on how to start contributing to this project.
|
|
82
120
|
|
|
121
|
+
Help keep this project up to date with [GitHub Sponsor][sponsor-url].
|
|
122
|
+
|
|
123
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
124
|
+
|
|
83
125
|
---
|
|
84
126
|
|
|
85
127
|
### Security
|
|
@@ -89,30 +131,30 @@ If you believe you have found a security vulnerability, we encourage you to **_r
|
|
|
89
131
|
### Made with ☕
|
|
90
132
|
|
|
91
133
|
<table style='display:flex;gap:20px;'>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</table>
|
|
134
|
+
<tbody>
|
|
135
|
+
<tr>
|
|
136
|
+
<td>
|
|
137
|
+
<img alt="avatar" src='https://avatars.githubusercontent.com/u/35973186' style='width:60px;border-radius:50%;object-fit:contain;'>
|
|
138
|
+
</td>
|
|
139
|
+
<td>
|
|
140
|
+
<table style='display:flex;gap:2px;flex-direction:column;'>
|
|
141
|
+
<tbody>
|
|
142
|
+
<tr>
|
|
143
|
+
<td>
|
|
144
|
+
<a href='https://github.com/alessiofrittoli' target='_blank' rel='noopener'>Alessio Frittoli</a>
|
|
145
|
+
</td>
|
|
146
|
+
</tr>
|
|
147
|
+
<tr>
|
|
148
|
+
<td>
|
|
149
|
+
<small>
|
|
150
|
+
<a href='https://alessiofrittoli.it' target='_blank' rel='noopener'>https://alessiofrittoli.it</a> |
|
|
151
|
+
<a href='mailto:info@alessiofrittoli.it' target='_blank' rel='noopener'>info@alessiofrittoli.it</a>
|
|
152
|
+
</small>
|
|
153
|
+
</td>
|
|
154
|
+
</tr>
|
|
155
|
+
</tbody>
|
|
156
|
+
</table>
|
|
157
|
+
</td>
|
|
158
|
+
</tr>
|
|
159
|
+
</tbody>
|
|
160
|
+
</table>
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
'use strict'
|
|
1
|
+
'use strict';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/type-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Lightweight TypeScript types utilities",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alessio Frittoli",
|
|
@@ -8,8 +8,15 @@
|
|
|
8
8
|
"url": "https://alessiofrittoli.it"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"funding": [
|
|
12
|
+
{
|
|
13
|
+
"type": "github",
|
|
14
|
+
"url": "https://github.com/sponsors/alessiofrittoli"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
11
17
|
"keywords": [
|
|
12
|
-
"typescript"
|
|
18
|
+
"typescript",
|
|
19
|
+
"type-utils"
|
|
13
20
|
],
|
|
14
21
|
"homepage": "https://github.com/alessiofrittoli/type-utils#readme",
|
|
15
22
|
"bugs": {
|
|
@@ -25,7 +32,7 @@
|
|
|
25
32
|
"types": "./dist/index.d.ts",
|
|
26
33
|
"files": [
|
|
27
34
|
"dist",
|
|
28
|
-
"scripts"
|
|
35
|
+
"scripts/postinstall"
|
|
29
36
|
],
|
|
30
37
|
"scripts": {
|
|
31
38
|
"build": "pnpm lint && tsup",
|
|
@@ -35,16 +42,21 @@
|
|
|
35
42
|
"postinstall": "node scripts/postinstall/index.js"
|
|
36
43
|
},
|
|
37
44
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "^9.
|
|
39
|
-
"@types/node": "^22.10
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"globals": "^
|
|
42
|
-
"tsup": "^8.
|
|
43
|
-
"typescript": "^5.
|
|
44
|
-
"typescript-eslint": "^8.
|
|
45
|
+
"@eslint/js": "^9.22.0",
|
|
46
|
+
"@types/node": "^22.13.10",
|
|
47
|
+
"eslint": "^9.22.0",
|
|
48
|
+
"globals": "^16.0.0",
|
|
49
|
+
"tsup": "^8.4.0",
|
|
50
|
+
"typescript": "^5.8.2",
|
|
51
|
+
"typescript-eslint": "^8.26.1"
|
|
45
52
|
},
|
|
46
53
|
"dependencies": {
|
|
47
54
|
"@alessiofrittoli/chain-functions": "^2.0.0",
|
|
48
|
-
"@alessiofrittoli/node-scripts": "2.
|
|
55
|
+
"@alessiofrittoli/node-scripts": "2.3.0"
|
|
56
|
+
},
|
|
57
|
+
"pnpm": {
|
|
58
|
+
"onlyBuiltDependencies": [
|
|
59
|
+
"esbuild"
|
|
60
|
+
]
|
|
49
61
|
}
|
|
50
62
|
}
|
package/scripts/publish.js
DELETED