File tree 5 files changed +31
-3
lines changed 5 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1
1
coverage /
2
2
node_modules /
3
3
.DS_Store
4
- * .d.ts
4
+ index.d.ts
5
+ test.d.ts
5
6
* .log
6
7
yarn.lock
Original file line number Diff line number Diff line change @@ -52,8 +52,9 @@ function opener(matter) {
52
52
/** @type {FromMarkdownHandle } */
53
53
function close ( token ) {
54
54
const data = this . resume ( )
55
+ const node = /** @type {Literal } */ ( this . exit ( token ) )
55
56
// Remove the initial and final eol.
56
- this . exit ( token ) . value = data . replace ( / ^ ( \r ? \n | \r ) | ( \r ? \n | \r ) $ / g, '' )
57
+ node . value = data . replace ( / ^ ( \r ? \n | \r ) | ( \r ? \n | \r ) $ / g, '' )
57
58
}
58
59
59
60
/** @type {FromMarkdownHandle } */
Original file line number Diff line number Diff line change 53
53
"xo" : " ^0.39.0"
54
54
},
55
55
"scripts" : {
56
- "build" : " rimraf \" * .d.ts\" && tsc && type-coverage" ,
56
+ "build" : " rimraf \" {index,test} .d.ts\" && tsc && type-coverage" ,
57
57
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
58
58
"test-api" : " node --conditions development test.js" ,
59
59
"test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --conditions development test.js" ,
Original file line number Diff line number Diff line change
1
+ import { Literal } from 'mdast'
2
+
3
+ interface TOML extends Literal {
4
+ type : 'toml'
5
+ }
6
+
7
+ interface JSON extends Literal {
8
+ type : 'json'
9
+ }
10
+
11
+ interface Custom extends Literal {
12
+ type : 'custom'
13
+ }
14
+
15
+ declare module 'mdast' {
16
+ // To do: this should be `FrontmatterMap`, which doesn’t exist yet.
17
+ interface BlockContentMap {
18
+ toml : TOML
19
+ custom : Custom
20
+ json : JSON
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @typedef {import('./test-types') } TOML
3
+ */
4
+
1
5
import test from 'tape'
2
6
import { fromMarkdown } from 'mdast-util-from-markdown'
3
7
import { toMarkdown } from 'mdast-util-to-markdown'
You can’t perform that action at this time.
0 commit comments