From d385221d4b3d64757378fc18b0a9fb469a1e07eb Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Fri, 6 Dec 2019 11:26:56 +0000 Subject: [PATCH] Fix is-shallow-equal param types --- packages/is-shallow-equal/index.js | 8 ++++++-- packages/is-shallow-equal/objects.js | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/is-shallow-equal/index.js b/packages/is-shallow-equal/index.js index e52a593a18c4e4..924799d2a6d51a 100644 --- a/packages/is-shallow-equal/index.js +++ b/packages/is-shallow-equal/index.js @@ -8,12 +8,16 @@ var isShallowEqualArrays = require( './arrays' ); var isArray = Array.isArray; +/** + * @typedef {Record} ComparableObject + */ + /** * Returns true if the two arrays or objects are shallow equal, or false * otherwise. * - * @param {any[]|Object} a First object or array to compare. - * @param {any[]|Object} b Second object or array to compare. + * @param {any[]|ComparableObject} a First object or array to compare. + * @param {any[]|ComparableObject} b Second object or array to compare. * * @return {boolean} Whether the two values are shallow equal. */ diff --git a/packages/is-shallow-equal/objects.js b/packages/is-shallow-equal/objects.js index ebe1105b196156..2c7583aba9ce1d 100644 --- a/packages/is-shallow-equal/objects.js +++ b/packages/is-shallow-equal/objects.js @@ -5,8 +5,8 @@ var keys = Object.keys; /** * Returns true if the two objects are shallow equal, or false otherwise. * - * @param {Object} a First object to compare. - * @param {Object} b Second object to compare. + * @param {import('.').ComparableObject} a First object to compare. + * @param {import('.').ComparableObject} b Second object to compare. * * @return {boolean} Whether the two objects are shallow equal. */