mergeMapLikes: Improve type (#22237)

* mergeMapLikes: Improve type

* Make source Partial<T>

* T extends object

* Update api baseline
This commit is contained in:
Andy 2018-03-01 07:35:42 -08:00 committed by GitHub
parent 6385c66215
commit 03ba8a0852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ namespace ts.server {
};
}
export function mergeMapLikes(target: MapLike<any>, source: MapLike<any>): void {
export function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void {
for (const key in source) {
if (hasProperty(source, key)) {
target[key] = source[key];

View File

@ -4966,7 +4966,7 @@ declare namespace ts.server {
function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never;
}
function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings;
function mergeMapLikes(target: MapLike<any>, source: MapLike<any>): void;
function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void;
type NormalizedPath = string & {
__normalizedPathTag: any;
};