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

mdast-util-definitions

Package Overview
Dependencies
Maintainers
1
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 1.2.3 to 1.2.4

8

index.js

@@ -9,3 +9,3 @@ 'use strict'

/* Get a definition in `node` by `identifier`. */
// Get a definition in `node` by `identifier`.
function getDefinitionFactory(node, options) {

@@ -15,3 +15,3 @@ return getterFactory(gather(node, options))

/* Gather all definitions in `node` */
// Gather all definitions in `node`
function gather(node, options) {

@@ -40,7 +40,7 @@ var cache = {}

/* Factory to get a node from the given definition-cache. */
// Factory to get a node from the given definition-cache.
function getterFactory(cache) {
return getter
/* Get a node from the bound definition-cache. */
// Get a node from the bound definition-cache.
function getter(identifier) {

@@ -47,0 +47,0 @@ var id = identifier && normalise(identifier)

{
"name": "mdast-util-definitions",
"version": "1.2.3",
"version": "1.2.4",
"description": "Find definition nodes in mdast nodes",

@@ -17,5 +17,5 @@ "license": "MIT",

"bugs": "https://github.com/syntax-tree/mdast-util-definitions/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)"
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],

@@ -30,13 +30,13 @@ "files": [

"browserify": "^16.0.0",
"nyc": "^12.0.0",
"prettier": "^1.14.2",
"remark": "^9.0.0",
"remark-cli": "^5.0.0",
"remark-preset-wooorm": "^4.0.0",
"nyc": "^14.0.0",
"prettier": "^1.0.0",
"remark": "^10.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^5.0.0",
"tape": "^4.0.0",
"tinyify": "^2.4.3",
"xo": "^0.22.0"
"tinyify": "^2.0.0",
"xo": "^0.24.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
"build-bundle": "browserify . -s mdastUtilDefinitions > mdast-util-definitions.js",

@@ -43,0 +43,0 @@ "build-mangle": "browserify . -s mdastUtilDefinitions -p tinyify > mdast-util-definitions.min.js",

@@ -1,11 +0,20 @@

# mdast-util-definitions [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
# mdast-util-definitions
Get definitions in [MDAST][] nodes by `identifier`. Supports funky
keys, like `__proto__` or `toString`.
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
## Installation
[**mdast**][mdast] utility to get definitions by `identifier`.
Supports funky keys, like `__proto__` or `toString`.
## Install
[npm][]:
```bash
```sh
npm install mdast-util-definitions

@@ -20,3 +29,3 @@ ```

var ast = remark().parse('[example]: http://example.com "Example"')
var ast = remark().parse('[example]: https://example.com "Example"')

@@ -36,3 +45,3 @@ var definition = definitions(ast)

Create a cache of all `definition`s in [`node`][node].
Create a cache of all [definition][]s in [`node`][node].

@@ -42,8 +51,8 @@ ###### `options.commonmark`

`boolean`, default: false — Turn on to use CommonMark precedence: ignore
later found definitions for duplicate definitions. The default behaviour
is to prefer the last found definition.
definitions found later for duplicate definitions.
The default behaviour is to prefer the last found definition.
###### Returns
[`Function`][definition]
[`Function`][fn-definition]

@@ -54,15 +63,17 @@ ### `definition(identifier)`

* `identifier` (`string`) — Identifier of definition.
* `identifier` (`string`) — [Identifier][] of [definition][].
###### Returns
[`Node?`][node] — Definition, if found.
[`Node?`][node] — [Definition][], if found.
## Contribute
See [`contributing.md` in `syntax-tree/mdast`][contributing] for ways to get
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.
This organisation has a [Code of Conduct][coc]. By interacting with this
repository, organisation, or community you agree to abide by its terms.
This project has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

@@ -77,18 +88,38 @@ ## License

[build-status]: https://travis-ci.org/syntax-tree/mdast-util-definitions
[build]: https://travis-ci.org/syntax-tree/mdast-util-definitions
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-definitions.svg
[coverage-status]: https://codecov.io/github/syntax-tree/mdast-util-definitions
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-definitions
[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-definitions.svg
[chat]: https://gitter.im/wooorm/remark
[downloads]: https://www.npmjs.com/package/mdast-util-definitions
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-definitions.svg
[size]: https://bundlephobia.com/result?p=mdast-util-definitions
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat]: https://spectrum.chat/unified/syntax-tree
[license]: license
[author]: http://wooorm.com
[author]: https://wooorm.com
[npm]: https://docs.npmjs.com/cli/install
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
[support]: https://github.com/syntax-tree/.github/blob/master/support.md
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
[mdast]: https://github.com/syntax-tree/mdast

@@ -98,6 +129,6 @@

[definition]: #definitionidentifier
[fn-definition]: #definitionidentifier
[contributing]: https://github.com/syntax-tree/mdast/blob/master/contributing.md
[definition]: https://github.com/syntax-tree/mdast#definition
[coc]: https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
[identifier]: https://github.com/syntax-tree/mdast#association
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