backend/util.js (13 lines of code) (raw):
function backendState(backend) {
if (backend.frozen) {
throw new Error(
'Attempting to use an outdated Automerge document that has already been updated. ' +
'Please use the latest document state, or call Automerge.clone() if you really ' +
'need to use this old document state.'
)
}
return backend.state
}
module.exports = {
backendState
}