Skip to content

Commit

Permalink
chore(slate-react) typo - rename extractMatch to exactMatch (#4271)
Browse files Browse the repository at this point in the history
* Fix typo - rename extractMatch to exactMatch

* update changelog

* update changelog
  • Loading branch information
Omer Gurarslan authored May 20, 2021
1 parent 294d512 commit ff26776
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-falcons-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Fixed typo: Renamed `toSlatePoint` argument `extractMatch` to `exactMatch`
6 changes: 3 additions & 3 deletions packages/slate-react/src/plugin/react-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ export const ReactEditor = {
toSlatePoint<T extends boolean>(
editor: ReactEditor,
domPoint: DOMPoint,
extractMatch: T
exactMatch: T
): T extends true ? Point | null : Point {
const [nearestNode, nearestOffset] = extractMatch
const [nearestNode, nearestOffset] = exactMatch
? domPoint
: normalizeDOMPoint(domPoint)
const parentNode = nearestNode.parentNode as DOMElement
Expand Down Expand Up @@ -525,7 +525,7 @@ export const ReactEditor = {
}

if (!textNode) {
if (extractMatch) {
if (exactMatch) {
return null as T extends true ? Point | null : Point
}
throw new Error(
Expand Down

0 comments on commit ff26776

Please sign in to comment.