Skip to content

Commit fc1f036

Browse files
Zelys-DFKHsvozza
andauthored
docs(commons): fix isStrictEqual and areArraysEqual JSDoc array comparison description (#5165)
Co-authored-by: Stefano Vozza <[email protected]>
1 parent 29cbd38 commit fc1f036

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/commons/src/typeUtils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ const getType = (value: unknown): string => {
236236
/**
237237
* Compare two arrays for strict equality.
238238
*
239-
* This function compares each element in the arrays, regardless of order.
239+
* This function compares each element in the arrays at the same position.
240240
*
241241
* @example
242242
* ```typescript
243243
* import { areArraysEqual } from '@aws-lambda-powertools/commons/typeUtils';
244244
*
245245
* const left = [1, 2, 3];
246-
* const right = [3, 2, 1];
246+
* const right = [1, 2, 3];
247247
* const equal = areArraysEqual(left, right); // true
248248
*
249249
* const otherLeft = [1, 2, 3];
@@ -298,8 +298,8 @@ const areRecordsEqual = (
298298
/**
299299
* Check if two unknown values are strictly equal.
300300
*
301-
* If the values are arrays, then each element is compared, regardless of
302-
* order. If the values are objects, then each key and value from left
301+
* If the values are arrays, then each element is compared at the same
302+
* position. If the values are objects, then each key and value from left
303303
* is compared to the corresponding key and value from right. If the
304304
* values are primitives, then they are compared using strict equality.
305305
*
@@ -312,7 +312,7 @@ const areRecordsEqual = (
312312
* const equal = isStrictEqual(left, right); // true
313313
*
314314
* const otherLeft = [1, 2, 3];
315-
* const otherRight = [3, 2, 1];
315+
* const otherRight = [1, 2, 3];
316316
* const otherEqual = isStrictEqual(otherLeft, otherRight); // true
317317
*
318318
* const anotherLeft = 'foo';

0 commit comments

Comments
 (0)