Skip to content

Commit 03ba8a0

Browse files
author
Andy
authored
mergeMapLikes: Improve type (microsoft#22237)
* mergeMapLikes: Improve type * Make source Partial<T> * T extends object * Update api baseline
1 parent 6385c66 commit 03ba8a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/server/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace ts.server {
8383
};
8484
}
8585

86-
export function mergeMapLikes(target: MapLike<any>, source: MapLike<any>): void {
86+
export function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void {
8787
for (const key in source) {
8888
if (hasProperty(source, key)) {
8989
target[key] = source[key];

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4966,7 +4966,7 @@ declare namespace ts.server {
49664966
function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
49674967
}
49684968
function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings;
4969-
function mergeMapLikes(target: MapLike<any>, source: MapLike<any>): void;
4969+
function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void;
49704970
type NormalizedPath = string & {
49714971
__normalizedPathTag: any;
49724972
};

0 commit comments

Comments
 (0)