UNPKG

@dpkit/core

Version:

Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames

13 lines (11 loc) 434 B
import { loadDescriptor } from "../general/index.ts" import { assertResource } from "./assert.ts" /** * Load a Resource descriptor (JSON Object) from a file or URL * Ensures the descriptor is valid against its profile */ export async function loadResourceDescriptor(path: string) { const { descriptor, basepath } = await loadDescriptor(path) const resource = await assertResource(descriptor, { basepath }) return resource }