mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Add typings for object-diff. (#11984)
* Add typings for object-diff. * review comment * review comment - tsconfig.json * fix tsc errors
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for object-diff v0.0
|
||||
// Project: https://github.com/srcagency/object-diff
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare function diff(a: any, b: any): any;
|
||||
export = diff;
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
import diff = require('object-diff');
|
||||
|
||||
// from the package README.md, typescriptified:
|
||||
|
||||
var a = {
|
||||
speed: 4,
|
||||
power: 54,
|
||||
level: 1,
|
||||
};
|
||||
|
||||
var b = {
|
||||
speed: 4, // unchanged
|
||||
power: 22, // changed
|
||||
weight: 10, // added
|
||||
};
|
||||
|
||||
var d: any = diff(a, b);
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"object-diff-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user