mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-01-12 22:46:38 +08:00
Remove deepmerge: no longer needed (#29415)
This commit is contained in:
@@ -396,6 +396,12 @@
|
||||
"sourceRepoURL": "https://github.com/MikeMcl/decimal.js",
|
||||
"asOfVersion": "7.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "deepmerge",
|
||||
"typingsPackageName": "deepmerge",
|
||||
"sourceRepoURL": "git@github.com:KyleAMathews/deepmerge.git",
|
||||
"asOfVersion": "2.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "delay",
|
||||
"typingsPackageName": "delay",
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import * as deepmerge from "deepmerge";
|
||||
|
||||
const x = {
|
||||
foo: { bar: 3 },
|
||||
array: [{ does: 'work', too: [1, 2, 3] }]
|
||||
};
|
||||
const y = {
|
||||
foo: { baz: 4 },
|
||||
quux: 5,
|
||||
array: [{ does: 'work', too: [4, 5, 6] }, { really: 'yes' }]
|
||||
};
|
||||
|
||||
const expected = {
|
||||
foo: { bar: 3, baz: 4 },
|
||||
array: [{ does: 'work', too: [1, 2, 3, 4, 5, 6] }, { really: 'yes' }],
|
||||
quux: 5
|
||||
};
|
||||
|
||||
const result = deepmerge(x, y);
|
||||
const anyResult = deepmerge<any>(x, y);
|
||||
|
||||
function reverseConcat(dest: number[], src: number[]) {
|
||||
return src.concat(dest);
|
||||
}
|
||||
|
||||
const withOptions = deepmerge(x, y, {
|
||||
clone: false,
|
||||
arrayMerge: reverseConcat
|
||||
});
|
||||
29
types/deepmerge/index.d.ts
vendored
29
types/deepmerge/index.d.ts
vendored
@@ -1,29 +0,0 @@
|
||||
// Type definitions for deepmerge 2.1
|
||||
// Project: https://github.com/KyleAMathews/deepmerge
|
||||
// Definitions by: marvinscharle <https://github.com/marvinscharle>
|
||||
// syy1125 <https://github.com/syy1125>
|
||||
// AppLover69 <https://github.com/AppLover69>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = deepmerge;
|
||||
|
||||
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
|
||||
declare function deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
|
||||
|
||||
declare namespace deepmerge {
|
||||
interface Options {
|
||||
clone?: boolean;
|
||||
arrayMerge?(destination: any[], source: any[], options?: Options): any[];
|
||||
isMergeableObject?(value: object): boolean;
|
||||
}
|
||||
|
||||
function all<T>(objects: Array<Partial<T>>, options?: Options): T;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
|
||||
deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"deepmerge-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user