micromark / micromark-extension-mdxjs

Compare 9eb52b7 ... +10 ... e53ef38

Coverage Reach
index.js

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 9 files from the diff.
Other files ignored by Codecov

@@ -1,21 +1,35 @@
Loading
1 -
var acorn = require('acorn')
2 -
var acornJsx = require('acorn-jsx')
3 -
var combine = require('micromark/dist/util/combine-extensions')
4 -
var expression = require('micromark-extension-mdx-expression')
5 -
var jsx = require('micromark-extension-mdx-jsx')
6 -
var md = require('micromark-extension-mdx-md')
7 -
var esm = require('micromark-extension-mdxjs-esm')
1 +
/**
2 +
 * @typedef {import('micromark-util-types').Extension} Extension
3 +
 * @typedef {import('micromark-extension-mdx-expression').Options} Options
4 +
 */
8 5
9 -
module.exports = create
6 +
import {Parser} from 'acorn'
7 +
// @ts-expect-error: untyped
8 +
import acornJsx from 'acorn-jsx'
9 +
import {combineExtensions} from 'micromark-util-combine-extensions'
10 +
import {mdxExpression} from 'micromark-extension-mdx-expression'
11 +
import {mdxJsx} from 'micromark-extension-mdx-jsx'
12 +
import {mdxMd} from 'micromark-extension-mdx-md'
13 +
import {mdxjsEsm} from 'micromark-extension-mdxjs-esm'
10 14
11 -
function create(options) {
12 -
  var settings = Object.assign(
15 +
/**
16 +
 * @param {Options} [options]
17 +
 * @returns {Extension}
18 +
 */
19 +
export function mdxjs(options) {
20 +
  const settings = Object.assign(
13 21
    {
14 -
      acorn: acorn.Parser.extend(acornJsx()),
22 +
      acorn: Parser.extend(acornJsx()),
15 23
      acornOptions: {ecmaVersion: 2020, sourceType: 'module'},
16 24
      addResult: true
17 25
    },
18 26
    options
19 27
  )
20 -
  return combine([esm(settings), expression(settings), jsx(settings), md])
28 +
29 +
  return combineExtensions([
30 +
    mdxjsEsm(settings),
31 +
    mdxExpression(settings),
32 +
    mdxJsx(settings),
33 +
    mdxMd
34 +
  ])
21 35
}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
index.js 100.00%
Project Totals (1 files) 100.00%
Loading