From 65391c914a916a0288a86ac2b8f1080251af3302 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 27 Oct 2020 22:25:45 +0100 Subject: [PATCH] remove ts-ignore comments --- packages/core/src/extensions/toggleMark.ts | 3 +-- packages/core/src/utils/markHasAttributes.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/core/src/extensions/toggleMark.ts b/packages/core/src/extensions/toggleMark.ts index 9b25cb870..34371adb4 100644 --- a/packages/core/src/extensions/toggleMark.ts +++ b/packages/core/src/extensions/toggleMark.ts @@ -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) } diff --git a/packages/core/src/utils/markHasAttributes.ts b/packages/core/src/utils/markHasAttributes.ts index 415f90840..e07d1305f 100644 --- a/packages/core/src/utils/markHasAttributes.ts +++ b/packages/core/src/utils/markHasAttributes.ts @@ -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 }