basebee
Version:
Basebee is a powerful key-value store built on top of Autobase and Hyperbee, designed to efficiently manage data with customizable key/value encodings, prefix-based key organization, and batch operations. It integrates stream-based APIs for handling key-v
9 lines (8 loc) • 353 B
JavaScript
import b4a from "b4a";
import c from "compact-encoding";
import {getPropFromMultipleObjects} from "./getPropFromMultipleObjects.js";
export function encodeValue(value, ...configs) {
if (b4a.isBuffer(value)) return value;
const enc = c.from(getPropFromMultipleObjects("valueEncoding", ...configs) || c.binary);
return c.encode(enc, value);
}