From 378ddc89e6befb581210109f1b26f9e7641b8a96 Mon Sep 17 00:00:00 2001 From: Miles Georgi Date: Fri, 15 Mar 2024 20:32:42 -0700 Subject: [PATCH] Fix a couple tsc/eslint errors --- templates/Domain/config.ts.erb | 4 +++- templates/Organization/config.ts.erb | 4 +++- templates/base/DataPath.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/Domain/config.ts.erb b/templates/Domain/config.ts.erb index b976e5f..14393eb 100644 --- a/templates/Domain/config.ts.erb +++ b/templates/Domain/config.ts.erb @@ -1,6 +1,6 @@ let _urlBase = process.env.REACT_APP_FOOBARA_GLOBAL_URL_BASE -export default { +const config = { get urlBase(): string { if (_urlBase === undefined) { throw new Error("urlBase is not set and REACT_APP_FOOBARA_GLOBAL_URL_BASE is undefined") @@ -12,3 +12,5 @@ export default { _urlBase = urlBase } } + +export default config diff --git a/templates/Organization/config.ts.erb b/templates/Organization/config.ts.erb index b976e5f..14393eb 100644 --- a/templates/Organization/config.ts.erb +++ b/templates/Organization/config.ts.erb @@ -1,6 +1,6 @@ let _urlBase = process.env.REACT_APP_FOOBARA_GLOBAL_URL_BASE -export default { +const config = { get urlBase(): string { if (_urlBase === undefined) { throw new Error("urlBase is not set and REACT_APP_FOOBARA_GLOBAL_URL_BASE is undefined") @@ -12,3 +12,5 @@ export default { _urlBase = urlBase } } + +export default config diff --git a/templates/base/DataPath.ts b/templates/base/DataPath.ts index 1fe7351..b242cde 100644 --- a/templates/base/DataPath.ts +++ b/templates/base/DataPath.ts @@ -3,7 +3,7 @@ function flatten (array: any[][]): any[] { } function uniq (array: T[]): T[] { - return [...new Set(array)] + return Array.from(new Set(array)); } function compact (array: any[]): any[] {