UNPKG

@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

13 lines (12 loc) 575 B
/** * Serializes a value into a string representation. * Handles various types, including strings, numbers, booleans, dates, and objects. * Falls back to JSON stringification for unsupported types. * @param value - The value to serialize. * - Strings are returned as-is. * - Numbers and booleans are converted to their string representation. * - Dates are converted to ISO string format. * - Other values are stringified using `JSON.stringify`. * @returns A string representation of the value. */ export default function serializeValue(value: any): string;