@k4a_l/dirtreeist 0.1.7 → 0.1.8
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 +16 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,8 +32,6 @@ type DirTree = DirNode[]
|
|
|
32
32
|
### TypeScript Module
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
import { parse, convert, OptionType } from 'dirTreeist'
|
|
36
|
-
|
|
37
35
|
const markdown = `
|
|
38
36
|
- /components
|
|
39
37
|
- App.tsx
|
|
@@ -43,10 +41,25 @@ const markdown = `
|
|
|
43
41
|
- converter.ts
|
|
44
42
|
- parser.ts
|
|
45
43
|
`
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import dirtreest, { Options } from '@k4a_l/dirtreeist'
|
|
48
|
+
|
|
49
|
+
const options: Options = {}
|
|
50
|
+
const outputs = dirtreest(markdown, options) // DirTree[] => output[]
|
|
51
|
+
|
|
52
|
+
console.log(outputs)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
or
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { parse, convert, Options } from '@k4a_l/dirtreeist'
|
|
46
59
|
|
|
47
60
|
const dirTrees = parse(markdown) // markdown => DirTree[]
|
|
48
61
|
|
|
49
|
-
const options:
|
|
62
|
+
const options: Options = {}
|
|
50
63
|
const outputs = dirTrees.map((dirTree) => convert(dirTree, options)) // DirTree[] => output[]
|
|
51
64
|
|
|
52
65
|
console.log(outputs)
|
package/dist/index.cjs
CHANGED
|
@@ -9918,8 +9918,8 @@ const convert = (dirTree, options) => {
|
|
|
9918
9918
|
return reduce(dirTree, buildOption(options, defaultOptions), '', 0, false);
|
|
9919
9919
|
};
|
|
9920
9920
|
|
|
9921
|
-
const dirtreest = (markdown) => {
|
|
9922
|
-
return parse(markdown).map((dirtree) => convert(dirtree));
|
|
9921
|
+
const dirtreest = (markdown, option) => {
|
|
9922
|
+
return parse(markdown).map((dirtree) => convert(dirtree, option));
|
|
9923
9923
|
};
|
|
9924
9924
|
|
|
9925
9925
|
exports.convert = convert;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parse } from './modules/parse';
|
|
2
2
|
import { convert } from './modules/convert';
|
|
3
|
-
import { DirTree } from './types/index';
|
|
4
|
-
declare const dirtreest: (markdown: string) => string[];
|
|
3
|
+
import { DirTree, Options } from './types/index';
|
|
4
|
+
declare const dirtreest: (markdown: string, option?: Options) => string[];
|
|
5
5
|
export { parse, convert };
|
|
6
6
|
export default dirtreest;
|
|
7
|
-
export type { DirTree };
|
|
7
|
+
export type { DirTree, Options };
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEhD,QAAA,MAAM,SAAS,aAAc,MAAM,WAAW,OAAO,aAEpD,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AACzB,eAAe,SAAS,CAAA;AACxB,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parse } from './modules/parse';
|
|
2
2
|
import { convert } from './modules/convert';
|
|
3
|
-
const dirtreest = (markdown) => {
|
|
4
|
-
return parse(markdown).map((dirtree) => convert(dirtree));
|
|
3
|
+
const dirtreest = (markdown, option) => {
|
|
4
|
+
return parse(markdown).map((dirtree) => convert(dirtree, option));
|
|
5
5
|
};
|
|
6
6
|
export { parse, convert };
|
|
7
7
|
export default dirtreest;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAI3C,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAI3C,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,MAAgB,EAAE,EAAE;IACvD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AACnE,CAAC,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AACzB,eAAe,SAAS,CAAA"}
|