@k4a_l/dirtreeist 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/constants/constant.d.ts +7 -0
- package/dist/constants/constant.d.ts.map +1 -0
- package/dist/constants/constant.js +31 -0
- package/dist/constants/constant.js.map +1 -0
- package/dist/index.cjs +9922 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/modules/convert.d.ts +2 -1
- package/dist/modules/convert.d.ts.map +1 -1
- package/dist/modules/convert.js +43 -5
- package/dist/modules/convert.js.map +1 -1
- package/dist/modules/options.d.ts +4 -0
- package/dist/modules/options.d.ts.map +1 -0
- package/dist/modules/options.js +18 -0
- package/dist/modules/options.js.map +1 -0
- package/dist/modules/parse.d.ts +2 -1
- package/dist/modules/parse.d.ts.map +1 -1
- package/dist/modules/parse.js +36 -5
- package/dist/modules/parse.js.map +1 -1
- package/dist/types/index.d.ts +15 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -2
- package/package.json +18 -4
- package/rollup.config.js +21 -0
- package/vitest.config.d.ts +3 -0
- package/vitest.config.ts +0 -10
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ type DirTree = DirNode[]
|
|
|
32
32
|
### TypeScript Module
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
import { parse,
|
|
35
|
+
import { parse, convert, OptionType } from 'dirTreeist'
|
|
36
36
|
|
|
37
37
|
const markdown = `
|
|
38
38
|
- /components
|
|
@@ -47,7 +47,7 @@ const markdown = `
|
|
|
47
47
|
const dirTrees = parse(markdown) // markdown => DirTree[]
|
|
48
48
|
|
|
49
49
|
const options: OptionType = {}
|
|
50
|
-
const outputs = dirTrees.map((dirTree) =>
|
|
50
|
+
const outputs = dirTrees.map((dirTree) => convert(dirTree, options)) // DirTree[] => output[]
|
|
51
51
|
|
|
52
52
|
console.log(outputs)
|
|
53
53
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../src/constants/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE9C,QAAA,MAAM,UAAU,EAAE;KACf,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,SAAS;CAuB5C,CAAA;AAED,QAAA,MAAM,cAAc,EAAE,WAKrB,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const symbolSets = {
|
|
2
|
+
normal: {
|
|
3
|
+
vertical: '│',
|
|
4
|
+
horizontal: '─',
|
|
5
|
+
crossing: '├',
|
|
6
|
+
end: '└',
|
|
7
|
+
space: ' ',
|
|
8
|
+
},
|
|
9
|
+
bold: {
|
|
10
|
+
vertical: '┃',
|
|
11
|
+
horizontal: '━',
|
|
12
|
+
crossing: '┣',
|
|
13
|
+
end: '┗',
|
|
14
|
+
space: ' ',
|
|
15
|
+
},
|
|
16
|
+
ascii: {
|
|
17
|
+
vertical: '|',
|
|
18
|
+
horizontal: '-',
|
|
19
|
+
crossing: '+',
|
|
20
|
+
end: '+',
|
|
21
|
+
space: ' ',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const defaultOptions = {
|
|
25
|
+
treeType: 'normal',
|
|
26
|
+
spaceBeforeName: false,
|
|
27
|
+
spaceSize: 2,
|
|
28
|
+
emptyBeforeUpperHierarche: false,
|
|
29
|
+
};
|
|
30
|
+
export { symbolSets, defaultOptions };
|
|
31
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/constants/constant.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAEZ;IACF,MAAM,EAAE;QACN,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,GAAG;QACb,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,IAAI;KACZ;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,GAAG;QACb,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,IAAI;KACZ;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,GAAG;QACb,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;KACX;CACF,CAAA;AAED,MAAM,cAAc,GAAgB;IAClC,QAAQ,EAAE,QAAQ;IAClB,eAAe,EAAE,KAAK;IACtB,SAAS,EAAE,CAAC;IACZ,yBAAyB,EAAE,KAAK;CACjC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|