@portabletext/toolkit
Advanced tools
+2
-3
@@ -56,3 +56,2 @@ "use strict"; | ||
| function buildMarksTree(block) { | ||
| var _a; | ||
| const { children } = block, markDefs = block.markDefs ?? []; | ||
@@ -75,3 +74,3 @@ if (!children || !children.length) | ||
| for (pos; pos < nodeStack.length; pos++) { | ||
| const mark = ((_a = nodeStack[pos]) == null ? void 0 : _a.markKey) || "", index = marksNeeded.indexOf(mark); | ||
| const mark = nodeStack[pos]?.markKey || "", index = marksNeeded.indexOf(mark); | ||
| if (index === -1) | ||
@@ -85,3 +84,3 @@ break; | ||
| for (const markKey of marksNeeded) { | ||
| const markDef = markDefs == null ? void 0 : markDefs.find((def) => def._key === markKey), markType = markDef ? markDef._type : markKey, node = { | ||
| const markDef = markDefs?.find((def) => def._key === markKey), markType = markDef ? markDef._type : markKey, node = { | ||
| _type: "@span", | ||
@@ -88,0 +87,0 @@ _key: span._key, |
+2
-3
@@ -54,3 +54,2 @@ function isPortableTextSpan(node) { | ||
| function buildMarksTree(block) { | ||
| var _a; | ||
| const { children } = block, markDefs = block.markDefs ?? []; | ||
@@ -73,3 +72,3 @@ if (!children || !children.length) | ||
| for (pos; pos < nodeStack.length; pos++) { | ||
| const mark = ((_a = nodeStack[pos]) == null ? void 0 : _a.markKey) || "", index = marksNeeded.indexOf(mark); | ||
| const mark = nodeStack[pos]?.markKey || "", index = marksNeeded.indexOf(mark); | ||
| if (index === -1) | ||
@@ -83,3 +82,3 @@ break; | ||
| for (const markKey of marksNeeded) { | ||
| const markDef = markDefs == null ? void 0 : markDefs.find((def) => def._key === markKey), markType = markDef ? markDef._type : markKey, node = { | ||
| const markDef = markDefs?.find((def) => def._key === markKey), markType = markDef ? markDef._type : markKey, node = { | ||
| _type: "@span", | ||
@@ -86,0 +85,0 @@ _key: span._key, |
+3
-6
| { | ||
| "name": "@portabletext/toolkit", | ||
| "version": "3.0.1", | ||
| "version": "3.0.2", | ||
| "description": "Toolkit of handy utility functions for dealing with Portable Text", | ||
@@ -42,6 +42,3 @@ "keywords": [ | ||
| ], | ||
| "browserslist": [ | ||
| "extends @sanity/browserslist-config", | ||
| "node 14" | ||
| ], | ||
| "browserslist": "extends @sanity/browserslist-config", | ||
| "prettier": "@sanity/prettier-config", | ||
@@ -89,3 +86,3 @@ "eslintConfig": { | ||
| "engines": { | ||
| "node": "^14.13.1 || >=16.0.0" | ||
| "node": ">=20.19 <22 || >=22.12" | ||
| }, | ||
@@ -92,0 +89,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
134368
-0.19%1495
-0.13%1
Infinity%