Merge pull request #11582 from seansfkelley/add-shallow-equal

Add typings for shallowequal.
This commit is contained in:
Vladimir Matveev
2016-09-28 22:29:13 -07:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View 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
View 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;
}