Skip to content

Commit 3609024

Browse files
committed
more tests for utils
1 parent 7ca1bb4 commit 3609024

File tree

3 files changed

+339
-130
lines changed

3 files changed

+339
-130
lines changed

packages/core/src/utils/Utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function areObjectsEqual(obj1: unknown, obj2: unknown): boolean {
8080
}
8181

8282
if (typeof obj1 === 'object' && typeof obj2 === 'object') {
83+
// both are arrays
8384
if (Array.isArray(obj1) && Array.isArray(obj2)) {
8485
if (obj1.length !== obj2.length) {
8586
return false;
@@ -94,6 +95,11 @@ export function areObjectsEqual(obj1: unknown, obj2: unknown): boolean {
9495
return true;
9596
}
9697

98+
// one is array and the other is not
99+
if (Array.isArray(obj1) || Array.isArray(obj2)) {
100+
return false;
101+
}
102+
97103
const keys1 = Object.keys(obj1);
98104
const keys2 = Object.keys(obj2);
99105

tests/fields/IPF.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ describe('IPF', () => {
414414
testPlugin = new TestPlugin();
415415
});
416416

417-
describe('load behaviour', () => {
417+
describe('load behavior', () => {
418418
describe('should load with front-matter value if front-matter value is valid for that IPF', () => {
419419
for (const validValue of TEST_CASE.validValues ?? []) {
420420
test(getTestName(validValue), () => {

0 commit comments

Comments
 (0)