nightingale-markdown-formatter 11.7.0 → 12.0.0
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/.eslintrc.json +1 -1
- package/CHANGELOG.md +46 -0
- package/dist/index-browser.cjs.js +8 -7
- package/dist/index-browser.cjs.js.map +1 -1
- package/dist/index-browser.es.js +8 -8
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-browsermodern.es.js +8 -8
- package/dist/index-browsermodern.es.js.map +1 -1
- package/dist/{index-node12.cjs.js → index-node14.cjs.js} +9 -8
- package/dist/index-node14.cjs.js.map +1 -0
- package/dist/{index-node12.mjs → index-node14.mjs} +9 -9
- package/dist/index-node14.mjs.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +22 -79
- package/rollup.config.mjs +3 -0
- package/src/index.test.ts +1 -1
- package/src/index.ts +6 -5
- package/dist/index-browser-dev.cjs.js +0 -33
- package/dist/index-browser-dev.cjs.js.map +0 -1
- package/dist/index-browser-dev.es.js +0 -29
- package/dist/index-browser-dev.es.js.map +0 -1
- package/dist/index-browsermodern-dev.es.js +0 -29
- package/dist/index-browsermodern-dev.es.js.map +0 -1
- package/dist/index-node12-dev.cjs.js +0 -33
- package/dist/index-node12-dev.cjs.js.map +0 -1
- package/dist/index-node12-dev.mjs +0 -29
- package/dist/index-node12-dev.mjs.map +0 -1
- package/dist/index-node12.cjs.js.map +0 -1
- package/dist/index-node12.mjs.map +0 -1
- package/index.js +0 -6
package/.eslintrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [12.0.0](https://github.com/christophehurpeau/nightingale/compare/v11.9.0...v12.0.0) (2021-12-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Build System
|
|
10
|
+
|
|
11
|
+
* node 14 and remove dev builds ([432ecd1](https://github.com/christophehurpeau/nightingale/commit/432ecd1faafd0419f57dea00fce560e4cccc207f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* requires node 14
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* build all packages ([dbb4785](https://github.com/christophehurpeau/nightingale/commit/dbb4785cbb8c75942935c4a5935df32fd2e93690))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* update pob-babel to bring back webpack 4 support ([4887431](https://github.com/christophehurpeau/nightingale/commit/4887431b3b272496511f879af022638723b9056e))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
# [11.7.0](https://github.com/christophehurpeau/nightingale/compare/v11.6.0...v11.7.0) (2021-03-29)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
@@ -7,27 +7,28 @@ var nightingaleFormatter = require('nightingale-formatter');
|
|
|
7
7
|
function style(styles, string) {
|
|
8
8
|
if (!styles || styles.length === 0 || !string) {
|
|
9
9
|
return string;
|
|
10
|
-
}
|
|
10
|
+
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
return styles.reduce(function (part, styleName) {
|
|
13
14
|
switch (styleName) {
|
|
14
15
|
case 'bold':
|
|
15
|
-
return `*${
|
|
16
|
+
return `*${part}*`;
|
|
16
17
|
|
|
17
18
|
case 'italic':
|
|
18
|
-
return `_${
|
|
19
|
+
return `_${part}_`;
|
|
19
20
|
|
|
20
21
|
case 'strikethrough':
|
|
21
|
-
return `~${
|
|
22
|
+
return `~${part}~`;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
return
|
|
25
|
+
return part;
|
|
25
26
|
}, string);
|
|
26
27
|
}
|
|
27
28
|
function format(record) {
|
|
28
29
|
return nightingaleFormatter.formatRecordToString(record, style);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
exports
|
|
32
|
+
exports["default"] = format;
|
|
32
33
|
exports.style = style;
|
|
33
34
|
//# sourceMappingURL=index-browser.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((
|
|
1
|
+
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return styles.reduce((part, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${part}*`;\n case 'italic':\n return `_${part}_`;\n case 'strikethrough':\n return `~${part}~`;\n }\n\n return part;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","part","styleName","format","record","formatRecordToString"],"mappings":";;;;;;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,UAACC,IAAD,EAAOC,SAAP,EAAqB;AACxC,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGD,IAAK,GAAhB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;AANJ;;AASA,WAAOA,IAAP;AACD,GAXM,EAWJH,MAXI,CAAP;AAYD;AAEc,SAASK,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,yCAAoB,CAACD,MAAD,EAASR,KAAT,CAA3B;AACD;;;;;"}
|
package/dist/index-browser.es.js
CHANGED
|
@@ -3,27 +3,27 @@ import { formatRecordToString } from 'nightingale-formatter';
|
|
|
3
3
|
function style(styles, string) {
|
|
4
4
|
if (!styles || styles.length === 0 || !string) {
|
|
5
5
|
return string;
|
|
6
|
-
}
|
|
6
|
+
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
return styles.reduce(function (part, styleName) {
|
|
9
10
|
switch (styleName) {
|
|
10
11
|
case 'bold':
|
|
11
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
12
13
|
|
|
13
14
|
case 'italic':
|
|
14
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
15
16
|
|
|
16
17
|
case 'strikethrough':
|
|
17
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
return
|
|
21
|
+
return part;
|
|
21
22
|
}, string);
|
|
22
23
|
}
|
|
23
24
|
function format(record) {
|
|
24
25
|
return formatRecordToString(record, style);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export default
|
|
28
|
-
export { style };
|
|
28
|
+
export { format as default, style };
|
|
29
29
|
//# sourceMappingURL=index-browser.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((
|
|
1
|
+
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return styles.reduce((part, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${part}*`;\n case 'italic':\n return `_${part}_`;\n case 'strikethrough':\n return `~${part}~`;\n }\n\n return part;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","part","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,UAACC,IAAD,EAAOC,SAAP,EAAqB;AACxC,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGD,IAAK,GAAhB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;AANJ;;AASA,WAAOA,IAAP;AACD,GAXM,EAWJH,MAXI,CAAP;AAYD;AAEc,SAASK,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASR,KAAT,CAA3B;AACD;;;;"}
|
|
@@ -3,27 +3,27 @@ import { formatRecordToString } from 'nightingale-formatter';
|
|
|
3
3
|
function style(styles, string) {
|
|
4
4
|
if (!styles || styles.length === 0 || !string) {
|
|
5
5
|
return string;
|
|
6
|
-
}
|
|
6
|
+
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
return styles.reduce((part, styleName) => {
|
|
9
10
|
switch (styleName) {
|
|
10
11
|
case 'bold':
|
|
11
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
12
13
|
|
|
13
14
|
case 'italic':
|
|
14
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
15
16
|
|
|
16
17
|
case 'strikethrough':
|
|
17
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
return
|
|
21
|
+
return part;
|
|
21
22
|
}, string);
|
|
22
23
|
}
|
|
23
24
|
function format(record) {
|
|
24
25
|
return formatRecordToString(record, style);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export default
|
|
28
|
-
export { style };
|
|
28
|
+
export { format as default, style };
|
|
29
29
|
//# sourceMappingURL=index-browsermodern.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((
|
|
1
|
+
{"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return styles.reduce((part, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${part}*`;\n case 'italic':\n return `_${part}_`;\n case 'strikethrough':\n return `~${part}~`;\n }\n\n return part;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","part","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACC,IAAD,EAAOC,SAAP,KAAqB;AACxC,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGD,IAAK,GAAhB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;AANJ;;AASA,WAAOA,IAAP;AACD,GAXM,EAWJH,MAXI,CAAP;AAYD;AAEc,SAASK,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASR,KAAT,CAA3B;AACD;;;;"}
|
|
@@ -7,27 +7,28 @@ const nightingaleFormatter = require('nightingale-formatter');
|
|
|
7
7
|
function style(styles, string) {
|
|
8
8
|
if (!styles || styles.length === 0 || !string) {
|
|
9
9
|
return string;
|
|
10
|
-
}
|
|
10
|
+
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
return styles.reduce((part, styleName) => {
|
|
13
14
|
switch (styleName) {
|
|
14
15
|
case 'bold':
|
|
15
|
-
return `*${
|
|
16
|
+
return `*${part}*`;
|
|
16
17
|
|
|
17
18
|
case 'italic':
|
|
18
|
-
return `_${
|
|
19
|
+
return `_${part}_`;
|
|
19
20
|
|
|
20
21
|
case 'strikethrough':
|
|
21
|
-
return `~${
|
|
22
|
+
return `~${part}~`;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
return
|
|
25
|
+
return part;
|
|
25
26
|
}, string);
|
|
26
27
|
}
|
|
27
28
|
function format(record) {
|
|
28
29
|
return nightingaleFormatter.formatRecordToString(record, style);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
exports
|
|
32
|
+
exports["default"] = format;
|
|
32
33
|
exports.style = style;
|
|
33
|
-
//# sourceMappingURL=index-
|
|
34
|
+
//# sourceMappingURL=index-node14.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-node14.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return styles.reduce((part, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${part}*`;\n case 'italic':\n return `_${part}_`;\n case 'strikethrough':\n return `~${part}~`;\n }\n\n return part;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","part","styleName","format","record","formatRecordToString"],"mappings":";;;;;;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACC,IAAD,EAAOC,SAAP,KAAqB;AACxC,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGD,IAAK,GAAhB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;AANJ;;AASA,WAAOA,IAAP;AACD,GAXM,EAWJH,MAXI,CAAP;AAYD;AAEc,SAASK,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,yCAAoB,CAACD,MAAD,EAASR,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -3,27 +3,27 @@ import { formatRecordToString } from 'nightingale-formatter';
|
|
|
3
3
|
function style(styles, string) {
|
|
4
4
|
if (!styles || styles.length === 0 || !string) {
|
|
5
5
|
return string;
|
|
6
|
-
}
|
|
6
|
+
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
return styles.reduce((part, styleName) => {
|
|
9
10
|
switch (styleName) {
|
|
10
11
|
case 'bold':
|
|
11
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
12
13
|
|
|
13
14
|
case 'italic':
|
|
14
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
15
16
|
|
|
16
17
|
case 'strikethrough':
|
|
17
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
return
|
|
21
|
+
return part;
|
|
21
22
|
}, string);
|
|
22
23
|
}
|
|
23
24
|
function format(record) {
|
|
24
25
|
return formatRecordToString(record, style);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export default
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=index-node12.mjs.map
|
|
28
|
+
export { format as default, style };
|
|
29
|
+
//# sourceMappingURL=index-node14.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-node14.mjs","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n // eslint-disable-next-line unicorn/no-array-reduce\n return styles.reduce((part, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${part}*`;\n case 'italic':\n return `_${part}_`;\n case 'strikethrough':\n return `~${part}~`;\n }\n\n return part;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","part","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACC,IAAD,EAAOC,SAAP,KAAqB;AACxC,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGD,IAAK,GAAhB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,IAAK,GAAhB;AANJ;;AASA,WAAOA,IAAP;AACD,GAXM,EAWJH,MAXI,CAAP;AAYD;AAEc,SAASK,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASR,KAAT,CAA3B;AACD;;;;"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAErE,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAErE,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,SAAS,QAAQ,EAC/C,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,MAAM,CAER"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-markdown-formatter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Nightingale Markdown formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -14,67 +14,46 @@
|
|
|
14
14
|
"directory": "packages/nightingale-markdown-formatter"
|
|
15
15
|
},
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
|
+
"type": "commonjs",
|
|
17
18
|
"engines": {
|
|
18
|
-
"node": ">=
|
|
19
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
19
20
|
},
|
|
20
21
|
"browserslist": [
|
|
22
|
+
"defaults",
|
|
21
23
|
"> 0.2%",
|
|
22
|
-
"Firefox ESR",
|
|
23
|
-
"last 2 Chrome versions",
|
|
24
|
-
"last 2 iOS versions",
|
|
25
|
-
"last 2 Edge versions",
|
|
26
|
-
"last 2 Safari versions",
|
|
27
24
|
"not ie < 12",
|
|
28
|
-
"not
|
|
29
|
-
"not
|
|
30
|
-
"not op_mini all"
|
|
25
|
+
"not safari < 10",
|
|
26
|
+
"not ios_saf < 10"
|
|
31
27
|
],
|
|
32
|
-
"main": "./index.js",
|
|
28
|
+
"main": "./dist/index-node14.cjs.js",
|
|
33
29
|
"types": "./dist/index.d.ts",
|
|
34
30
|
"module": "./dist/index-browser.es.js",
|
|
35
31
|
"browser": "./dist/index-browser.es.js",
|
|
36
32
|
"exports": {
|
|
33
|
+
"./package.json": "./package.json",
|
|
37
34
|
".": {
|
|
38
35
|
"node": {
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"require": "./dist/index-node12-dev.cjs.js"
|
|
42
|
-
},
|
|
43
|
-
"import": "./dist/index-node12.mjs",
|
|
44
|
-
"require": "./dist/index-node12.cjs.js"
|
|
36
|
+
"import": "./dist/index-node14.mjs",
|
|
37
|
+
"require": "./dist/index-node14.cjs.js"
|
|
45
38
|
},
|
|
46
39
|
"browser": {
|
|
47
40
|
"browser:modern": {
|
|
48
|
-
"development": {
|
|
49
|
-
"import": "./dist/index-browsermodern-dev.es.js"
|
|
50
|
-
},
|
|
51
41
|
"import": "./dist/index-browsermodern.es.js"
|
|
52
42
|
},
|
|
53
|
-
"development": {
|
|
54
|
-
"import": "./dist/index-browser-dev.es.js",
|
|
55
|
-
"require": "./dist/index-browser-dev.cjs.js"
|
|
56
|
-
},
|
|
57
43
|
"import": "./dist/index-browser.es.js",
|
|
58
44
|
"require": "./dist/index-browser.cjs.js"
|
|
59
45
|
}
|
|
60
46
|
}
|
|
61
47
|
},
|
|
62
|
-
"module:node": "./dist/index-
|
|
63
|
-
"module:node-dev": "./dist/index-node12-dev.mjs",
|
|
64
|
-
"module:browser": "./dist/index-browser.es.js",
|
|
65
|
-
"module:browser-dev": "./dist/index-browser-dev.es.js",
|
|
48
|
+
"module:node": "./dist/index-node14.mjs",
|
|
66
49
|
"module:modern-browsers": "./dist/index-browsermodern.es.js",
|
|
67
|
-
"module:modern-browsers-dev": "./dist/index-browsermodern-dev.es.js",
|
|
68
50
|
"sideEffects": false,
|
|
69
51
|
"scripts": {
|
|
70
52
|
"build": "pob-build && yarn run build:definitions",
|
|
71
53
|
"build:definitions": "tsc -p tsconfig.build.json",
|
|
72
|
-
"clean": "rm -Rf
|
|
73
|
-
"generate:test-coverage": "rm -Rf docs/coverage/ ; NODE_ENV=production BABEL_ENV=test jest --coverage --coverageReporters=pob-lcov-reporter --coverageDirectory=docs/coverage/",
|
|
54
|
+
"clean": "rm -Rf dist",
|
|
74
55
|
"lint": "yarn run lint:eslint",
|
|
75
|
-
"lint:eslint": "
|
|
76
|
-
"test": "jest",
|
|
77
|
-
"test:watch": "jest",
|
|
56
|
+
"lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-markdown-formatter",
|
|
78
57
|
"watch": "pob-watch"
|
|
79
58
|
},
|
|
80
59
|
"prettier": {
|
|
@@ -82,30 +61,11 @@
|
|
|
82
61
|
"singleQuote": true,
|
|
83
62
|
"arrowParens": "always"
|
|
84
63
|
},
|
|
85
|
-
"jest": {
|
|
86
|
-
"cacheDirectory": "./node_modules/.cache/jest",
|
|
87
|
-
"testMatch": [
|
|
88
|
-
"<rootDir>/src/**/__tests__/**/*.ts",
|
|
89
|
-
"<rootDir>/src/**/*.test.ts"
|
|
90
|
-
],
|
|
91
|
-
"collectCoverageFrom": [
|
|
92
|
-
"src/**/*.ts"
|
|
93
|
-
],
|
|
94
|
-
"moduleFileExtensions": [
|
|
95
|
-
"ts",
|
|
96
|
-
"js",
|
|
97
|
-
"json"
|
|
98
|
-
],
|
|
99
|
-
"transform": {
|
|
100
|
-
"^.+\\.ts$": "babel-jest"
|
|
101
|
-
},
|
|
102
|
-
"testEnvironment": "node"
|
|
103
|
-
},
|
|
104
64
|
"pob": {
|
|
105
65
|
"babelEnvs": [
|
|
106
66
|
{
|
|
107
67
|
"target": "node",
|
|
108
|
-
"version": "
|
|
68
|
+
"version": "14",
|
|
109
69
|
"formats": [
|
|
110
70
|
"cjs",
|
|
111
71
|
"es"
|
|
@@ -131,33 +91,16 @@
|
|
|
131
91
|
]
|
|
132
92
|
},
|
|
133
93
|
"dependencies": {
|
|
134
|
-
"nightingale-formatter": "^
|
|
135
|
-
"nightingale-types": "^
|
|
94
|
+
"nightingale-formatter": "^12.0.0",
|
|
95
|
+
"nightingale-types": "^12.0.0"
|
|
136
96
|
},
|
|
137
97
|
"devDependencies": {
|
|
138
|
-
"@babel/core": "7.
|
|
139
|
-
"@babel/preset-env": "7.
|
|
140
|
-
"@pob/eslint-config": "43.0.0",
|
|
141
|
-
"@pob/eslint-config-node": "43.1.0",
|
|
142
|
-
"@pob/eslint-config-typescript": "43.0.0",
|
|
143
|
-
"@types/jest": "26.0.22",
|
|
144
|
-
"@typescript-eslint/eslint-plugin": "4.19.0",
|
|
145
|
-
"@typescript-eslint/parser": "4.19.0",
|
|
146
|
-
"babel-jest": "26.6.3",
|
|
147
|
-
"babel-preset-latest-node": "5.5.1",
|
|
98
|
+
"@babel/core": "7.16.0",
|
|
99
|
+
"@babel/preset-env": "7.16.4",
|
|
148
100
|
"babel-preset-modern-browsers": "15.0.2",
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"eslint-plugin-node": "11.1.0",
|
|
153
|
-
"eslint-plugin-unicorn": "25.0.1",
|
|
154
|
-
"jest": "26.6.3",
|
|
155
|
-
"nightingale-levels": "^11.7.0",
|
|
156
|
-
"pob-babel": "26.8.0",
|
|
157
|
-
"pob-lcov-reporter": "4.0.1",
|
|
158
|
-
"rollup": "2.43.1",
|
|
159
|
-
"typescript": "4.2.3",
|
|
160
|
-
"xunit-file": "1.0.0"
|
|
101
|
+
"nightingale-levels": "^12.0.0",
|
|
102
|
+
"pob-babel": "29.3.0",
|
|
103
|
+
"typescript": "4.5.3"
|
|
161
104
|
},
|
|
162
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "682f57fa30eaca9732681d16008abb2680b24174"
|
|
163
106
|
}
|
package/src/index.test.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,17 +6,18 @@ export function style(styles: Styles, string: string): string {
|
|
|
6
6
|
return string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
10
|
+
return styles.reduce((part, styleName) => {
|
|
10
11
|
switch (styleName) {
|
|
11
12
|
case 'bold':
|
|
12
|
-
return `*${
|
|
13
|
+
return `*${part}*`;
|
|
13
14
|
case 'italic':
|
|
14
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
15
16
|
case 'strikethrough':
|
|
16
|
-
return `~${
|
|
17
|
+
return `~${part}~`;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
return
|
|
20
|
+
return part;
|
|
20
21
|
}, string);
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var nightingaleFormatter = require('nightingale-formatter');
|
|
6
|
-
|
|
7
|
-
function style(styles, string) {
|
|
8
|
-
if (!styles || styles.length === 0 || !string) {
|
|
9
|
-
return string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return styles.reduce((string, styleName) => {
|
|
13
|
-
switch (styleName) {
|
|
14
|
-
case 'bold':
|
|
15
|
-
return `*${string}*`;
|
|
16
|
-
|
|
17
|
-
case 'italic':
|
|
18
|
-
return `_${string}_`;
|
|
19
|
-
|
|
20
|
-
case 'strikethrough':
|
|
21
|
-
return `~${string}~`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return string;
|
|
25
|
-
}, string);
|
|
26
|
-
}
|
|
27
|
-
function format(record) {
|
|
28
|
-
return nightingaleFormatter.formatRecordToString(record, style);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
exports.default = format;
|
|
32
|
-
exports.style = style;
|
|
33
|
-
//# sourceMappingURL=index-browser-dev.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;;;;;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,yCAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { formatRecordToString } from 'nightingale-formatter';
|
|
2
|
-
|
|
3
|
-
function style(styles, string) {
|
|
4
|
-
if (!styles || styles.length === 0 || !string) {
|
|
5
|
-
return string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return styles.reduce((string, styleName) => {
|
|
9
|
-
switch (styleName) {
|
|
10
|
-
case 'bold':
|
|
11
|
-
return `*${string}*`;
|
|
12
|
-
|
|
13
|
-
case 'italic':
|
|
14
|
-
return `_${string}_`;
|
|
15
|
-
|
|
16
|
-
case 'strikethrough':
|
|
17
|
-
return `~${string}~`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return string;
|
|
21
|
-
}, string);
|
|
22
|
-
}
|
|
23
|
-
function format(record) {
|
|
24
|
-
return formatRecordToString(record, style);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default format;
|
|
28
|
-
export { style };
|
|
29
|
-
//# sourceMappingURL=index-browser-dev.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { formatRecordToString } from 'nightingale-formatter';
|
|
2
|
-
|
|
3
|
-
function style(styles, string) {
|
|
4
|
-
if (!styles || styles.length === 0 || !string) {
|
|
5
|
-
return string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return styles.reduce((string, styleName) => {
|
|
9
|
-
switch (styleName) {
|
|
10
|
-
case 'bold':
|
|
11
|
-
return `*${string}*`;
|
|
12
|
-
|
|
13
|
-
case 'italic':
|
|
14
|
-
return `_${string}_`;
|
|
15
|
-
|
|
16
|
-
case 'strikethrough':
|
|
17
|
-
return `~${string}~`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return string;
|
|
21
|
-
}, string);
|
|
22
|
-
}
|
|
23
|
-
function format(record) {
|
|
24
|
-
return formatRecordToString(record, style);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default format;
|
|
28
|
-
export { style };
|
|
29
|
-
//# sourceMappingURL=index-browsermodern-dev.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browsermodern-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const nightingaleFormatter = require('nightingale-formatter');
|
|
6
|
-
|
|
7
|
-
function style(styles, string) {
|
|
8
|
-
if (!styles || styles.length === 0 || !string) {
|
|
9
|
-
return string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return styles.reduce((string, styleName) => {
|
|
13
|
-
switch (styleName) {
|
|
14
|
-
case 'bold':
|
|
15
|
-
return `*${string}*`;
|
|
16
|
-
|
|
17
|
-
case 'italic':
|
|
18
|
-
return `_${string}_`;
|
|
19
|
-
|
|
20
|
-
case 'strikethrough':
|
|
21
|
-
return `~${string}~`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return string;
|
|
25
|
-
}, string);
|
|
26
|
-
}
|
|
27
|
-
function format(record) {
|
|
28
|
-
return nightingaleFormatter.formatRecordToString(record, style);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
exports.default = format;
|
|
32
|
-
exports.style = style;
|
|
33
|
-
//# sourceMappingURL=index-node12-dev.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;;;;;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,yCAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { formatRecordToString } from 'nightingale-formatter';
|
|
2
|
-
|
|
3
|
-
function style(styles, string) {
|
|
4
|
-
if (!styles || styles.length === 0 || !string) {
|
|
5
|
-
return string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return styles.reduce((string, styleName) => {
|
|
9
|
-
switch (styleName) {
|
|
10
|
-
case 'bold':
|
|
11
|
-
return `*${string}*`;
|
|
12
|
-
|
|
13
|
-
case 'italic':
|
|
14
|
-
return `_${string}_`;
|
|
15
|
-
|
|
16
|
-
case 'strikethrough':
|
|
17
|
-
return `~${string}~`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return string;
|
|
21
|
-
}, string);
|
|
22
|
-
}
|
|
23
|
-
function format(record) {
|
|
24
|
-
return formatRecordToString(record, style);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default format;
|
|
28
|
-
export { style };
|
|
29
|
-
//# sourceMappingURL=index-node12-dev.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12-dev.mjs","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;;;;;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,yCAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12.mjs","sources":["../src/index.ts"],"sourcesContent":["import { formatRecordToString } from 'nightingale-formatter';\nimport type { Styles, LogRecord, Metadata } from 'nightingale-types';\n\nexport function style(styles: Styles, string: string): string {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n return styles.reduce((string, styleName) => {\n switch (styleName) {\n case 'bold':\n return `*${string}*`;\n case 'italic':\n return `_${string}_`;\n case 'strikethrough':\n return `~${string}~`;\n }\n\n return string;\n }, string);\n}\n\nexport default function format<T extends Metadata>(\n record: LogRecord<T>,\n): string {\n return formatRecordToString(record, style);\n}\n"],"names":["style","styles","string","length","reduce","styleName","format","record","formatRecordToString"],"mappings":";;AAGO,SAASA,KAAT,CAAeC,MAAf,EAA+BC,MAA/B,EAAuD;AAC5D,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,SAAOD,MAAM,CAACG,MAAP,CAAc,CAACF,MAAD,EAASG,SAAT,KAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,eAAQ,IAAGH,MAAO,GAAlB;;AACF,WAAK,QAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;;AACF,WAAK,eAAL;AACE,eAAQ,IAAGA,MAAO,GAAlB;AANJ;;AASA,WAAOA,MAAP;AACD,GAXM,EAWJA,MAXI,CAAP;AAYD;AAEc,SAASI,MAAT,CACbC,MADa,EAEL;AACR,SAAOC,oBAAoB,CAACD,MAAD,EAASP,KAAT,CAA3B;AACD;;;;;"}
|