mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
18 lines
504 B
TypeScript
18 lines
504 B
TypeScript
import { registries } from "bknd";
|
|
import { type LocalAdapterConfig, StorageLocalAdapter } from "./StorageLocalAdapter";
|
|
|
|
export * from "./StorageLocalAdapter";
|
|
|
|
let registered = false;
|
|
export function registerLocalMediaAdapter() {
|
|
if (!registered) {
|
|
registries.media.register("local", StorageLocalAdapter);
|
|
registered = true;
|
|
}
|
|
|
|
return (config: Partial<LocalAdapterConfig> = {}) => {
|
|
const adapter = new StorageLocalAdapter(config);
|
|
return adapter.toJSON(true);
|
|
};
|
|
}
|