mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +02:00
fix benchmarks
This commit is contained in:
@@ -42,7 +42,9 @@ const decorations = texts.flatMap((t, index) => {
|
||||
key: t.key,
|
||||
offset: 1,
|
||||
},
|
||||
marks: [{ type: 'underline' }],
|
||||
mark: {
|
||||
type: 'underline',
|
||||
},
|
||||
},
|
||||
]
|
||||
})
|
||||
|
@@ -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