mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
remove ts-ignore comments
This commit is contained in:
parent
2a706fd3d2
commit
65391c914a
@ -15,8 +15,7 @@ export const ToggleMark = createExtension({
|
||||
&& markIsActive(state, type)
|
||||
&& !markIsActive(state, type, attrs)
|
||||
|
||||
if (hasMarkWithDifferentAttributes) {
|
||||
// @ts-ignore
|
||||
if (attrs && hasMarkWithDifferentAttributes) {
|
||||
return commands.updateMark(type, attrs)
|
||||
}
|
||||
|
||||
|
@ -3,17 +3,13 @@ import { MarkType } from 'prosemirror-model'
|
||||
import getMarkAttrs from './getMarkAttrs'
|
||||
|
||||
export default function markHasAttributes(state: EditorState, type: MarkType, attrs?: { [key: string]: any }): boolean {
|
||||
// @ts-ignore
|
||||
if (attrs === undefined || Object.keys(attrs).length === 0) {
|
||||
return true
|
||||
}
|
||||
|
||||
const originalAttrs: { [key: string]: any } = getMarkAttrs(state, type)
|
||||
|
||||
// @ts-ignore
|
||||
return Object.keys(attrs).filter((key: string) => {
|
||||
// @ts-ignore
|
||||
// console.log(attrs[key], originalAttrs[key], attrs[key] === originalAttrs[key])
|
||||
return attrs[key] === originalAttrs[key]
|
||||
}).length
|
||||
}).length > 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user