add merge tests for #263

This commit is contained in:
Kevin Jahns
2020-12-07 19:47:48 +01:00
parent 972d15dda5
commit 7a45be8c88
5 changed files with 85 additions and 2 deletions

View File

@@ -72,5 +72,6 @@ export {
tryGc,
transact,
AbstractConnector,
logType
logType,
mergeUpdates
} from './internals.js'

View File

@@ -15,6 +15,7 @@ export * from './utils/Snapshot.js'
export * from './utils/StructStore.js'
export * from './utils/Transaction.js'
export * from './utils/UndoManager.js'
export * from './utils/updates.js'
export * from './utils/YEvent.js'
export * from './types/AbstractType.js'

16
src/utils/updates.js Normal file
View File

@@ -0,0 +1,16 @@
/**
* @param {Array<Uint8Array>} updates
* @return {Uint8Array}
*/
export const mergeUpdates = updates => {
return updates[0]
}
/**
* @param {Uint8Array} update
* @param {Uint8Array} sv
*/
export const diffUpdate = (update, sv) => {
return update
}