mdast-util-find-and-replace
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -14,4 +14,4 @@ /** | ||
find: Find, | ||
replace?: Replace | undefined, | ||
options?: Options | undefined | ||
replace?: Replace, | ||
options?: Options | ||
) => Node) & | ||
@@ -21,3 +21,3 @@ (( | ||
schema: FindAndReplaceSchema | FindAndReplaceList, | ||
options?: Options | undefined | ||
options?: Options | ||
) => Node) | ||
@@ -24,0 +24,0 @@ /** |
@@ -140,2 +140,3 @@ /** | ||
const index = parent.children.indexOf(node) | ||
let change = false | ||
/** @type {Array<PhrasingContent>} */ | ||
@@ -164,5 +165,3 @@ let nodes = [] | ||
if (value === false) { | ||
position = undefined | ||
} else { | ||
if (value !== false) { | ||
if (start !== position) { | ||
@@ -182,2 +181,3 @@ nodes.push({ | ||
start = position + match[0].length | ||
change = true | ||
} | ||
@@ -192,5 +192,3 @@ | ||
if (position === undefined) { | ||
nodes = [node] | ||
} else { | ||
if (change) { | ||
if (start < node.value.length) { | ||
@@ -201,2 +199,4 @@ nodes.push({type: 'text', value: node.value.slice(start)}) | ||
parent.children.splice(index, 1, ...nodes) | ||
} else { | ||
nodes = [node] | ||
} | ||
@@ -203,0 +203,0 @@ |
{ | ||
"name": "mdast-util-find-and-replace", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "mdast utility to find and replace text in a tree", | ||
@@ -44,3 +44,3 @@ "license": "MIT", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
@@ -52,3 +52,3 @@ "rimraf": "^3.0.0", | ||
"unist-builder": "^3.0.0", | ||
"xo": "^0.49.0" | ||
"xo": "^0.50.0" | ||
}, | ||
@@ -55,0 +55,0 @@ "scripts": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
20465