Skip to content

Commit

Permalink
chore(release): 4.2.0 [skip ci]
Browse files Browse the repository at this point in the history
# [4.2.0](v4.1.0...v4.2.0) (2022-06-15)

### Features

* export types for module resolution node 16 ([20241c5](20241c5))

### Performance Improvements

* **ts:** add variance annotations ([cecc9db](cecc9db))
* **ts:** use extends constraints on infer ([f053e76](f053e76))
  • Loading branch information
semantic-release-bot committed Jun 15, 2022
1 parent c65ede5 commit 63581a5
Show file tree
Hide file tree
Showing 7 changed files with 870 additions and 26 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.

# [4.2.0](https://github.com/RebeccaStevens/deepmerge-ts/compare/v4.1.0...v4.2.0) (2022-06-15)


### Features

* export types for module resolution node 16 ([20241c5](https://github.com/RebeccaStevens/deepmerge-ts/commit/20241c5bdffcc77025ea778257193f1afbe40768))


### Performance Improvements

* **ts:** add variance annotations ([cecc9db](https://github.com/RebeccaStevens/deepmerge-ts/commit/cecc9dbcfc68335f04372e2fa339a347f71c90bc))
* **ts:** use extends constraints on infer ([f053e76](https://github.com/RebeccaStevens/deepmerge-ts/commit/f053e76221fb790f1dead0b2b5c9a9f4432cb1d8))

# [4.1.0](https://github.com/RebeccaStevens/deepmerge-ts/compare/v4.0.4...v4.1.0) (2022-06-13)


Expand Down
42 changes: 22 additions & 20 deletions dist/deno/types/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,18 @@ type DeepMergeRecordsDefaultHKTInternalPropValueHelper<
K extends PropertyKey,
M,
Acc extends ReadonlyArray<unknown>
> = Ts extends readonly [infer Head, ...infer Rest]
? Head extends Readonly<Record<PropertyKey, unknown>>
? Rest extends readonly [unknown, ...ReadonlyArray<unknown>]
? DeepMergeRecordsDefaultHKTInternalPropValueHelper<
Rest,
K,
M,
[...Acc, ValueOfKey<Head, K>]
>
: [...Acc, ValueOfKey<Head, K>]
: never
> = Ts extends readonly [
infer Head extends Readonly<Record<PropertyKey, unknown>>,
...infer Rest
]
? Rest extends readonly [unknown, ...ReadonlyArray<unknown>]
? DeepMergeRecordsDefaultHKTInternalPropValueHelper<
Rest,
K,
M,
[...Acc, ValueOfKey<Head, K>]
>
: [...Acc, ValueOfKey<Head, K>]
: never;

/**
Expand All @@ -138,15 +139,16 @@ type DeepMergeArraysDefaultHKTHelper<
MF extends DeepMergeMergeFunctionsURIs,
M,
Acc extends ReadonlyArray<unknown>
> = Ts extends readonly [infer Head, ...infer Rest]
? Head extends ReadonlyArray<unknown>
? Rest extends readonly [
ReadonlyArray<unknown>,
...ReadonlyArray<ReadonlyArray<unknown>>
]
? DeepMergeArraysDefaultHKTHelper<Rest, MF, M, [...Acc, ...Head]>
: [...Acc, ...Head]
: never
> = Ts extends readonly [
infer Head extends ReadonlyArray<unknown>,
...infer Rest
]
? Rest extends readonly [
ReadonlyArray<unknown>,
...ReadonlyArray<ReadonlyArray<unknown>>
]
? DeepMergeArraysDefaultHKTHelper<Rest, MF, M, [...Acc, ...Head]>
: [...Acc, ...Head]
: never;

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/deno/types/merging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
export interface DeepMergeMergeFunctionURItoKind<
Ts extends ReadonlyArray<unknown>,
MF extends DeepMergeMergeFunctionsURIs,
M
in out M
> {
readonly DeepMergeLeafURI: DeepMergeLeaf<Ts>;
readonly DeepMergeRecordsDefaultURI: DeepMergeRecordsDefaultHKT<Ts, MF, M>;
Expand Down
13 changes: 8 additions & 5 deletions dist/deno/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ import type { DeepMergeBuiltInMetaData } from "./merging.ts";
* The options the user can pass to customize deepmerge.
*/
export type DeepMergeOptions<
M,
in out M,
MM extends Readonly<Record<PropertyKey, unknown>> = DeepMergeBuiltInMetaData
> = Partial<DeepMergeOptionsFull<M, MM & DeepMergeBuiltInMetaData>>;

type MetaDataUpdater<M, MM extends DeepMergeBuiltInMetaData> = (
type MetaDataUpdater<in out M, MM extends DeepMergeBuiltInMetaData> = (
previousMeta: M | undefined,
metaMeta: Readonly<Partial<MM>>
) => M;

/**
* All the options the user can pass to customize deepmerge.
*/
type DeepMergeOptionsFull<M, MM extends DeepMergeBuiltInMetaData> = Readonly<{
type DeepMergeOptionsFull<
in out M,
MM extends DeepMergeBuiltInMetaData
> = Readonly<{
mergeRecords: DeepMergeMergeFunctions<M, MM>["mergeRecords"] | false;
mergeArrays: DeepMergeMergeFunctions<M, MM>["mergeArrays"] | false;
mergeMaps: DeepMergeMergeFunctions<M, MM>["mergeMaps"] | false;
Expand All @@ -33,7 +36,7 @@ type DeepMergeOptionsFull<M, MM extends DeepMergeBuiltInMetaData> = Readonly<{
* All the merge functions that deepmerge uses.
*/
type DeepMergeMergeFunctions<
M,
in M,
MM extends DeepMergeBuiltInMetaData
> = Readonly<{
mergeRecords: <
Expand Down Expand Up @@ -86,7 +89,7 @@ type DeepMergeMergeFunctions<
* The utils provided to the merge functions.
*/
export type DeepMergeMergeFunctionUtils<
M,
in out M,
MM extends DeepMergeBuiltInMetaData
> = Readonly<{
mergeFunctions: DeepMergeMergeFunctions<M, MM>;
Expand Down
Loading

0 comments on commit 63581a5

Please sign in to comment.