Skip to content

Commit ec31bdd

Browse files
committed
fix(factory): handle undefined id in file name
1 parent 6cb89af commit ec31bdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/factory/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { serializeFactory } from './serialize.js'
1515
export function getFactoryFilename(mq: MoquerieInstance, resourceName: string, id: string, name: string, location: DBLocation) {
1616
// eslint-disable-next-line regexp/no-super-linear-backtracking
1717
const [, idPart] = /.+?(@@.+)?$/.exec(id) ?? []
18-
return `${resourceName}/${name}${location === 'local' ? idPart : ''}.${projectHasTypescript(mq) ? 'ts' : 'js'}`
18+
return `${resourceName}/${name}${location === 'local' ? idPart ?? '' : ''}.${projectHasTypescript(mq) ? 'ts' : 'js'}`
1919
}
2020

2121
let storage: MergedStorage<ResourceFactory>

0 commit comments

Comments
 (0)