mcfly/packages/core/get-files.mjs
Ayo Ayco 73617647db
feat: move cli to core (#55)
* refactor: move cli to core

* feat: move cli to core

- use route-middleware in serve
- eliminate need for `routes` dir in app

* feat: use route-middleware in build

* chore: update test gh action
2025-01-08 21:21:31 +01:00

11 lines
341 B
JavaScript

/**
* Get all files from the storage given a type
* @param {string} type
* @param {Storage} storage
* @returns {Promise<string[]>}
*/
export async function getFiles(type, storage) {
return (await storage.getKeys('assets:components'))
.map((key) => key.replace('assets:components:', ''))
.filter((key) => key.includes(type))
}