From ec31bdde639cb54805b4fc2c343fbed9f4cbb5d8 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 2 Sep 2024 17:10:10 +0200 Subject: [PATCH] fix(factory): handle undefined id in file name --- packages/core/src/factory/storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/factory/storage.ts b/packages/core/src/factory/storage.ts index 58ce0db..39a6b25 100644 --- a/packages/core/src/factory/storage.ts +++ b/packages/core/src/factory/storage.ts @@ -15,7 +15,7 @@ import { serializeFactory } from './serialize.js' export function getFactoryFilename(mq: MoquerieInstance, resourceName: string, id: string, name: string, location: DBLocation) { // eslint-disable-next-line regexp/no-super-linear-backtracking const [, idPart] = /.+?(@@.+)?$/.exec(id) ?? [] - return `${resourceName}/${name}${location === 'local' ? idPart : ''}.${projectHasTypescript(mq) ? 'ts' : 'js'}` + return `${resourceName}/${name}${location === 'local' ? idPart ?? '' : ''}.${projectHasTypescript(mq) ? 'ts' : 'js'}` } let storage: MergedStorage