1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

chore(slate-react) typo - rename extractMatch to exactMatch ()

* Fix typo - rename extractMatch to exactMatch

* update changelog

* update changelog
This commit is contained in:
Omer Gurarslan 2021-05-20 19:21:38 +03:00 committed by GitHub
parent 294d5120ae
commit ff267767f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions
.changeset
packages/slate-react/src/plugin

@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fixed typo: Renamed `toSlatePoint` argument `extractMatch` to `exactMatch`

@ -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
@ -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(