From f4d5516226c57767834315bcf56bbb2238e06766 Mon Sep 17 00:00:00 2001 From: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:44:45 -0500 Subject: [PATCH] include es2019.object lib --- packages/datastore/__tests__/outbox.test.ts | 4 ++-- packages/datastore/src/util.ts | 5 ++++- scripts/build.js | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/datastore/__tests__/outbox.test.ts b/packages/datastore/__tests__/outbox.test.ts index c74f1866d2e..837e1be105f 100644 --- a/packages/datastore/__tests__/outbox.test.ts +++ b/packages/datastore/__tests__/outbox.test.ts @@ -33,7 +33,7 @@ describe('Outbox tests', () => { beforeAll(async () => { jest.resetAllMocks(); - await initializeOutbox(); + await instantiateOutbox(); const newModel = new Model({ field1: 'Some value', @@ -231,7 +231,7 @@ describe('Outbox tests', () => { // performs all the required dependency injection // in order to have a functional Outbox without the Sync Engine -async function initializeOutbox(): Promise { +async function instantiateOutbox(): Promise { ({ initSchema, DataStore } = require('../src/datastore/datastore')); const classes = initSchema(testSchema()); const ownSymbol = Symbol('sync'); diff --git a/packages/datastore/src/util.ts b/packages/datastore/src/util.ts index feef2f791c2..967b3ce2c15 100644 --- a/packages/datastore/src/util.ts +++ b/packages/datastore/src/util.ts @@ -440,7 +440,10 @@ export function objectsEqual(objA: object, objB: object): boolean { let a = objA; let b = objB; - if (Array.isArray(a) && !Array.isArray(b)) { + if ( + (Array.isArray(a) && !Array.isArray(b)) || + (Array.isArray(b) && !Array.isArray(a)) + ) { return false; } diff --git a/scripts/build.js b/scripts/build.js index 61b9097aea7..8b133b08cf6 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -157,7 +157,13 @@ async function buildES5(typeScriptCompiler) { let compilerOptions = { esModuleInterop: true, noImplicitAny: false, - lib: ['dom', 'es2017', 'esnext.asynciterable', 'es2018.asyncgenerator'], + lib: [ + 'dom', + 'es2017', + 'esnext.asynciterable', + 'es2018.asyncgenerator', + 'es2019.object', + ], downlevelIteration: true, jsx: jsx, sourceMap: true, @@ -202,7 +208,13 @@ function buildES6(typeScriptCompiler) { let compilerOptions = { esModuleInterop: true, noImplicitAny: false, - lib: ['dom', 'es2017', 'esnext.asynciterable', 'es2018.asyncgenerator'], + lib: [ + 'dom', + 'es2017', + 'esnext.asynciterable', + 'es2018.asyncgenerator', + 'es2019.object', + ], downlevelIteration: true, jsx: jsx, sourceMap: true,