Skip to content

Commit 791599b

Browse files
committed
Type is-shallow-equal
1 parent e1b24d9 commit 791599b

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

packages/is-shallow-equal/arrays.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* Returns true if the two arrays are shallow equal, or false otherwise.
55
*
6-
* @param {Array} a First array to compare.
7-
* @param {Array} b Second array to compare.
6+
* @param {any[]} a First array to compare.
7+
* @param {any[]} b Second array to compare.
88
*
99
* @return {boolean} Whether the two arrays are shallow equal.
1010
*/

packages/is-shallow-equal/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ var isShallowEqualArrays = require( './arrays' );
88

99
var isArray = Array.isArray;
1010

11+
/**
12+
* @typedef {{[key: string]: any}} ComparableObject
13+
*/
14+
1115
/**
1216
* Returns true if the two arrays or objects are shallow equal, or false
1317
* otherwise.
1418
*
15-
* @param {(Array|Object)} a First object or array to compare.
16-
* @param {(Array|Object)} b Second object or array to compare.
19+
* @param {any[]|ComparableObject} a First object or array to compare.
20+
* @param {any[]|ComparableObject} b Second object or array to compare.
1721
*
1822
* @return {boolean} Whether the two values are shallow equal.
1923
*/

packages/is-shallow-equal/objects.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ var keys = Object.keys;
55
/**
66
* Returns true if the two objects are shallow equal, or false otherwise.
77
*
8-
* @param {Object} a First object to compare.
9-
* @param {Object} b Second object to compare.
8+
* @param {import('.').ComparableObject} a First object to compare.
9+
* @param {import('.').ComparableObject} b Second object to compare.
1010
*
1111
* @return {boolean} Whether the two objects are shallow equal.
1212
*/

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"include": [
2525
"./packages/i18n/**/*.js",
26+
"./packages/is-shallow-equal/**/*.js",
2627
"./packages/priority-queue/**/*.js",
2728
"./packages/token-list/**/*.js",
2829
"./packages/url/**/*.js"

0 commit comments

Comments
 (0)