Socket
Socket
Sign inDemoInstall

prosemirror-model

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-model - npm Package Compare versions

Comparing version 1.10.1 to 1.11.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.11.0 (2020-07-08)
### New features
Resolved positions have a new convenience method, `posAtIndex`, which can resolve a depth and index to a position.
## 1.10.1 (2020-07-08)

@@ -2,0 +8,0 @@

2

package.json
{
"name": "prosemirror-model",
"version": "1.10.1",
"version": "1.11.0",
"description": "ProseMirror's document model",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -123,2 +123,12 @@ import {Mark} from "./mark"

// :: (number, ?number) → number
// Get the position at the given index in the parent node at the
// given depth (which defaults to `this.depth`).
posAtIndex(index, depth) {
depth = this.resolveDepth(depth)
let node = this.path[depth * 3], pos = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1
for (let i = 0; i < index; i++) pos += node.child(i).nodeSize
return pos
}
// :: () → [Mark]

@@ -125,0 +135,0 @@ // Get the marks at this position, factoring in the surrounding

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc