Skip to content

Commit

Permalink
fix(factory): handle undefined id in file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 2, 2024
1 parent 6cb89af commit ec31bdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/factory/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResourceFactory>
Expand Down

0 comments on commit ec31bdd

Please sign in to comment.