add deep merge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Plugin, Transaction } from 'prosemirror-state'
|
||||
import { InputRule } from 'prosemirror-inputrules'
|
||||
import { Editor } from './Editor'
|
||||
import mergeDeep from './utilities/mergeDeep'
|
||||
import { GlobalAttributes } from './types'
|
||||
|
||||
export interface ExtensionConfig<Options = any, Commands = {}> {
|
||||
@@ -178,10 +179,7 @@ export class Extension<Options = any, Commands = any> {
|
||||
}
|
||||
|
||||
#configure = (options: Partial<Options>) => {
|
||||
this.options = {
|
||||
...this.config.defaultOptions,
|
||||
...options,
|
||||
}
|
||||
this.options = mergeDeep(this.config.defaultOptions, options) as Options
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user