Skip to content

Commit

Permalink
Type is-shallow-equal
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 12, 2019
1 parent e1b24d9 commit 791599b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/is-shallow-equal/arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* Returns true if the two arrays are shallow equal, or false otherwise.
*
* @param {Array} a First array to compare.
* @param {Array} b Second array to compare.
* @param {any[]} a First array to compare.
* @param {any[]} b Second array to compare.
*
* @return {boolean} Whether the two arrays are shallow equal.
*/
Expand Down
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 {{[key: string]: any}} ComparableObject
*/

/**
* Returns true if the two arrays or objects are shallow equal, or false
* otherwise.
*
* @param {(Array|Object)} a First object or array to compare.
* @param {(Array|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
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"include": [
"./packages/i18n/**/*.js",
"./packages/is-shallow-equal/**/*.js",
"./packages/priority-queue/**/*.js",
"./packages/token-list/**/*.js",
"./packages/url/**/*.js"
Expand Down

0 comments on commit 791599b

Please sign in to comment.