Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdast-util-find-and-replace

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-find-and-replace - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

6

lib/index.d.ts

@@ -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": {

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