Skip to content

Commit

Permalink
avoid casting
Browse files Browse the repository at this point in the history
  • Loading branch information
gethari committed Feb 13, 2023
1 parent f82c85c commit 50b95b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/commands/toggleList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { canJoin } from '@tiptap/pm/transform'
import { findParentNode } from '../helpers/findParentNode'
import { getNodeType } from '../helpers/getNodeType'
import { isList } from '../helpers/isList'
import { Mark } from '../Mark'
import { RawCommands } from '../types'

const joinListBackwards = (tr: Transaction, listType: NodeType): boolean => {
Expand Down Expand Up @@ -79,7 +78,7 @@ export const toggleList: RawCommands['toggleList'] = (listTypeOrName, itemTypeOr
const { $from, $to } = selection
const range = $from.blockRange($to)

const marks = storedMarks || (selection.$to.parentOffset && selection.$from.marks()) as Mark[]
const marks = storedMarks || (selection.$to.parentOffset && selection.$from.marks())

if (!range) {
return false
Expand Down

0 comments on commit 50b95b9

Please sign in to comment.