strict-ts-lib-v5.6 0.5.1 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # strict-ts-lib-v5.6
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ac290c1: Leave `Exclude`, `Extract`, `Omit` and `Pick` with the constraints TypeScript
8
+ declares, and widen `strict-ts-lib-v7.0`'s `typescript` peer range to
9
+ `>=6.0.0 <8.0.0`.
10
+
11
+ Both landed on main in #1672 and #1673 but shipped no release: those changesets
12
+ named the bundle packages (`strict-ts-lib-v7.0` and friends) rather than the
13
+ `-source` harnesses this repository versions. `changeset version` bumped the
14
+ bundle manifests, and `strict-lib:gen:packages` — which runs next and stamps
15
+ each bundle with its harness's version — wrote 0.5.1 straight back over them,
16
+ the harnesses never having been bumped at all. Nothing errored; the version
17
+ simply did not move.
18
+
19
+ All twelve harnesses are named. The `fixed` group in `.changeset/config.json`
20
+ would align the versions from a single name, but a changeset's text reaches
21
+ only the packages it names — the rest get a bare version heading with nothing
22
+ under it. A change to the shared converter affects every series equally, so
23
+ every series' changelog should say so.
24
+
25
+ ### `Exclude` and `Omit`
26
+
27
+ Two of the four utility types had their second argument narrowed here —
28
+ `Exclude<T, U extends T>` and `Omit<T, K extends keyof T>`, against upstream's
29
+ `Exclude<T, U>` and `Omit<T, K extends keyof any>`. `Extract` and `Pick`
30
+ already matched.
31
+
32
+ Narrowing makes a choice on the caller's behalf, and only one of the two
33
+ readings is ever right for a given call. Subtracting keys a type may not have
34
+ is legitimate — upstream's own declarations do it — and under the narrowed
35
+ constraint it is a TS2344 that nothing can fix when the declaration lives
36
+ inside a dependency. Making the choice explicit belongs in the caller's code,
37
+ which is what `eslint-plugin-ts-type-forge`'s
38
+ `prefer-strict-or-relaxed-utility-type` does, pointing at `StrictOmit` /
39
+ `RelaxedOmit` and the rest.
40
+
41
+ Only widens what is accepted, so anything that compiled still does.
42
+
43
+ ### Peer range
44
+
45
+ TypeScript 6.0.3 compiles the v7.0 lib set with `skipLibCheck: false` and no
46
+ errors, and resolves `@typescript/lib-*` by the same package-name lookup
47
+ TypeScript 7 uses, so one bundle serves both compilers. Without the wider
48
+ declaration npm refuses to install it beside TypeScript 6.
49
+
3
50
  ## 0.5.1
4
51
 
5
52
  ### Patch Changes
@@ -33404,10 +33404,7 @@ interface MathMLElementTagNameMap {
33404
33404
  type ElementTagNameMap = HTMLElementTagNameMap &
33405
33405
  Pick<
33406
33406
  SVGElementTagNameMap,
33407
- import('ts-type-forge').RelaxedExclude<
33408
- keyof SVGElementTagNameMap,
33409
- keyof HTMLElementTagNameMap
33410
- >
33407
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33411
33408
  >;
33412
33409
 
33413
33410
  declare const Audio: {
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
46
46
  ToStr<keyof PickByValue<R, R[K]>>,
47
47
  R[K],
48
48
  ];
49
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
50
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
49
+ }[Exclude<keyof R, symbol>]
51
50
  )[]
52
51
  : never;
53
52
  }
@@ -1868,7 +1868,7 @@ type Record<K extends PropertyKey, T> = {
1868
1868
  /**
1869
1869
  * Exclude from T those types that are assignable to U
1870
1870
  */
1871
- type Exclude<T, U extends T> = T extends U ? never : T;
1871
+ type Exclude<T, U> = T extends U ? never : T;
1872
1872
 
1873
1873
  /**
1874
1874
  * Extract from T those types that are assignable to U
@@ -1878,7 +1878,7 @@ type Extract<T, U> = T extends U ? T : never;
1878
1878
  /**
1879
1879
  * Construct a type with the properties of T except for those in type K.
1880
1880
  */
1881
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1881
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
1882
1882
 
1883
1883
  /**
1884
1884
  * Exclude null and undefined from T
@@ -33411,10 +33411,7 @@ interface MathMLElementTagNameMap {
33411
33411
  type ElementTagNameMap = HTMLElementTagNameMap &
33412
33412
  Pick<
33413
33413
  SVGElementTagNameMap,
33414
- import('ts-type-forge').RelaxedExclude<
33415
- keyof SVGElementTagNameMap,
33416
- keyof HTMLElementTagNameMap
33417
- >
33414
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33418
33415
  >;
33419
33416
 
33420
33417
  declare const Audio: {
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
46
46
  ToStr<keyof PickByValue<R, R[K]>>,
47
47
  R[K],
48
48
  ];
49
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
50
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
49
+ }[Exclude<keyof R, symbol>]
51
50
  )[]
52
51
  : never;
53
52
  }
@@ -2023,7 +2023,7 @@ type Record<K extends PropertyKey, T> = {
2023
2023
  /**
2024
2024
  * Exclude from T those types that are assignable to U
2025
2025
  */
2026
- type Exclude<T, U extends T> = T extends U ? never : T;
2026
+ type Exclude<T, U> = T extends U ? never : T;
2027
2027
 
2028
2028
  /**
2029
2029
  * Extract from T those types that are assignable to U
@@ -2033,7 +2033,7 @@ type Extract<T, U> = T extends U ? T : never;
2033
2033
  /**
2034
2034
  * Construct a type with the properties of T except for those in type K.
2035
2035
  */
2036
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2036
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
2037
2037
 
2038
2038
  /**
2039
2039
  * Exclude null and undefined from T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strict-ts-lib-v5.6",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Strict TypeScript 5.6.3 standard library (all libs in one package)",
6
6
  "license": "Apache-2.0",