Skip to content

Commit

Permalink
[#6] Use named export
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeinhardt committed Nov 14, 2021
1 parent 8a99908 commit a654642
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
import Chance from "chance";
import { u } from "unist-builder";

import convert from ".";
import { fromADF as convert } from ".";

const seed = process.env.SEED;
const random = seed ? new Chance(seed) : new Chance();
Expand Down
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function assert(value: unknown, message = ""): asserts value {
if (!value) throw new AssertionError(message);
}

export default function convert(doc: ADFDoc): MDASTRoot {
function convert(doc: ADFDoc): MDASTRoot {
assert(doc.version === 1, `unknown document version ${doc.version}`);

const tree: MDASTRoot = u("root", []);
Expand All @@ -290,3 +290,5 @@ export default function convert(doc: ADFDoc): MDASTRoot {

return tree;
}

export const fromADF = convert;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdast-util-from-adf",
"version": "1.1.0",
"version": "2.0.0-pre",
"description": "Convert from Atlassian Document Format to Markdown Abstract Syntax Tree",
"license": "MIT",
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ npm install mdast-util-from-adf
Say we have the following script, `example.js`:

```js
import fromADF from "mdast-util-from-adf";
import { fromADF } from "mdast-util-from-adf";
import { toMarkdown } from "mdast-util-to-markdown";

const doc = {
Expand Down

0 comments on commit a654642

Please sign in to comment.