import * as dagPB from "@ipld/dag-pb";
import { decodeCID } from "../common/cid.js";
const rawToDAGLink = (raw) => {
    return dagPB.createLink(raw.Name, raw.Tsize, decodeCID(raw.Hash));
};
export const rawToDAGNode = (raw) => {
    const data = raw?.value?.Data;
    const links = raw?.value?.Links?.map(rawToDAGLink);
    return dagPB.createNode(data, links);
};
//# sourceMappingURL=util.js.map