Skip to content

Commit

Permalink
Fix is-shallow-equal param types
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 6, 2019
1 parent df5a199 commit d385221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/is-shallow-equal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ var isShallowEqualArrays = require( './arrays' );

var isArray = Array.isArray;

/**
* @typedef {Record<any,any>} 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.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/is-shallow-equal/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit d385221

Please sign in to comment.