1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-10 17:24:02 +02:00

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

* 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
2 changed files with 8 additions and 3 deletions

View File

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

View File

@@ -449,9 +449,9 @@ export const ReactEditor = {
toSlatePoint<T extends boolean>( toSlatePoint<T extends boolean>(
editor: ReactEditor, editor: ReactEditor,
domPoint: DOMPoint, domPoint: DOMPoint,
extractMatch: T exactMatch: T
): T extends true ? Point | null : Point { ): T extends true ? Point | null : Point {
const [nearestNode, nearestOffset] = extractMatch const [nearestNode, nearestOffset] = exactMatch
? domPoint ? domPoint
: normalizeDOMPoint(domPoint) : normalizeDOMPoint(domPoint)
const parentNode = nearestNode.parentNode as DOMElement const parentNode = nearestNode.parentNode as DOMElement
@@ -525,7 +525,7 @@ export const ReactEditor = {
} }
if (!textNode) { if (!textNode) {
if (extractMatch) { if (exactMatch) {
return null as T extends true ? Point | null : Point return null as T extends true ? Point | null : Point
} }
throw new Error( throw new Error(