mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
deep-extend: Fix name and lint
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
import * as deepExtend from 'deep-extend';
|
||||
var obj1 = {
|
||||
const obj1 = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
d: {
|
||||
@@ -13,7 +12,7 @@ var obj1 = {
|
||||
i: 321,
|
||||
j: [1, 2]
|
||||
};
|
||||
var obj2 = {
|
||||
const obj2 = {
|
||||
b: 3,
|
||||
c: 5,
|
||||
d: {
|
||||
@@ -22,14 +21,12 @@ var obj2 = {
|
||||
},
|
||||
e: { one: 1, two: 2 },
|
||||
f: [42],
|
||||
g: function(){},
|
||||
g() {},
|
||||
h: /abc/g,
|
||||
i: null as {aaa: boolean},
|
||||
i: null,
|
||||
j: [3, 4]
|
||||
};
|
||||
|
||||
deepExtend(obj1, obj2);
|
||||
deepExtend(obj1, obj2, {ccc: 3});
|
||||
deepExtend(obj1, obj2, {ccc: 3}, {ddd: 4});
|
||||
|
||||
|
||||
|
||||
7
types/deep-extend/index.d.ts
vendored
7
types/deep-extend/index.d.ts
vendored
@@ -1,12 +1,9 @@
|
||||
// Type definitions for open 0.4.1
|
||||
// Type definitions for deep-extend 0.4
|
||||
// Project: https://github.com/unclechu/node-deep-extend
|
||||
// Definitions by: rhysd <https://github.com/rhysd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/*
|
||||
* Recursive object extending.
|
||||
*/
|
||||
/** Recursive object extending. */
|
||||
declare function deepExtend<T, U>(target: T, source: U): T & U;
|
||||
declare function deepExtend<T, U, V>(target: T, source1: U, source2: V): T & U & V;
|
||||
declare function deepExtend<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Reference in New Issue
Block a user