UNPKG

mudb

Version:

Real-time database for multiplayer games

23 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const __1 = require("../"); const _do_1 = require("./_do"); const dict = new __1.MuDictionary(new __1.MuUint8(), Infinity); _do_1.deltaByteLength(dict, {}, { a: 0 }); _do_1.deltaByteLength(dict, {}, { a: 0, b: 1 }); _do_1.deltaByteLength(dict, {}, { a: 0, b: 1, c: 2 }); _do_1.deltaByteLength(dict, {}, { pool: 0 }); _do_1.deltaByteLength(dict, {}, { pool: 0, preface: 1 }); _do_1.deltaByteLength(dict, {}, { pool: 0, preface: 1, prefix: 2 }); _do_1.deltaByteLength(dict, {}, { pool: 0, preface: 1, prefix: 2, prefixed: 3 }); const d0 = {}; const d1 = { a: 0, b: 0, c: 0 }; const d2 = { pool: 0, preface: 1, prefix: 2, prefixed: 3 }; _do_1.diffPatchDuration(dict, d1, d1, 1e3, 'b=t'); _do_1.diffPatchDuration(dict, d0, d1, 1e3, 'no common prefix'); _do_1.diffPatchDuration(dict, d0, d1, 1e4, 'no common prefix'); _do_1.diffPatchDuration(dict, d0, d1, 1e5, 'no common prefix'); _do_1.diffPatchDuration(dict, d0, d2, 1e3, 'common prefix'); _do_1.diffPatchDuration(dict, d0, d2, 1e4, 'common prefix'); _do_1.diffPatchDuration(dict, d0, d2, 1e5, 'common prefix'); //# sourceMappingURL=dictionary.js.map