mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
[ember] Polyfill: allow assign to take in more than 4 args (#30424)
* [ember] Polyfill: allow assign to take in more than 4 args * Return type should be object * Adjust tests in response to modified return type Co-Authored-By: dorilla <dcmaglasang@gmail.com> * Change return type back to “any” In order to facilitate direct property access * Change return type back to “any” In order to facilitate direct property access
This commit is contained in:
committed by
Pranav Senthilnathan
parent
dbe62c60d9
commit
5bf49a7068
@@ -11,6 +11,7 @@ import { assign, merge } from '@ember/polyfills';
|
||||
assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean
|
||||
assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError
|
||||
assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[]
|
||||
assign({}, { a: 0 }, { b: 1 }, { c: 2 }, { d: 3 }).a; // $ExpectType any
|
||||
})();
|
||||
|
||||
(() => { /* merge */
|
||||
|
||||
Vendored
+1
@@ -13,6 +13,7 @@ import { Mix, Mix3, Mix4 } from './types';
|
||||
export function assign<T extends object, U extends object>(target: T, source: U): Mix<T, U>;
|
||||
export function assign<T extends object, U extends object, V extends object>(target: T, source1: U, source2: V): Mix3<T, U, V>;
|
||||
export function assign<T extends object, U extends object, V extends object, W extends object>(target: T, source1: U, source2: V, source3: W): Mix4<T, U, V, W>;
|
||||
export function assign(target: object, ...sources: object[]): any;
|
||||
|
||||
/**
|
||||
* Merge the contents of two objects together into the first object.
|
||||
|
||||
Reference in New Issue
Block a user