move /my-patterns to /swatch (#338)

This commit is contained in:
Alex McLean 2023-01-01 11:34:11 +00:00 • committed by GitHub
parent 670af8fb1b
commit 7a96436085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View file

@ -1,15 +0,0 @@
export function getMyPatterns() {
const my = import.meta.glob('../../../../my-patterns/**', { as: 'raw', eager: true });
return Object.fromEntries(
Object.entries(my) //
.filter(([name]) => name.endsWith('.txt')) //
.map(([name, raw]) => [name.split('/').slice(-1), raw]), //
);
}
export async function get() {
const all = await getMyPatterns();
return {
body: JSON.stringify(all),
};
}