type-fest 4.13.0 → 4.13.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-fest",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "A collection of essential TypeScript types",
5
5
  "license": "(MIT OR CC0-1.0)",
6
6
  "repository": "sindresorhus/type-fest",
@@ -16,7 +16,8 @@
16
16
  "node": ">=16"
17
17
  },
18
18
  "scripts": {
19
- "test": "xo && tsd && tsc && node script/test/source-files-extension.js"
19
+ "test": "xo && tsd && tsc && npm run test:set-parameter-type && node script/test/source-files-extension.js",
20
+ "test:set-parameter-type": "tsc --noEmit test-d/set-parameter-type"
20
21
  },
21
22
  "files": [
22
23
  "index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import type {IsUnknown} from './is-unknown';
2
- import type {StaticPartOfArray} from './internal';
2
+ import type {StaticPartOfArray, VariablePartOfArray} from './internal';
3
3
  import type {UnknownArray} from './unknown-array';
4
4
 
5
5
  /**
@@ -32,7 +32,10 @@ type MergeObjectToArray<TArray extends UnknownArray, TObject, TArrayCopy extends
32
32
  ? number extends TObject['length']
33
33
  ? TObject
34
34
  : {
35
- [K in keyof TArray]: K extends keyof TObject ? TObject[K] : TArray[K]
35
+ [K in keyof TArray]:
36
+ number extends K
37
+ ? VariablePartOfArray<TArray>[number]
38
+ : K extends keyof TObject ? TObject[K] : TArray[K]
36
39
  }
37
40
  : TObject extends object
38
41
  // If `TObject` is a object witch key is number like `{0: string, 1: number}`