mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #11582 from seansfkelley/add-shallow-equal
Add typings for shallowequal.
This commit is contained in:
12
shallowequal/shallowequal-tests.ts
Normal file
12
shallowequal/shallowequal-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path="shallowequal.d.ts" />
|
||||
|
||||
import shallowEqual = require('shallowequal');
|
||||
|
||||
const a = {}, b = {};
|
||||
function compare(a: any, b: any, indexOrKey?: number | string) {
|
||||
return false;
|
||||
}
|
||||
|
||||
shallowEqual(a, b);
|
||||
shallowEqual(a, b, compare);
|
||||
shallowEqual(a, b, compare, {});
|
||||
9
shallowequal/shallowequal.d.ts
vendored
Normal file
9
shallowequal/shallowequal.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for shallowequal v0.2.2
|
||||
// Project: https://github.com/dashed/shallowequal
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'shallowequal' {
|
||||
function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => boolean, compareContext?: any): boolean;
|
||||
export = shallowEqual;
|
||||
}
|
||||
Reference in New Issue
Block a user