mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
fix benchmarks
This commit is contained in:
@@ -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 || {}),
|
||||
|
||||
Reference in New Issue
Block a user