[site/utils][s]: removed unnecessary package

This commit is contained in:
olayway 2022-05-24 09:29:08 +02:00
parent 2baae59588
commit df069f75c3
3 changed files with 8 additions and 2 deletions

6
package-lock.json generated Normal file
View File

@ -0,0 +1,6 @@
{
"name": "web3",
"lockfileVersion": 2,
"requires": true,
"packages": {}
}

1
package.json Normal file
View File

@ -0,0 +1 @@
{}

View File

@ -1,13 +1,12 @@
import { unified } from 'unified' import { unified } from 'unified'
import remarkParse from 'remark-parse' import remarkParse from 'remark-parse'
import find from 'unist-util-find'
import { toString } from 'mdast-util-to-string' import { toString } from 'mdast-util-to-string'
// get first paragraph found in the document // get first paragraph found in the document
const documentExtract = (md) => { const documentExtract = (md) => {
const mdast = unified().use(remarkParse).parse(md); const mdast = unified().use(remarkParse).parse(md);
let paragraph = find(mdast, (node) => node.type === "paragraph"); let paragraph = mdast.children.find((node) => node.type === "paragraph");
return toString(paragraph); return toString(paragraph);
} }