Skip to content

Commit

Permalink
Export util for parsing blob objects
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Feb 18, 2025
1 parent 77bd125 commit 42b9691
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ export const createSyntaxFactory = (
return queryHandler(query[QUERY_SYMBOLS.QUERY], mergeOptions(options, queryOptions));
};

const replacer = (value: unknown) => {
return isStorableObject(value) ? value : JSON.parse(JSON.stringify(value));
};
// Ensure that storable objects are retained as-is instead of being serialized.
const replacer = (value: unknown) => (isStorableObject(value) ? value : undefined);

return {
// Query types for interacting with records.
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { runQueriesWithStorageAndHooks as runQueries } from '@/src/queries';
export { processStorableObjects } from '@/src/storage';
export { processStorableObjects, isStorableObject } from '@/src/storage';
export { InvalidResponseError } from '@/src/utils/errors';

0 comments on commit 42b9691

Please sign in to comment.