From b8abf4a0e491270df1369d953fdb0af63379947f Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Wed, 28 Sep 2016 12:20:33 -0700 Subject: [PATCH] Add typings for shallowequal. --- shallowequal/shallowequal-tests.ts | 12 ++++++++++++ shallowequal/shallowequal.d.ts | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 shallowequal/shallowequal-tests.ts create mode 100644 shallowequal/shallowequal.d.ts diff --git a/shallowequal/shallowequal-tests.ts b/shallowequal/shallowequal-tests.ts new file mode 100644 index 0000000000..73c644c770 --- /dev/null +++ b/shallowequal/shallowequal-tests.ts @@ -0,0 +1,12 @@ +/// + +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, {}); diff --git a/shallowequal/shallowequal.d.ts b/shallowequal/shallowequal.d.ts new file mode 100644 index 0000000000..d3971e15c9 --- /dev/null +++ b/shallowequal/shallowequal.d.ts @@ -0,0 +1,9 @@ +// Type definitions for shallowequal v0.2.2 +// Project: https://github.com/dashed/shallowequal +// Definitions by: Sean Kelley +// 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; +}