strict-ts-lib-v5.1 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.1
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
@@ -33282,10 +33282,7 @@ interface MathMLElementTagNameMap {
33282
33282
  type ElementTagNameMap = HTMLElementTagNameMap &
33283
33283
  Pick<
33284
33284
  SVGElementTagNameMap,
33285
- import('ts-type-forge').RelaxedExclude<
33286
- keyof SVGElementTagNameMap,
33287
- keyof HTMLElementTagNameMap
33288
- >
33285
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33289
33286
  >;
33290
33287
 
33291
33288
  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
  }
@@ -1859,7 +1859,7 @@ type Record<K extends PropertyKey, T> = {
1859
1859
  /**
1860
1860
  * Exclude from T those types that are assignable to U
1861
1861
  */
1862
- type Exclude<T, U extends T> = T extends U ? never : T;
1862
+ type Exclude<T, U> = T extends U ? never : T;
1863
1863
 
1864
1864
  /**
1865
1865
  * Extract from T those types that are assignable to U
@@ -1869,7 +1869,7 @@ type Extract<T, U> = T extends U ? T : never;
1869
1869
  /**
1870
1870
  * Construct a type with the properties of T except for those in type K.
1871
1871
  */
1872
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1872
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
1873
1873
 
1874
1874
  /**
1875
1875
  * Exclude null and undefined from T
@@ -33289,10 +33289,7 @@ interface MathMLElementTagNameMap {
33289
33289
  type ElementTagNameMap = HTMLElementTagNameMap &
33290
33290
  Pick<
33291
33291
  SVGElementTagNameMap,
33292
- import('ts-type-forge').RelaxedExclude<
33293
- keyof SVGElementTagNameMap,
33294
- keyof HTMLElementTagNameMap
33295
- >
33292
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33296
33293
  >;
33297
33294
 
33298
33295
  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
  }
@@ -2014,7 +2014,7 @@ type Record<K extends PropertyKey, T> = {
2014
2014
  /**
2015
2015
  * Exclude from T those types that are assignable to U
2016
2016
  */
2017
- type Exclude<T, U extends T> = T extends U ? never : T;
2017
+ type Exclude<T, U> = T extends U ? never : T;
2018
2018
 
2019
2019
  /**
2020
2020
  * Extract from T those types that are assignable to U
@@ -2024,7 +2024,7 @@ type Extract<T, U> = T extends U ? T : never;
2024
2024
  /**
2025
2025
  * Construct a type with the properties of T except for those in type K.
2026
2026
  */
2027
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2027
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
2028
2028
 
2029
2029
  /**
2030
2030
  * Exclude null and undefined from T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strict-ts-lib-v5.1",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Strict TypeScript 5.1.6 standard library (all libs in one package)",
6
6
  "license": "Apache-2.0",