ts-gems 3.11.5 → 3.12.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/lib/dto.d.ts CHANGED
@@ -4,22 +4,22 @@ import { DeeperPartial } from './partial.js';
4
4
  import { IfNever } from './type-check.js';
5
5
 
6
6
  /**
7
- * Returns given type as a Data Transfer Object (DTO) interface, Removes symbol keys and function properties.
7
+ * Returns the given type as a Data Transfer Object (DTO) interface, Removes symbol keys and function properties.
8
8
  * @template T - The type of the data being transferred.
9
9
  */
10
- export type DTO<T> = {
10
+ export type DTO<T, X = never> = {
11
11
  [K in keyof T as IfNever<
12
- Exclude<NonNullable<T[K]>, Function>,
12
+ Exclude<NonNullable<T[K]>, Function | symbol>,
13
13
  never,
14
14
  K
15
15
  >]: NonNullable<T[K]> extends (infer U)[] // Deep process arrays
16
16
  ? DTO<U>[]
17
17
  : // Do not deep process No-Deep values
18
18
  IfNoDeepValue<NonNullable<T[K]>> extends true
19
- ? NonNullable<T[K]>
19
+ ? NonNullable<T[K] | X>
20
20
  : // Deep process objects
21
- DTO<NonNullable<T[K]>>;
21
+ DTO<NonNullable<T[K] | X>>;
22
22
  };
23
23
 
24
- export type PartialDTO<T> = DeeperPartial<DTO<T>>;
25
- export type PatchDTO<T> = DeeperNullish<DTO<T>>;
24
+ export type PartialDTO<T, X = never> = DeeperPartial<DTO<T, X>>;
25
+ export type PatchDTO<T, X = never> = DeeperNullish<DTO<T, X>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ts-gems",
3
3
  "description": "Valuable typing extensions for TypeScript",
4
- "version": "3.11.5",
4
+ "version": "3.12.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "module": "./lib/index.js",
@@ -17,21 +17,25 @@
17
17
  "lint": "eslint . --max-warnings=0",
18
18
  "lint:fix": "eslint . --max-warnings=0 --fix",
19
19
  "format": "prettier . --write --log-level=warn",
20
- "test:common": "jest --clearCache && jest --config=./jest.config.mjs",
21
- "test:nostrict": "jest --clearCache && jest --config=./jest.nostrict.config.mjs",
22
- "test": "npm run test:common && npm run test:nostrict"
20
+ "test": "npm run test:common && npm run test:nostrict",
21
+ "test:common": "mocha",
22
+ "test:nostrict": "TS_NODE_PROJECT=\"tsconfig.json\" && mocha"
23
23
  },
24
24
  "devDependencies": {
25
- "@panates/eslint-config": "^2.0.11",
26
- "@panates/eslint-config-ts": "^2.0.11",
27
- "@panates/tsconfig": "^2.0.11",
28
- "@types/jest": "^30.0.0",
29
- "globals": "^17.4.0",
25
+ "@panates/eslint-config": "^2.1.3",
26
+ "@panates/eslint-config-ts": "^2.1.3",
27
+ "@panates/tsconfig": "^2.1.3",
28
+ "@swc/core": "^1.15.32",
29
+ "@swc/helpers": "^0.5.21",
30
+ "@swc-node/register": "^1.11.1",
31
+ "@types/mocha": "^10.0.10",
32
+ "@types/node": "^25.6.0",
33
+ "c8": "^11.0.0",
34
+ "globals": "^17.5.0",
30
35
  "husky": "^9.1.7",
31
- "jest": "^30.3.0",
32
- "prettier": "^3.8.1",
33
- "ts-jest": "^29.4.6",
34
- "typescript": "^5.9.3"
36
+ "mocha": "^11.7.5",
37
+ "prettier": "^3.8.3",
38
+ "typescript": "^6.0.3"
35
39
  },
36
40
  "files": [
37
41
  "LICENSE",
File without changes