@deno/kv
Version:
A Deno KV client library optimized for Node.js.
41 lines (40 loc) • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonValueToTsValueFns = exports.tsValueToJsonValueFns = void 0;
const base64_js_1 = require("../base64.js");
exports.tsValueToJsonValueFns = {
int32: (tsValue) => tsValue,
int64: (tsValue) => tsValue,
uint32: (tsValue) => tsValue,
uint64: (tsValue) => tsValue,
sint32: (tsValue) => tsValue,
sint64: (tsValue) => tsValue,
bool: (tsValue) => tsValue,
double: (tsValue) => tsValue,
float: (tsValue) => tsValue,
fixed32: (tsValue) => tsValue,
fixed64: (tsValue) => tsValue,
sfixed32: (tsValue) => tsValue,
sfixed64: (tsValue) => tsValue,
string: (tsValue) => tsValue,
bytes: (tsValue) => (0, base64_js_1.encode)(tsValue),
enum: (tsValue) => tsValue,
};
exports.jsonValueToTsValueFns = {
int32: (tsValue) => tsValue,
int64: (tsValue) => tsValue,
uint32: (tsValue) => tsValue,
uint64: (tsValue) => tsValue,
sint32: (tsValue) => tsValue,
sint64: (tsValue) => tsValue,
bool: (tsValue) => tsValue,
double: (tsValue) => tsValue,
float: (tsValue) => tsValue,
fixed32: (tsValue) => tsValue,
fixed64: (tsValue) => tsValue,
sfixed32: (tsValue) => tsValue,
sfixed64: (tsValue) => tsValue,
string: (tsValue) => tsValue,
bytes: (tsValue) => (0, base64_js_1.decode)(tsValue),
enum: (tsValue) => tsValue,
};