Added more TAs to Beast4L, fixed unlighthouse issue, optimized dev experience by throwing actual useful errors
This commit is contained in:
parent
278c39cb3b
commit
34784a3bf1
21 changed files with 112 additions and 33 deletions
src/utils
|
@ -1,3 +0,0 @@
|
|||
export function findSlug(filepath: string) {
|
||||
return filepath.match(/(?:.*[\\/])(.+)(?:\.json)/)?.[1]
|
||||
}
|
9
src/utils/tools.ts
Normal file
9
src/utils/tools.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
export function findSlug(filepath: string) {
|
||||
return filepath.match(/(?:.*[\\/])(.+)(?:\.json)/)?.[1]
|
||||
}
|
||||
|
||||
export function plsLoadImage(record: Record<string, () => Promise<{default: ImageMetadata}>>, path: string) {
|
||||
const loadedImage = record[path]?.();
|
||||
if (!loadedImage) throw new Error("Asset was not found:" + path);
|
||||
return loadedImage;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue