nightingale-markdown-formatter 11.7.1 → 12.0.1
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 +43 -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-dev.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 +19 -71
- 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.map +0 -1
- package/dist/index-node12.cjs.js.map +0 -1
- package/dist/index-node12.mjs +0 -29
- package/dist/index-node12.mjs.map +0 -1
- package/index.js +0 -6
package/.eslintrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
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.1](https://github.com/christophehurpeau/nightingale/compare/v12.0.0...v12.0.1) (2021-12-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [12.0.0](https://github.com/christophehurpeau/nightingale/compare/v11.9.0...v12.0.0) (2021-12-11)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Build System
|
|
18
|
+
|
|
19
|
+
* node 14 and remove dev builds ([432ecd1](https://github.com/christophehurpeau/nightingale/commit/432ecd1faafd0419f57dea00fce560e4cccc207f))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* requires node 14
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* build all packages ([dbb4785](https://github.com/christophehurpeau/nightingale/commit/dbb4785cbb8c75942935c4a5935df32fd2e93690))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
6
49
|
## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
|
|
7
50
|
|
|
8
51
|
|
|
@@ -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-dev.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.1",
|
|
4
4
|
"description": "Nightingale Markdown formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -14,8 +14,9 @@
|
|
|
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": [
|
|
21
22
|
"defaults",
|
|
@@ -24,52 +25,35 @@
|
|
|
24
25
|
"not safari < 10",
|
|
25
26
|
"not ios_saf < 10"
|
|
26
27
|
],
|
|
27
|
-
"main": "./index.js",
|
|
28
|
+
"main": "./dist/index-node14.cjs.js",
|
|
28
29
|
"types": "./dist/index.d.ts",
|
|
29
30
|
"module": "./dist/index-browser.es.js",
|
|
30
31
|
"browser": "./dist/index-browser.es.js",
|
|
31
32
|
"exports": {
|
|
33
|
+
"./package.json": "./package.json",
|
|
32
34
|
".": {
|
|
33
35
|
"node": {
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"require": "./dist/index-node12-dev.cjs.js"
|
|
37
|
-
},
|
|
38
|
-
"import": "./dist/index-node12.mjs",
|
|
39
|
-
"require": "./dist/index-node12.cjs.js"
|
|
36
|
+
"import": "./dist/index-node14.mjs",
|
|
37
|
+
"require": "./dist/index-node14.cjs.js"
|
|
40
38
|
},
|
|
41
39
|
"browser": {
|
|
42
40
|
"browser:modern": {
|
|
43
|
-
"development": {
|
|
44
|
-
"import": "./dist/index-browsermodern-dev.es.js"
|
|
45
|
-
},
|
|
46
41
|
"import": "./dist/index-browsermodern.es.js"
|
|
47
42
|
},
|
|
48
|
-
"development": {
|
|
49
|
-
"import": "./dist/index-browser-dev.es.js",
|
|
50
|
-
"require": "./dist/index-browser-dev.cjs.js"
|
|
51
|
-
},
|
|
52
43
|
"import": "./dist/index-browser.es.js",
|
|
53
44
|
"require": "./dist/index-browser.cjs.js"
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
47
|
},
|
|
57
|
-
"module:node": "./dist/index-
|
|
58
|
-
"module:node-dev": "./dist/index-node12-dev.mjs",
|
|
59
|
-
"module:browser": "./dist/index-browser.es.js",
|
|
60
|
-
"module:browser-dev": "./dist/index-browser-dev.es.js",
|
|
48
|
+
"module:node": "./dist/index-node14.mjs",
|
|
61
49
|
"module:modern-browsers": "./dist/index-browsermodern.es.js",
|
|
62
|
-
"module:modern-browsers-dev": "./dist/index-browsermodern-dev.es.js",
|
|
63
50
|
"sideEffects": false,
|
|
64
51
|
"scripts": {
|
|
65
52
|
"build": "pob-build && yarn run build:definitions",
|
|
66
53
|
"build:definitions": "tsc -p tsconfig.build.json",
|
|
67
|
-
"clean": "rm -Rf
|
|
68
|
-
"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",
|
|
69
55
|
"lint": "yarn run lint:eslint",
|
|
70
|
-
"lint:eslint": "
|
|
71
|
-
"test": "jest",
|
|
72
|
-
"test:watch": "jest",
|
|
56
|
+
"lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-markdown-formatter",
|
|
73
57
|
"watch": "pob-watch"
|
|
74
58
|
},
|
|
75
59
|
"prettier": {
|
|
@@ -77,30 +61,11 @@
|
|
|
77
61
|
"singleQuote": true,
|
|
78
62
|
"arrowParens": "always"
|
|
79
63
|
},
|
|
80
|
-
"jest": {
|
|
81
|
-
"cacheDirectory": "./node_modules/.cache/jest",
|
|
82
|
-
"testMatch": [
|
|
83
|
-
"<rootDir>/src/**/__tests__/**/*.ts",
|
|
84
|
-
"<rootDir>/src/**/*.test.ts"
|
|
85
|
-
],
|
|
86
|
-
"collectCoverageFrom": [
|
|
87
|
-
"src/**/*.ts"
|
|
88
|
-
],
|
|
89
|
-
"moduleFileExtensions": [
|
|
90
|
-
"ts",
|
|
91
|
-
"js",
|
|
92
|
-
"json"
|
|
93
|
-
],
|
|
94
|
-
"transform": {
|
|
95
|
-
"^.+\\.ts$": "babel-jest"
|
|
96
|
-
},
|
|
97
|
-
"testEnvironment": "node"
|
|
98
|
-
},
|
|
99
64
|
"pob": {
|
|
100
65
|
"babelEnvs": [
|
|
101
66
|
{
|
|
102
67
|
"target": "node",
|
|
103
|
-
"version": "
|
|
68
|
+
"version": "14",
|
|
104
69
|
"formats": [
|
|
105
70
|
"cjs",
|
|
106
71
|
"es"
|
|
@@ -126,33 +91,16 @@
|
|
|
126
91
|
]
|
|
127
92
|
},
|
|
128
93
|
"dependencies": {
|
|
129
|
-
"nightingale-formatter": "
|
|
130
|
-
"nightingale-types": "
|
|
94
|
+
"nightingale-formatter": "12.0.1",
|
|
95
|
+
"nightingale-types": "12.0.1"
|
|
131
96
|
},
|
|
132
97
|
"devDependencies": {
|
|
133
|
-
"@babel/core": "7.
|
|
134
|
-
"@babel/preset-env": "7.
|
|
135
|
-
"@pob/eslint-config": "43.2.0",
|
|
136
|
-
"@pob/eslint-config-node": "43.2.0",
|
|
137
|
-
"@pob/eslint-config-typescript": "43.2.0",
|
|
138
|
-
"@types/jest": "26.0.23",
|
|
139
|
-
"@typescript-eslint/eslint-plugin": "4.28.1",
|
|
140
|
-
"@typescript-eslint/parser": "4.28.1",
|
|
141
|
-
"babel-jest": "26.6.3",
|
|
142
|
-
"babel-preset-latest-node": "5.5.1",
|
|
98
|
+
"@babel/core": "7.16.0",
|
|
99
|
+
"@babel/preset-env": "7.16.4",
|
|
143
100
|
"babel-preset-modern-browsers": "15.0.2",
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"eslint-plugin-node": "11.1.0",
|
|
148
|
-
"eslint-plugin-unicorn": "29.0.0",
|
|
149
|
-
"jest": "26.6.3",
|
|
150
|
-
"nightingale-levels": "^11.7.1",
|
|
151
|
-
"pob-babel": "27.0.3",
|
|
152
|
-
"pob-lcov-reporter": "4.0.1",
|
|
153
|
-
"rollup": "2.52.3",
|
|
154
|
-
"typescript": "4.3.4",
|
|
155
|
-
"xunit-file": "1.0.0"
|
|
101
|
+
"nightingale-levels": "12.0.1",
|
|
102
|
+
"pob-babel": "29.4.2",
|
|
103
|
+
"typescript": "4.5.3"
|
|
156
104
|
},
|
|
157
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "bb3da283ed9e19d2c1dcdb5e130c86b4835d8500"
|
|
158
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(function (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,UAACF,MAAD,EAASG,SAAT,EAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,qBAAWH,MAAX;;AACF,WAAK,QAAL;AACE,qBAAWA,MAAX;;AACF,WAAK,eAAL;AACE,qBAAWA,MAAX;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(function (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,UAACF,MAAD,EAASG,SAAT,EAAuB;AAC1C,YAAQA,SAAR;AACE,WAAK,MAAL;AACE,qBAAWH,MAAX;;AACF,WAAK,QAAL;AACE,qBAAWA,MAAX;;AACF,WAAK,eAAL;AACE,qBAAWA,MAAX;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 +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;;;;;"}
|
package/dist/index-node12.mjs
DELETED
|
@@ -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.mjs.map
|
|
@@ -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;;;;;"}
|