remove ts-ignore comments

This commit is contained in:
Hans Pagel
2020-10-27 22:25:45 +01:00
parent 2a706fd3d2
commit 65391c914a
2 changed files with 2 additions and 7 deletions

View File

@@ -15,8 +15,7 @@ export const ToggleMark = createExtension({
&& markIsActive(state, type) && markIsActive(state, type)
&& !markIsActive(state, type, attrs) && !markIsActive(state, type, attrs)
if (hasMarkWithDifferentAttributes) { if (attrs && hasMarkWithDifferentAttributes) {
// @ts-ignore
return commands.updateMark(type, attrs) return commands.updateMark(type, attrs)
} }

View File

@@ -3,17 +3,13 @@ import { MarkType } from 'prosemirror-model'
import getMarkAttrs from './getMarkAttrs' import getMarkAttrs from './getMarkAttrs'
export default function markHasAttributes(state: EditorState, type: MarkType, attrs?: { [key: string]: any }): boolean { export default function markHasAttributes(state: EditorState, type: MarkType, attrs?: { [key: string]: any }): boolean {
// @ts-ignore
if (attrs === undefined || Object.keys(attrs).length === 0) { if (attrs === undefined || Object.keys(attrs).length === 0) {
return true return true
} }
const originalAttrs: { [key: string]: any } = getMarkAttrs(state, type) const originalAttrs: { [key: string]: any } = getMarkAttrs(state, type)
// @ts-ignore
return Object.keys(attrs).filter((key: string) => { return Object.keys(attrs).filter((key: string) => {
// @ts-ignore
// console.log(attrs[key], originalAttrs[key], attrs[key] === originalAttrs[key])
return attrs[key] === originalAttrs[key] return attrs[key] === originalAttrs[key]
}).length }).length > 0
} }