feat: Add types for merge-objects (#41822)

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
Richie Bendall
2020-01-25 13:27:38 +13:00
committed by Ben Lichtman
parent 371d5794ce
commit fb12206078
4 changed files with 35 additions and 0 deletions

8
types/merge-objects/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for merge-objects 1.0
// Project: https://github.com/shevaroller/node-merge-objects#readme
// Definitions by: Richie Bendall <https://github.com/Richienb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function mergeObjects<T extends object, U extends object>(object1: T, object2: U): T & U;
export = mergeObjects;

View File

@@ -0,0 +1,3 @@
import mergeObjects = require("merge-objects");
mergeObjects({ a: 1, b: [2, 3] }, { b: [4, 5], c: 6 }); // $ExpectType { a: number; b: number[]; } & { b: number[]; c: number; }

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"merge-objects-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }