Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 1x 1x 1x 43x 1x 2x 2x 2x | import {Model} from '../..'; import {s} from '../../../../json-crdt-patch'; export const schema = s.obj({ str: s.str('abc'), num: s.con(123), bool: s.con(true), null: s.con(null), obj: s.obj({ str: s.str('asdf'), num: s.con(1234), address: s.obj({ city: s.str<string>('New York'), zip: s.con(10001), }), }), vec: s.vec(s.con('asdf'), s.con(1234), s.con(true), s.con(null)), arr: s.arr([s.con('asdf'), s.val(s.con(0))]), bin: s.bin(new Uint8Array([1, 2, 3])), }); export const createTypedModel = () => Model.create(schema); export const createUntypedModel = () => { const doc = Model.create(); doc.api.set({ foo: 'bar', obj: { nested: { value: 42, deep: { another: 'value', }, }, }, arr: [ 1, 2, { nested: [1, 2, 3], deep: { value: 4, }, }, ], }); return doc; }; |