prosemirror-transform
Advanced tools
Comparing version 0.22.0 to 0.22.1
@@ -173,3 +173,3 @@ var ref = require("prosemirror-model"); | ||
var $pos = doc.resolve(pos), base = $pos.depth - depth | ||
var innerType = typesAfter ? typesAfter[typesAfter.length - 1] : $pos.parent | ||
var innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent | ||
if (base < 0 || | ||
@@ -182,4 +182,4 @@ !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) || | ||
var rest = node.content.cutByIndex(index$1, node.childCount) | ||
if (typesAfter) { rest = rest.replaceChild(0, typesAfter[i + 1].type.create(typesAfter[i].attrs)) } | ||
var after = typesAfter ? typesAfter[i] : node | ||
var after = (typesAfter && typesAfter[i + 1]) || node | ||
if (after != node) { rest = rest.replaceChild(0, after.type.create(after.attrs)) } | ||
if (!node.canReplace(index$1 + 1, node.childCount) || !after.type.validContent(rest, after.attrs)) | ||
@@ -186,0 +186,0 @@ { return false } |
{ | ||
"name": "prosemirror-transform", | ||
"version": "0.22.0", | ||
"version": "0.22.1", | ||
"description": "ProseMirror document transformations", | ||
@@ -31,4 +31,4 @@ "main": "dist/index.js", | ||
"build": "rimraf dist && buble -i src -o dist", | ||
"prepublish": "npm run build" | ||
"prepare": "npm run build" | ||
} | ||
} |
@@ -155,3 +155,3 @@ const {Slice, Fragment} = require("prosemirror-model") | ||
let $pos = doc.resolve(pos), base = $pos.depth - depth | ||
let innerType = typesAfter ? typesAfter[typesAfter.length - 1] : $pos.parent | ||
let innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent | ||
if (base < 0 || | ||
@@ -164,4 +164,4 @@ !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) || | ||
let rest = node.content.cutByIndex(index, node.childCount) | ||
if (typesAfter) rest = rest.replaceChild(0, typesAfter[i + 1].type.create(typesAfter[i].attrs)) | ||
let after = typesAfter ? typesAfter[i] : node | ||
let after = (typesAfter && typesAfter[i + 1]) || node | ||
if (after != node) rest = rest.replaceChild(0, after.type.create(after.attrs)) | ||
if (!node.canReplace(index + 1, node.childCount) || !after.type.validContent(rest, after.attrs)) | ||
@@ -168,0 +168,0 @@ return false |
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
136558