/ simulated_instruments / triangle
Sign in
simulated_instruments / triangle
triangle / instrument / mfiles.ts
14 lines · 537 BBlameHistoryRaw
1// The shipped MATLAB sources, loaded from ../matlab at build time. Browser
2// only (import.meta.glob is a Vite feature); node tests read the same files
3// through fs instead.
4import type { MFile } from './types.ts';
6const modules = import.meta.glob('../matlab/*.m', {
7 eager: true,
8 query: '?raw',
9 import: 'default',
10}) as Record<string, string>;
12export const DEFAULT_MFILES: MFile[] = Object.entries(modules)
13 .map(([path, source]) => ({ name: path.split('/').pop()!, source }))
14 .sort((a, b) => a.name.localeCompare(b.name));
↑↓ move↵openescclose