Merge branch 'development' into sse-and-backoff

This commit is contained in:
2026-07-20 10:21:33 +00:00
2 changed files with 51 additions and 1 deletions

View File

@@ -74,3 +74,23 @@ export const extendedJsonReviver = (_propertyKey: string, value: unknown): unkno
// If the value does not match either pattern, return the original value
return value;
};
/**
* Serializes an object to a string using the {@link extendedJsonReplacer}.
*
* @param object The object to serialize.
* @returns The string representation of the object in Extended JSON format.
*/
export const toExtendedJson = (object: unknown): string => {
return JSON.stringify(object, extendedJsonReplacer);
};
/**
* Deserializes a string to an object using the {@link extendedJsonReviver}.
*
* @param serializedObject The string to deserialize.
* @returns The object reconstructed from the string.
*/
export const fromExtendedJson = (serializedObject: string): unknown => {
return JSON.parse(serializedObject, extendedJsonReviver);
};