mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 16:46:00 +00:00
fix schema import path
This commit is contained in:
@@ -12,7 +12,10 @@ export function getBindings<T extends GetBindingType>(env: any, type: T): Bindin
|
||||
const bindings: BindingMap<T>[] = [];
|
||||
for (const key in env) {
|
||||
try {
|
||||
if (env[key] && (env[key] as any).constructor.name === type) {
|
||||
if (
|
||||
env[key] &&
|
||||
((env[key] as any).constructor.name === type || String(env[key]) === `[object ${type}]`)
|
||||
) {
|
||||
bindings.push({
|
||||
key,
|
||||
value: env[key] as BindingTypeMap[T],
|
||||
|
||||
@@ -13,7 +13,7 @@ export {
|
||||
type BindingMap,
|
||||
} from "./bindings";
|
||||
export { constants } from "./config";
|
||||
export { StorageR2Adapter } from "./storage/StorageR2Adapter";
|
||||
export { StorageR2Adapter, registerMedia } from "./storage/StorageR2Adapter";
|
||||
export { registries } from "bknd";
|
||||
|
||||
// for compatibility with old code
|
||||
|
||||
@@ -2,7 +2,7 @@ import { registries } from "bknd";
|
||||
import { isDebug } from "bknd/core";
|
||||
import { guessMimeType as guess, StorageAdapter, type FileBody } from "bknd/media";
|
||||
import { getBindings } from "../bindings";
|
||||
import { s } from "core/object/schema";
|
||||
import { s } from "bknd/core";
|
||||
|
||||
export function makeSchema(bindings: string[] = []) {
|
||||
return s.object(
|
||||
|
||||
@@ -2,7 +2,7 @@ import { readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
||||
import { isFile } from "bknd/utils";
|
||||
import type { FileBody, FileListObject, FileMeta, FileUploadPayload } from "bknd/media";
|
||||
import { StorageAdapter, guessMimeType as guess } from "bknd/media";
|
||||
import { parse, s } from "core/object/schema";
|
||||
import { parse, s } from "bknd/core";
|
||||
|
||||
export const localAdapterConfig = s.object(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user