1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

fix benchmarks

This commit is contained in:
Ian Storm Taylor
2018-09-21 09:56:20 -07:00
parent fd1832c73f
commit da93937b19
2 changed files with 12 additions and 1 deletions

View File

@@ -106,6 +106,15 @@ class Decoration extends Record(DEFAULTS) {
static fromJSON(object) {
const { anchor, focus, mark } = object
if (!mark) {
throw new Error(
`Decorations must be created with a \`mark\`, but you passed: ${JSON.stringify(
object
)}`
)
}
const decoration = new Decoration({
anchor: Point.fromJSON(anchor || {}),
focus: Point.fromJSON(focus || {}),