@alessiofrittoli/type-utils 1.4.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 CHANGED
@@ -1,26 +1,41 @@
1
1
  # Type Utils ❇️
2
2
 
3
- Version 1.4.0
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](#gettingstarted)
20
+ - [Getting started](#getting-started)
10
21
  - [Utility types](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md)
11
- - [ValueOf](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueof)
12
- - [ValueOfKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueofkey)
13
- - [OptionalKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#optionalkey)
14
- - [Writeable](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#writeable)
15
- - [RenameKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#renamekey)
16
- - [ArgumentTypes](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#argumenttypes)
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
- - [JSON](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#json)
19
- - [JSON.stringify\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonstringifyt)
20
- - [JSON.parse\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonparset)
21
- - [Body](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#body)
22
- - [Body.json\<T\>()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#bodyjsont)
23
- - [ESLint](#eslint)
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
- "compilerOptions": {
52
- ...
53
- },
54
- "include": [ ..., "alessiofrittoli-env.d.ts" ],
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
- ### [ESLint](https://www.npmjs.com/package/eslint)
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
- <tbody>
93
- <tr>
94
- <td>
95
- <img src='https://avatars.githubusercontent.com/u/35973186' style='width:60px;border-radius:50%;object-fit:contain;'>
96
- </td>
97
- <td>
98
- <table style='display:flex;gap:2px;flex-direction:column;'>
99
- <tbody>
100
- <tr>
101
- <td>
102
- <a href='https://github.com/alessiofrittoli' target='_blank' rel='noopener'>Alessio Frittoli</a>
103
- </td>
104
- </tr>
105
- <tr>
106
- <td>
107
- <small>
108
- <a href='https://alessiofrittoli.it' target='_blank' rel='noopener'>https://alessiofrittoli.it</a> |
109
- <a href='mailto:info@alessiofrittoli.it' target='_blank' rel='noopener'>info@alessiofrittoli.it</a>
110
- </small>
111
- </td>
112
- </tr>
113
- </tbody>
114
- </table>
115
- </td>
116
- </tr>
117
- </tbody>
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,2 @@
1
+ //# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
package/package.json CHANGED
@@ -1,49 +1,62 @@
1
1
  {
2
- "name": "@alessiofrittoli/type-utils",
3
- "version": "1.4.0",
4
- "description": "Lightweight TypeScript types utilities",
5
- "author": {
6
- "name": "Alessio Frittoli",
7
- "email": "info@alessiofrittoli.it",
8
- "url": "https://alessiofrittoli.it"
9
- },
10
- "license": "MIT",
11
- "keywords": [
12
- "typescript"
13
- ],
14
- "homepage": "https://github.com/alessiofrittoli/type-utils#readme",
15
- "bugs": {
16
- "url": "https://github.com/alessiofrittoli/type-utils/issues",
17
- "email": "info@alessiofrittoli.it"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/alessiofrittoli/type-utils.git"
22
- },
23
- "main": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
- "files": [
26
- "dist",
27
- "scripts"
28
- ],
29
- "devDependencies": {
30
- "@eslint/js": "^9.17.0",
31
- "@types/node": "^22.10.2",
32
- "eslint": "^9.17.0",
33
- "globals": "^15.14.0",
34
- "tsup": "^8.3.5",
35
- "typescript": "^5.7.2",
36
- "typescript-eslint": "^8.18.2"
37
- },
38
- "dependencies": {
39
- "@alessiofrittoli/chain-functions": "^2.0.0",
40
- "@alessiofrittoli/node-scripts": "2.1.0"
41
- },
42
- "scripts": {
43
- "build": "pnpm lint && tsup",
44
- "build:watch": "tsup --watch",
45
- "lint": "eslint",
46
- "release": "node scripts/publish.js --verbose --npm",
47
- "postinstall": "node scripts/postinstall/index.js"
48
- }
2
+ "name": "@alessiofrittoli/type-utils",
3
+ "version": "1.6.0",
4
+ "description": "Lightweight TypeScript types utilities",
5
+ "author": {
6
+ "name": "Alessio Frittoli",
7
+ "email": "info@alessiofrittoli.it",
8
+ "url": "https://alessiofrittoli.it"
9
+ },
10
+ "license": "MIT",
11
+ "funding": [
12
+ {
13
+ "type": "github",
14
+ "url": "https://github.com/sponsors/alessiofrittoli"
15
+ }
16
+ ],
17
+ "keywords": [
18
+ "typescript",
19
+ "type-utils"
20
+ ],
21
+ "homepage": "https://github.com/alessiofrittoli/type-utils#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/alessiofrittoli/type-utils/issues",
24
+ "email": "info@alessiofrittoli.it"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/alessiofrittoli/type-utils.git"
29
+ },
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "dist",
35
+ "scripts/postinstall"
36
+ ],
37
+ "scripts": {
38
+ "build": "pnpm lint && tsup",
39
+ "build:watch": "tsup --watch",
40
+ "lint": "eslint",
41
+ "release": "node scripts/publish.js --verbose --npm",
42
+ "postinstall": "node scripts/postinstall/index.js"
43
+ },
44
+ "devDependencies": {
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"
52
+ },
53
+ "dependencies": {
54
+ "@alessiofrittoli/chain-functions": "^2.0.0",
55
+ "@alessiofrittoli/node-scripts": "2.3.0"
56
+ },
57
+ "pnpm": {
58
+ "onlyBuiltDependencies": [
59
+ "esbuild"
60
+ ]
61
+ }
49
62
  }
@@ -1,14 +1,16 @@
1
1
  const { Chain } = require( '@alessiofrittoli/chain-functions' )
2
2
  const tsSetup = require( './ts-setup.js' )
3
+ const project = require( '../../package.json' )
3
4
 
4
5
  /** @type {import( '@alessiofrittoli/chain-functions/types' ).LastChainLink<() => void | Promise<void>>} */
5
6
  const lastChainLink = () => () => {
6
- console.log( 'Post-install done.' )
7
+ console.log( {
8
+ package: project.name,
9
+ message: 'Post-Install done'
10
+ } )
7
11
  }
8
12
 
9
13
  /** @type {import( '@alessiofrittoli/chain-functions/types' ).ChainFactory<() => void | Promise<void>>} */
10
14
  const chain = [ tsSetup, lastChainLink ]
11
15
 
12
- ;( async () => {
13
- await Chain.functions( chain )()
14
- } )()
16
+ Chain.functions( chain )()
@@ -1,2 +0,0 @@
1
- require( '@alessiofrittoli/node-scripts/publish' )
2
- .publish()