mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +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:
parent
e9270215e9
commit
b006daa1c6
7
object-diff/index.d.ts
vendored
Normal file
7
object-diff/index.d.ts
vendored
Normal file
@ -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;
|
||||
18
object-diff/object-diff-tests.ts
Normal file
18
object-diff/object-diff-tests.ts
Normal file
@ -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);
|
||||
19
object-diff/tsconfig.json
Normal file
19
object-diff/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user