@signaldb/core
Version:
SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in
15 lines (14 loc) • 344 B
JavaScript
function serializeValue(value) {
if (typeof value === "string")
return value;
if (typeof value === "number")
return value.toString();
if (typeof value === "boolean")
return value.toString();
if (value instanceof Date)
return value.toISOString();
return JSON.stringify(value);
}
export {
serializeValue as default
};