Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 5, 2024
1 parent 519a288 commit a1974c0
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
name: ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
strategy:
matrix:
node:
Expand Down
14 changes: 7 additions & 7 deletions dev/lib/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,21 +390,21 @@ function createConstruct(matter) {

/**
* @param {Matter} matter
* @param {'close' | 'open'} prop
* @param {'close' | 'open'} field
* @returns {string}
*/
function fence(matter, prop) {
function fence(matter, field) {
return matter.marker
? pick(matter.marker, prop).repeat(3)
? pick(matter.marker, field).repeat(3)
: // @ts-expect-error: They’re mutually exclusive.
pick(matter.fence, prop)
pick(matter.fence, field)
}

/**
* @param {Info | string} schema
* @param {'close' | 'open'} prop
* @param {'close' | 'open'} field
* @returns {string}
*/
function pick(schema, prop) {
return typeof schema === 'string' ? schema : schema[prop]
function pick(schema, field) {
return typeof schema === 'string' ? schema : schema[field]
}
4 changes: 2 additions & 2 deletions dev/lib/to-matters.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export function toMatters(options) {
const presetsOrMatters = Array.isArray(options)
? options
: options
? [options]
: ['yaml']
? [options]
: ['yaml']

while (++index < presetsOrMatters.length) {
result[index] = matter(presetsOrMatters[index])
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"c8": "^10.0.0",
"micromark": "^4.0.0",
"micromark-build": "^2.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"prettier": "^3.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.54.0"
"xo": "^0.58.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
"test-api-dev": "node --conditions development test/index.js",
"test-api-prod": "node --conditions production test/index.js",
"test-api": "npm run test-api-dev && npm run test-api-prod",
Expand Down
96 changes: 48 additions & 48 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`frontmatter(options?)`](#frontmatteroptions)
* [`frontmatterHtml(options?)`](#frontmatterhtmloptions)
* [`toMatters(options?)`](#tomattersoptions)
* [`Info`](#info)
* [`Matter`](#matter)
* [`Options`](#options)
* [`Preset`](#preset)
* [Examples](#examples)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`frontmatter(options?)`](#frontmatteroptions)
* [`frontmatterHtml(options?)`](#frontmatterhtmloptions)
* [`toMatters(options?)`](#tomattersoptions)
* [`Info`](#info)
* [`Matter`](#matter)
* [`Options`](#options)
* [`Preset`](#preset)
* [Examples](#examples)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -122,8 +122,8 @@ Create an extension for [`micromark`][micromark] to enable frontmatter syntax.

###### Parameters

* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration
* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration

###### Returns

Expand All @@ -140,8 +140,8 @@ HTML.
###### Parameters

* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration
* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration

###### Returns

Expand All @@ -155,8 +155,8 @@ Simplify options by normalizing them to an array of matters.

###### Parameters

* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration
* `options` ([`Options`][api-options], default: `['yaml']`)
— configuration

###### Returns

Expand All @@ -170,10 +170,10 @@ Depending on how this structure is used, it reflects a marker or a fence.

###### Fields

* `open` (`string`)
— opening
* `close` (`string`)
— closing
* `open` (`string`)
— opening
* `close` (`string`)
— closing

### `Matter`

Expand All @@ -188,15 +188,15 @@ Fields describing a kind of matter (TypeScript type).
###### Fields

* `type` (`string`)
— node type to tokenize as
* `marker` (`string` or [`Info`][api-info])
— character repeated 3 times, used as complete fences
* `fence` (`string` or [`Info`][api-info])
— complete fences
* `anywhere` (`boolean`, default: `false`)
— whether matter can be found anywhere in the document, normally only
matter at the start of the document is recognized
* `type` (`string`)
— node type to tokenize as
* `marker` (`string` or [`Info`][api-info])
— character repeated 3 times, used as complete fences
* `fence` (`string` or [`Info`][api-info])
— complete fences
* `anywhere` (`boolean`, default: `false`)
— whether matter can be found anywhere in the document, normally only
matter at the start of the document is recognized

### `Options`

Expand All @@ -212,8 +212,8 @@ type Options = Array<Matter | Preset> | Matter | Preset
Known name of a frontmatter style (TypeScript type).
* `'yaml'` — [`Matter`][api-matter] defined as `{type: 'yaml', marker: '-'}`
* `'toml'` — [`Matter`][api-matter] defined as `{type: 'toml', marker: '+'}`
* `'yaml'` — [`Matter`][api-matter] defined as `{type: 'yaml', marker: '-'}`
* `'toml'` — [`Matter`][api-matter] defined as `{type: 'toml', marker: '+'}`
###### Type
Expand Down Expand Up @@ -338,10 +338,10 @@ This package is safe.

## Related

* [`remark-frontmatter`][remark-frontmatter]
— remark plugin using this to support frontmatter
* [`mdast-util-frontmatter`][mdast-util-frontmatter]
— mdast utility to support frontmatter
* [`remark-frontmatter`][remark-frontmatter]
— remark plugin using this to support frontmatter
* [`mdast-util-frontmatter`][mdast-util-frontmatter]
— mdast utility to support frontmatter

## Contribute

Expand Down

0 comments on commit a1974c0

Please sign in to comment.