We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89d21c8 commit 3a93340Copy full SHA for 3a93340
utils/pg-sql2/src/index.ts
@@ -1062,11 +1062,19 @@ export function arraysMatch<T>(
1062
if (l !== array2.length) {
1063
return false;
1064
}
1065
- for (let i = 0; i < l; i++) {
1066
- const a = array1[i]!;
1067
- const b = array2[i]!;
1068
- if (a !== b && (!comparator || !comparator(a, b))) {
1069
- return false;
+ if (comparator != null) {
+ for (let i = 0; i < l; i++) {
+ const a = array1[i]!;
+ const b = array2[i]!;
+ if (a !== b && !comparator(a, b)) {
1070
+ return false;
1071
+ }
1072
1073
+ } else {
1074
1075
+ if (array1[i]! !== array2[i]!) {
1076
1077
1078
1079
1080
return true;
0 commit comments