prosemirror-model
Advanced tools
Comparing version 1.7.4 to 1.7.5
@@ -0,1 +1,7 @@ | ||
## 1.7.5 (2019-11-07) | ||
### Bug fixes | ||
`ContentMatch.edge` now throws, as it is supposed to, when you try to access the edge past the last one. | ||
## 1.7.4 (2019-10-10) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-model", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -135,7 +135,7 @@ import {Fragment} from "./fragment" | ||
// :: (number) → {type: NodeType, next: ContentMatch} | ||
// Get the _n_th outgoing edge from this node in the finite | ||
// Get the _n_th outgoing edge from this node in the finite | ||
// automaton that describes the content expression. | ||
edge(n) { | ||
let i = n << 1 | ||
if (i > this.next.length) throw new RangeError(`There's no ${n}th edge in this content match`) | ||
if (i >= this.next.length) throw new RangeError(`There's no ${n}th edge in this content match`) | ||
return {type: this.next[i], next: this.next[i + 1]} | ||
@@ -142,0 +142,0 @@ } |
@@ -49,3 +49,3 @@ import {Mark} from "./mark" | ||
// the 3rd node in the 2nd paragraph on the top level, for example, | ||
// `p.index(0)` is 2 and `p.index(1)` is 3. | ||
// `p.index(0)` is 1 and `p.index(1)` is 2. | ||
index(depth) { return this.path[this.resolveDepth(depth) * 3 + 1] } | ||
@@ -52,0 +52,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
497651