Skip to content

Commit f80104f

Browse files
Merge pull request #8 from bchainhub/update/fixes-03
Update
2 parents 4bc5506 + b051fa3 commit f80104f

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

dist/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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 {};

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remark-corepass",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "A Remark plugin to transform CorePass notations into markdown links.",
55
"main": "dist/index.js",
66
"types": "types/index.d.ts",
@@ -18,7 +18,6 @@
1818
"files": [
1919
"src/",
2020
"dist/",
21-
"types/",
2221
"LICENSE",
2322
"README.md"
2423
],
@@ -38,22 +37,22 @@
3837
"license": "CORE",
3938
"dependencies": {
4039
"@blockchainhub/ican": "^0.3.0",
40+
"@types/unist": "^3.0.2",
4141
"unist-util-visit": "^5.0.0"
4242
},
4343
"devDependencies": {
44-
"@types/node": "^20.9.2",
45-
"@types/unist": "^3.0.2",
44+
"@types/node": "^20.11.24",
4645
"esm": "^3.2.25",
4746
"remark-parse": "^11.0.0",
4847
"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",
5251
"unified": "^11.0.4",
5352
"uvu": "^0.5.6"
5453
},
5554
"engines": {
56-
"node": ">=13.2.0"
55+
"node": ">=16"
5756
},
5857
"exports": {
5958
".": {

src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { Node } from 'unist';
1+
import { type Node } from 'unist';
22
import { visit } from 'unist-util-visit';
33
import Ican from '@blockchainhub/ican';
44

55
interface CorepassOptions {
6+
/**
7+
* Enable ICAN check for CorePass.
8+
*/
69
enableIcanCheck?: boolean;
10+
/**
11+
* Enable skipping ICAN check with sign "!".
12+
*/
713
enableSkippingIcanCheck?: boolean;
814
}
915

@@ -53,6 +59,11 @@ function isTextNode(node: Node): node is TextNode {
5359
return node.type === 'text';
5460
}
5561

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+
*/
5667
export default function remarkCorepass(options: CorepassOptions = {}): (ast: Node) => void {
5768
const defaults: CorepassOptions = {
5869
enableIcanCheck: true, // Enable Ican check for CorePass

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"outDir": "./dist",
66
"strict": true,
77
"typeRoots": ["./node_modules/@types", "./types"],
8-
"removeComments": true
8+
"removeComments": true,
9+
"declaration": true
910
},
1011
"include": ["src/**/*.ts"],
1112
"exclude": ["node_modules", "test"]

0 commit comments

Comments
 (0)