New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-utils

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-utils - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "prosemirror-utils",
"version": "0.0.1",
"version": "0.0.2",
"description": "Utils library for ProseMirror",

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

@@ -100,5 +100,4 @@ # Utils library for ProseMirror

- **`safeInsert`**`(content: Fragment | Node | [Node]) → fn(tr: Transaction) → ?Transaction`\
Returns an `insert` transaction that inserts a given `content` at the current cursor position if its allowed.
Otherwise it will try to find the appropriate place for such `content` in the document, looping through parent nodes up until the root document node.
- **`safeInsert`**`(node: ProseMirrorNode) → fn(tr: Transaction) → ?Transaction`\
Returns an `insert` transaction that inserts a given `node` at the current cursor position if it is allowed by schema. If schema restricts such nesting, it will try to find the appropriate place for the given `node` in the document, looping through parent nodes up until the root document node.

@@ -105,0 +104,0 @@ ## License

@@ -58,5 +58,4 @@ import { findParentNodeOfType } from "./ancestors";

// :: (content: union<Fragment, Node, [Node]>) → (tr: Transaction) → ?Transaction
// Returns an `insert` transaction that inserts a given `content` at the current cursor position if its allowed.
// Otherwise it will try to find the appropriate place for such `content` in the document, looping through parent nodes up until the root document node.
// :: (node: ProseMirrorNode) → (tr: Transaction) → ?Transaction
// Returns an `insert` transaction that inserts a given `node` at the current cursor position if it is allowed by schema. If schema restricts such nesting, it will try to find the appropriate place for the given `node` in the document, looping through parent nodes up until the root document node.
export const safeInsert = content => tr => {

@@ -63,0 +62,0 @@ const { $from } = tr.curSelection;

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