fix toJSON value
This commit is contained in:
parent
b9ccbb2dc7
commit
a77221ffd2
@ -2,7 +2,6 @@
|
|||||||
* @module YArray
|
* @module YArray
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useSearchMarker } from 'tests/testHelper.js'
|
|
||||||
import {
|
import {
|
||||||
YEvent,
|
YEvent,
|
||||||
AbstractType,
|
AbstractType,
|
||||||
@ -10,6 +9,7 @@ import {
|
|||||||
callTypeObservers,
|
callTypeObservers,
|
||||||
transact,
|
transact,
|
||||||
ListIterator,
|
ListIterator,
|
||||||
|
useSearchMarker,
|
||||||
UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line
|
UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line
|
||||||
} from '../internals.js'
|
} from '../internals.js'
|
||||||
|
|
||||||
|
@ -430,6 +430,6 @@ const sliceArrayContent = (itemcontent, start, len) => {
|
|||||||
* @param {Array<any>} added
|
* @param {Array<any>} added
|
||||||
*/
|
*/
|
||||||
const concatArrayContent = (content, added) => {
|
const concatArrayContent = (content, added) => {
|
||||||
content.push(added)
|
content.push(...added)
|
||||||
return content
|
return content
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ export const testToJSON = tc => {
|
|||||||
|
|
||||||
const arr = doc.getArray('array')
|
const arr = doc.getArray('array')
|
||||||
arr.push(['test1'])
|
arr.push(['test1'])
|
||||||
|
t.compare(arr.toJSON(), ['test1'])
|
||||||
|
|
||||||
const map = doc.getMap('map')
|
const map = doc.getMap('map')
|
||||||
map.set('k1', 'v1')
|
map.set('k1', 'v1')
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { init, compare, applyRandomTests, Doc } from './testHelper.js' // eslint-disable-line
|
import { init, compare, applyRandomTests, Doc, UndoManager } from './testHelper.js' // eslint-disable-line
|
||||||
|
|
||||||
import * as Y from '../src/index.js'
|
import * as Y from '../src/index.js'
|
||||||
import * as t from 'lib0/testing'
|
import * as t from 'lib0/testing'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user