File tree Expand file tree Collapse file tree 4 files changed +28
-10
lines changed Expand file tree Collapse file tree 4 files changed +28
-10
lines changed Original file line number Diff line number Diff line change
1
+ import { type Node } from 'unist' ;
2
+ interface CorepassOptions {
3
+ enableIcanCheck ?: boolean ;
4
+ enableSkippingIcanCheck ?: boolean ;
5
+ }
6
+ export default function remarkCorepass ( options ?: CorepassOptions ) : ( ast : Node ) => void ;
7
+ export { } ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " remark-corepass" ,
3
- "version" : " 0.1.5 " ,
3
+ "version" : " 0.1.6 " ,
4
4
"description" : " A Remark plugin to transform CorePass notations into markdown links." ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " types/index.d.ts" ,
18
18
"files" : [
19
19
" src/" ,
20
20
" dist/" ,
21
- " types/" ,
22
21
" LICENSE" ,
23
22
" README.md"
24
23
],
38
37
"license" : " CORE" ,
39
38
"dependencies" : {
40
39
"@blockchainhub/ican" : " ^0.3.0" ,
40
+ "@types/unist" : " ^3.0.2" ,
41
41
"unist-util-visit" : " ^5.0.0"
42
42
},
43
43
"devDependencies" : {
44
- "@types/node" : " ^20.9.2" ,
45
- "@types/unist" : " ^3.0.2" ,
44
+ "@types/node" : " ^20.11.24" ,
46
45
"esm" : " ^3.2.25" ,
47
46
"remark-parse" : " ^11.0.0" ,
48
47
"remark-stringify" : " ^11.0.0" ,
49
- "ts-node" : " ^10.9.1 " ,
50
- "typescript" : " ^5.2.2 " ,
51
- "undici-types" : " ^5.27 .2" ,
48
+ "ts-node" : " ^10.9.2 " ,
49
+ "typescript" : " ^5.3.3 " ,
50
+ "undici-types" : " ^6.6 .2" ,
52
51
"unified" : " ^11.0.4" ,
53
52
"uvu" : " ^0.5.6"
54
53
},
55
54
"engines" : {
56
- "node" : " >=13.2.0 "
55
+ "node" : " >=16 "
57
56
},
58
57
"exports" : {
59
58
"." : {
Original file line number Diff line number Diff line change 1
- import { Node } from 'unist' ;
1
+ import { type Node } from 'unist' ;
2
2
import { visit } from 'unist-util-visit' ;
3
3
import Ican from '@blockchainhub/ican' ;
4
4
5
5
interface CorepassOptions {
6
+ /**
7
+ * Enable ICAN check for CorePass.
8
+ */
6
9
enableIcanCheck ?: boolean ;
10
+ /**
11
+ * Enable skipping ICAN check with sign "!".
12
+ */
7
13
enableSkippingIcanCheck ?: boolean ;
8
14
}
9
15
@@ -53,6 +59,11 @@ function isTextNode(node: Node): node is TextNode {
53
59
return node . type === 'text' ;
54
60
}
55
61
62
+ /**
63
+ * A remark plugin to parse CorePass IDs (Core ID) and convert them to links.
64
+ * @param options - Options for the CorePass plugin.
65
+ * @returns A transformer for the AST.
66
+ */
56
67
export default function remarkCorepass ( options : CorepassOptions = { } ) : ( ast : Node ) => void {
57
68
const defaults : CorepassOptions = {
58
69
enableIcanCheck : true , // Enable Ican check for CorePass
Original file line number Diff line number Diff line change 5
5
"outDir" : " ./dist" ,
6
6
"strict" : true ,
7
7
"typeRoots" : [" ./node_modules/@types" , " ./types" ],
8
- "removeComments" : true
8
+ "removeComments" : true ,
9
+ "declaration" : true
9
10
},
10
11
"include" : [" src/**/*.ts" ],
11
12
"exclude" : [" node_modules" , " test" ]
You can’t perform that action at this time.
0 commit comments