Skip to content

Commit

Permalink
fix(core): isNodeSelection, isTextSelection not always false (#3089)
Browse files Browse the repository at this point in the history
Fixes #2979.  Since the ProseMirror TypeScript upgrade, these have
always returned false, since the Selection type tree are all classes
now.
  • Loading branch information
kivikakk authored Aug 22, 2022
1 parent 2ca1a7b commit 574cd69
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 42 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/helpers/isNodeSelection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { NodeSelection } from 'prosemirror-state'

import { isObject } from '../utilities/isObject'

export function isNodeSelection(value: unknown): value is NodeSelection {
return isObject(value) && value instanceof NodeSelection
return value instanceof NodeSelection
}
4 changes: 1 addition & 3 deletions packages/core/src/helpers/isTextSelection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { TextSelection } from 'prosemirror-state'

import { isObject } from '../utilities/isObject'

export function isTextSelection(value: unknown): value is TextSelection {
return isObject(value) && value instanceof TextSelection
return value instanceof TextSelection
}
7 changes: 0 additions & 7 deletions packages/core/src/utilities/isClass.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/core/src/utilities/isObject.ts

This file was deleted.

19 changes: 0 additions & 19 deletions tests/cypress/integration/core/isClass.spec.ts

This file was deleted.

0 comments on commit 574cd69

Please sign in to comment.