diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d36b5dfc4..c0a8c8547 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1113,6 +1113,25 @@ result = <_.LoDashObjectWrapper>_({ 'name': 'moe' }).extend({ 'age': 40 return typeof a == 'undefined' ? b : a; }); +// _.create +interface TestCreateProto { + a: number; +} +interface TestCreateProps { + b: string; +} +interface TestCreateTResult extends TestCreateProto, TestCreateProps {} +var testCreateProto: TestCreateProto; +var testCreateProps: TestCreateProps; +result = <{}>_.create(testCreateProto); +result = <{}>_.create(testCreateProto, testCreateProps); +result = _.create(testCreateProto); +result = _.create(testCreateProto, testCreateProps); +result = <{}>_(testCreateProto).create().value(); +result = <{}>_(testCreateProto).create(testCreateProps).value(); +result = _(testCreateProto).create().value(); +result = _(testCreateProto).create(testCreateProps).value(); + result = _.clone(stoogesAges); result = _.clone(stoogesAges, true); result = _.clone(stoogesAges, true, function (value) { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7c4111746..8fb368f8b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6104,6 +6104,25 @@ declare module _ { } + //_.create + interface LoDashStatic { + /** + * Creates an object that inherits from the given prototype object. If a properties object is provided its own + * enumerable properties are assigned to the created object. + * @param prototype The object to inherit from. + * @param properties The properties to assign to the object. + * @return Returns the new object. + */ + create(prototype: Object, properties?: Object): TResult; + } + + interface LoDashObjectWrapper { + /** + * @see _.create + */ + create(properties?: Object): LoDashObjectWrapper; + } + //_.clone interface LoDashStatic { /** @@ -7391,16 +7410,6 @@ declare module _ { constant(): () => TResult; } - //_.create - interface LoDashStatic { - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own enumerable properties are assigned to the created object. - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - */ - create(prototype: Object, properties?: Object): Object; - } - interface ListIterator { (value: T, index: number, collection: T[]): TResult; }