From 985d3a0ec0357996366da699e5ae4dff2466b486 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Tue, 5 Mar 2024 10:53:23 +0100 Subject: [PATCH] style: rejiggle --- packages/db/src/core/integration/vite-plugin-db.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts index 291cb12c54..542a3074f2 100644 --- a/packages/db/src/core/integration/vite-plugin-db.ts +++ b/packages/db/src/core/integration/vite-plugin-db.ts @@ -112,13 +112,9 @@ export function getLocalVirtualModContents({ const integrationSeedFilePaths = seedFiles.map((pathOrUrl) => typeof pathOrUrl === 'string' ? resolveId(pathOrUrl) : pathOrUrl.pathname ); - const integrationSeedImports = - '[' + - integrationSeedFilePaths - .map((filePath) => `() => import(${JSON.stringify(filePath)})`) - .join(',') + - ']'; - + const integrationSeedImports = integrationSeedFilePaths.map( + (filePath) => `() => import(${JSON.stringify(filePath)})` + ); return ` import { asDrizzleTable, seedLocal } from ${RUNTIME_IMPORT}; import { db as _db } from ${JSON.stringify(LOCAL_DB_VIRTUAL_MODULE_ID)}; @@ -131,7 +127,7 @@ ${ db: _db, tables: ${JSON.stringify(tables)}, userSeedGlob: import.meta.glob(${JSON.stringify(userSeedFilePaths)}), - integrationSeedImports: ${integrationSeedImports}, + integrationSeedImports: [${integrationSeedImports.join(',')}], });` : '' }