Files
notification-elements-demo/node_modules/@jsonjoy.com/fs-snapshot/lib/json.js
Giuliano Silvestro 5d0c9ec7eb Initial commit: notification-elements-demo app
Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:49:19 +10:00

31 lines
1.3 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromJsonSnapshot = exports.toJsonSnapshot = exports.fromJsonSnapshotSync = exports.toJsonSnapshotSync = void 0;
const JsonEncoder_1 = require("@jsonjoy.com/json-pack/lib/json/JsonEncoder");
const JsonDecoder_1 = require("@jsonjoy.com/json-pack/lib/json/JsonDecoder");
const sync_1 = require("./sync");
const async_1 = require("./async");
const shared_1 = require("./shared");
const encoder = new JsonEncoder_1.JsonEncoder(shared_1.writer);
const decoder = new JsonDecoder_1.JsonDecoder();
const toJsonSnapshotSync = (options) => {
const snapshot = (0, sync_1.toSnapshotSync)(options);
return encoder.encode(snapshot);
};
exports.toJsonSnapshotSync = toJsonSnapshotSync;
const fromJsonSnapshotSync = (uint8, options) => {
const snapshot = decoder.read(uint8);
(0, sync_1.fromSnapshotSync)(snapshot, options);
};
exports.fromJsonSnapshotSync = fromJsonSnapshotSync;
const toJsonSnapshot = async (options) => {
const snapshot = await (0, async_1.toSnapshot)(options);
return encoder.encode(snapshot);
};
exports.toJsonSnapshot = toJsonSnapshot;
const fromJsonSnapshot = async (uint8, options) => {
const snapshot = decoder.read(uint8);
await (0, async_1.fromSnapshot)(snapshot, options);
};
exports.fromJsonSnapshot = fromJsonSnapshot;
//# sourceMappingURL=json.js.map