@dpkit/zenodo
Version:
Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames
19 lines (14 loc) • 411 B
text/typescript
import type { Resource } from "@dpkit/core"
import type { ZenodoResource } from "../Resource.ts"
export function denormalizeZenodoResource(resource: Resource) {
const zenodoResource: Partial<ZenodoResource> = {
key: resource.name,
}
if (resource.bytes) {
zenodoResource.size = resource.bytes
}
if (resource.hash) {
zenodoResource.checksum = resource.hash
}
return zenodoResource
}