Socket
Socket
Sign inDemoInstall

mdast-util-definitions

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-definitions - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

2

index.d.ts

@@ -8,4 +8,4 @@ /**

): (identifier: string) => Definition | null
export type Node = import('unist').Node
export type Node = import('mdast').Root | import('mdast').Content
export type Definition = import('mdast').Definition
export type DefinitionVisitor = import('unist-util-visit').Visitor<Definition>
/**
* @typedef {import('unist').Node} Node
* @typedef {import('mdast').Root|import('mdast').Content} Node
* @typedef {import('mdast').Definition} Definition

@@ -9,3 +9,3 @@ * @typedef {import('unist-util-visit').Visitor<Definition>} DefinitionVisitor

var own = {}.hasOwnProperty
const own = {}.hasOwnProperty

@@ -18,3 +18,3 @@ /**

/** @type {Object.<string, Definition>} */
var cache = Object.create(null)
const cache = Object.create(null)

@@ -31,3 +31,3 @@ if (!node || !node.type) {

function ondefinition(definition) {
var id = clean(definition.identifier)
const id = clean(definition.identifier)
if (id && !own.call(cache, id)) {

@@ -45,3 +45,3 @@ cache[id] = definition

function getDefinition(identifier) {
var id = clean(identifier)
const id = clean(identifier)
return id && own.call(cache, id) ? cache[id] : null

@@ -48,0 +48,0 @@ }

{
"name": "mdast-util-definitions",
"version": "5.0.0",
"version": "5.1.0",
"description": "mdast utility to find definition nodes in a tree",

@@ -53,3 +53,3 @@ "license": "MIT",

"typescript": "^4.0.0",
"xo": "^0.39.0"
"xo": "^0.42.0"
},

@@ -73,8 +73,3 @@ "scripts": {

"xo": {
"prettier": true,
"rules": {
"capitalized-comments": "off",
"no-var": "off",
"prefer-arrow-callback": "off"
}
"prettier": true
},

@@ -81,0 +76,0 @@ "remarkConfig": {

@@ -29,8 +29,8 @@ # mdast-util-definitions

```js
import remark from 'remark'
import {remark} from 'remark'
import {definitions} from 'mdast-util-definitions'
var tree = remark().parse('[example]: https://example.com "Example"')
const tree = remark().parse('[example]: https://example.com "Example"')
var definition = definitions(tree)
const definition = definitions(tree)

@@ -37,0 +37,0 @@ definition('example')

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