nightingale-markdown-formatter 11.7.2 → 12.1.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/CHANGELOG.md +43 -0
- package/dist/index-browser.cjs.js +5 -5
- package/dist/index-browser.cjs.js.map +1 -1
- package/dist/index-browser.es.js +5 -5
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-browsermodern.es.js +5 -5
- package/dist/index-browsermodern.es.js.map +1 -1
- package/dist/{index-node12.cjs.js → index-node14.cjs.js} +6 -6
- package/dist/index-node14.cjs.js.map +1 -0
- package/dist/{index-node12.mjs → index-node14.mjs} +6 -6
- package/dist/index-node14.mjs.map +1 -0
- package/package.json +14 -58
- package/babel.config.cjs +0 -14
- package/dist/index-browser-dev.cjs.js +0 -34
- 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 -34
- 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/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.1.0](https://github.com/christophehurpeau/nightingale/compare/v12.0.1...v12.1.0) (2021-12-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [12.0.1](https://github.com/christophehurpeau/nightingale/compare/v12.0.0...v12.0.1) (2021-12-12)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [12.0.0](https://github.com/christophehurpeau/nightingale/compare/v11.9.0...v12.0.0) (2021-12-11)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Build System
|
|
26
|
+
|
|
27
|
+
* node 14 and remove dev builds ([432ecd1](https://github.com/christophehurpeau/nightingale/commit/432ecd1faafd0419f57dea00fce560e4cccc207f))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
* requires node 14
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* build all packages ([dbb4785](https://github.com/christophehurpeau/nightingale/commit/dbb4785cbb8c75942935c4a5935df32fd2e93690))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
6
49
|
## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
|
|
7
50
|
|
|
8
51
|
**Note:** Version bump only for package nightingale-markdown-formatter
|
|
@@ -10,19 +10,19 @@ function style(styles, string) {
|
|
|
10
10
|
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
return styles.reduce(function (
|
|
13
|
+
return styles.reduce(function (part, styleName) {
|
|
14
14
|
switch (styleName) {
|
|
15
15
|
case 'bold':
|
|
16
|
-
return `*${
|
|
16
|
+
return `*${part}*`;
|
|
17
17
|
|
|
18
18
|
case 'italic':
|
|
19
|
-
return `_${
|
|
19
|
+
return `_${part}_`;
|
|
20
20
|
|
|
21
21
|
case 'strikethrough':
|
|
22
|
-
return `~${
|
|
22
|
+
return `~${part}~`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return part;
|
|
26
26
|
}, string);
|
|
27
27
|
}
|
|
28
28
|
function format(record) {
|
|
@@ -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 // eslint-disable-next-line unicorn/no-array-reduce\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
|
@@ -6,19 +6,19 @@ function style(styles, string) {
|
|
|
6
6
|
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
return styles.reduce(function (
|
|
9
|
+
return styles.reduce(function (part, styleName) {
|
|
10
10
|
switch (styleName) {
|
|
11
11
|
case 'bold':
|
|
12
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
13
13
|
|
|
14
14
|
case 'italic':
|
|
15
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
16
16
|
|
|
17
17
|
case 'strikethrough':
|
|
18
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return part;
|
|
22
22
|
}, string);
|
|
23
23
|
}
|
|
24
24
|
function format(record) {
|
|
@@ -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 // eslint-disable-next-line unicorn/no-array-reduce\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;;;;"}
|
|
@@ -6,19 +6,19 @@ function style(styles, string) {
|
|
|
6
6
|
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
return styles.reduce((
|
|
9
|
+
return styles.reduce((part, styleName) => {
|
|
10
10
|
switch (styleName) {
|
|
11
11
|
case 'bold':
|
|
12
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
13
13
|
|
|
14
14
|
case 'italic':
|
|
15
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
16
16
|
|
|
17
17
|
case 'strikethrough':
|
|
18
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return part;
|
|
22
22
|
}, string);
|
|
23
23
|
}
|
|
24
24
|
function format(record) {
|
|
@@ -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 // eslint-disable-next-line unicorn/no-array-reduce\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;;;;"}
|
|
@@ -10,19 +10,19 @@ function style(styles, string) {
|
|
|
10
10
|
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
return styles.reduce((
|
|
13
|
+
return styles.reduce((part, styleName) => {
|
|
14
14
|
switch (styleName) {
|
|
15
15
|
case 'bold':
|
|
16
|
-
return `*${
|
|
16
|
+
return `*${part}*`;
|
|
17
17
|
|
|
18
18
|
case 'italic':
|
|
19
|
-
return `_${
|
|
19
|
+
return `_${part}_`;
|
|
20
20
|
|
|
21
21
|
case 'strikethrough':
|
|
22
|
-
return `~${
|
|
22
|
+
return `~${part}~`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return part;
|
|
26
26
|
}, string);
|
|
27
27
|
}
|
|
28
28
|
function format(record) {
|
|
@@ -31,4 +31,4 @@ function format(record) {
|
|
|
31
31
|
|
|
32
32
|
exports["default"] = format;
|
|
33
33
|
exports.style = style;
|
|
34
|
-
//# 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;;;;;"}
|
|
@@ -6,19 +6,19 @@ function style(styles, string) {
|
|
|
6
6
|
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
return styles.reduce((
|
|
9
|
+
return styles.reduce((part, styleName) => {
|
|
10
10
|
switch (styleName) {
|
|
11
11
|
case 'bold':
|
|
12
|
-
return `*${
|
|
12
|
+
return `*${part}*`;
|
|
13
13
|
|
|
14
14
|
case 'italic':
|
|
15
|
-
return `_${
|
|
15
|
+
return `_${part}_`;
|
|
16
16
|
|
|
17
17
|
case 'strikethrough':
|
|
18
|
-
return `~${
|
|
18
|
+
return `~${part}~`;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return part;
|
|
22
22
|
}, string);
|
|
23
23
|
}
|
|
24
24
|
function format(record) {
|
|
@@ -26,4 +26,4 @@ function format(record) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { format as default, style };
|
|
29
|
-
//# sourceMappingURL=index-
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-markdown-formatter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Nightingale Markdown formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
17
|
"type": "commonjs",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": "^
|
|
19
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
20
20
|
},
|
|
21
21
|
"browserslist": [
|
|
22
22
|
"defaults",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"not safari < 10",
|
|
26
26
|
"not ios_saf < 10"
|
|
27
27
|
],
|
|
28
|
-
"main": "./dist/index-
|
|
28
|
+
"main": "./dist/index-node14.cjs.js",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"module": "./dist/index-browser.es.js",
|
|
31
31
|
"browser": "./dist/index-browser.es.js",
|
|
@@ -33,45 +33,27 @@
|
|
|
33
33
|
"./package.json": "./package.json",
|
|
34
34
|
".": {
|
|
35
35
|
"node": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"require": "./dist/index-node12-dev.cjs.js"
|
|
39
|
-
},
|
|
40
|
-
"import": "./dist/index-node12.mjs",
|
|
41
|
-
"require": "./dist/index-node12.cjs.js"
|
|
36
|
+
"import": "./dist/index-node14.mjs",
|
|
37
|
+
"require": "./dist/index-node14.cjs.js"
|
|
42
38
|
},
|
|
43
39
|
"browser": {
|
|
44
40
|
"browser:modern": {
|
|
45
|
-
"development": {
|
|
46
|
-
"import": "./dist/index-browsermodern-dev.es.js"
|
|
47
|
-
},
|
|
48
41
|
"import": "./dist/index-browsermodern.es.js"
|
|
49
42
|
},
|
|
50
|
-
"development": {
|
|
51
|
-
"import": "./dist/index-browser-dev.es.js",
|
|
52
|
-
"require": "./dist/index-browser-dev.cjs.js"
|
|
53
|
-
},
|
|
54
43
|
"import": "./dist/index-browser.es.js",
|
|
55
44
|
"require": "./dist/index-browser.cjs.js"
|
|
56
45
|
}
|
|
57
46
|
}
|
|
58
47
|
},
|
|
59
|
-
"module:node": "./dist/index-
|
|
60
|
-
"module:node-dev": "./dist/index-node12-dev.mjs",
|
|
61
|
-
"module:browser": "./dist/index-browser.es.js",
|
|
62
|
-
"module:browser-dev": "./dist/index-browser-dev.es.js",
|
|
48
|
+
"module:node": "./dist/index-node14.mjs",
|
|
63
49
|
"module:modern-browsers": "./dist/index-browsermodern.es.js",
|
|
64
|
-
"module:modern-browsers-dev": "./dist/index-browsermodern-dev.es.js",
|
|
65
50
|
"sideEffects": false,
|
|
66
51
|
"scripts": {
|
|
67
52
|
"build": "pob-build && yarn run build:definitions",
|
|
68
53
|
"build:definitions": "tsc -p tsconfig.build.json",
|
|
69
|
-
"clean": "rm -Rf
|
|
70
|
-
"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",
|
|
71
55
|
"lint": "yarn run lint:eslint",
|
|
72
56
|
"lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-markdown-formatter",
|
|
73
|
-
"test": "jest",
|
|
74
|
-
"test:watch": "jest --watch",
|
|
75
57
|
"watch": "pob-watch"
|
|
76
58
|
},
|
|
77
59
|
"prettier": {
|
|
@@ -79,30 +61,11 @@
|
|
|
79
61
|
"singleQuote": true,
|
|
80
62
|
"arrowParens": "always"
|
|
81
63
|
},
|
|
82
|
-
"jest": {
|
|
83
|
-
"cacheDirectory": "./node_modules/.cache/jest",
|
|
84
|
-
"testMatch": [
|
|
85
|
-
"<rootDir>/src/**/__tests__/**/*.ts",
|
|
86
|
-
"<rootDir>/src/**/*.test.ts"
|
|
87
|
-
],
|
|
88
|
-
"collectCoverageFrom": [
|
|
89
|
-
"src/**/*.ts"
|
|
90
|
-
],
|
|
91
|
-
"moduleFileExtensions": [
|
|
92
|
-
"ts",
|
|
93
|
-
"js",
|
|
94
|
-
"json"
|
|
95
|
-
],
|
|
96
|
-
"transform": {
|
|
97
|
-
"^.+\\.ts$": "babel-jest"
|
|
98
|
-
},
|
|
99
|
-
"testEnvironment": "node"
|
|
100
|
-
},
|
|
101
64
|
"pob": {
|
|
102
65
|
"babelEnvs": [
|
|
103
66
|
{
|
|
104
67
|
"target": "node",
|
|
105
|
-
"version": "
|
|
68
|
+
"version": "14",
|
|
106
69
|
"formats": [
|
|
107
70
|
"cjs",
|
|
108
71
|
"es"
|
|
@@ -128,23 +91,16 @@
|
|
|
128
91
|
]
|
|
129
92
|
},
|
|
130
93
|
"dependencies": {
|
|
131
|
-
"nightingale-formatter": "
|
|
132
|
-
"nightingale-types": "
|
|
94
|
+
"nightingale-formatter": "12.1.0",
|
|
95
|
+
"nightingale-types": "12.1.0"
|
|
133
96
|
},
|
|
134
97
|
"devDependencies": {
|
|
135
98
|
"@babel/core": "7.16.0",
|
|
136
99
|
"@babel/preset-env": "7.16.4",
|
|
137
|
-
"@types/jest": "27.0.3",
|
|
138
|
-
"babel-jest": "27.3.1",
|
|
139
|
-
"babel-preset-latest-node": "5.5.1",
|
|
140
100
|
"babel-preset-modern-browsers": "15.0.2",
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"pob-lcov-reporter": "5.4.0",
|
|
145
|
-
"rollup": "2.60.1",
|
|
146
|
-
"typescript": "4.5.2",
|
|
147
|
-
"xunit-file": "1.0.0"
|
|
101
|
+
"nightingale-levels": "12.1.0",
|
|
102
|
+
"pob-babel": "29.4.2",
|
|
103
|
+
"typescript": "4.5.4"
|
|
148
104
|
},
|
|
149
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "f2f75856d32f444f0ed08b5ab903537cb1f4c38f"
|
|
150
106
|
}
|
package/babel.config.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
module.exports = function babelConfig(api) {
|
|
6
|
-
const isTest = api.env('test');
|
|
7
|
-
|
|
8
|
-
if (!isTest) return {};
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
only: [path.resolve(__dirname, 'src')],
|
|
12
|
-
presets: [require.resolve('pob-babel/preset')],
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,34 +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
|
-
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return styles.reduce(function (string, styleName) {
|
|
14
|
-
switch (styleName) {
|
|
15
|
-
case 'bold':
|
|
16
|
-
return `*${string}*`;
|
|
17
|
-
|
|
18
|
-
case 'italic':
|
|
19
|
-
return `_${string}_`;
|
|
20
|
-
|
|
21
|
-
case 'strikethrough':
|
|
22
|
-
return `~${string}~`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return string;
|
|
26
|
-
}, string);
|
|
27
|
-
}
|
|
28
|
-
function format(record) {
|
|
29
|
-
return nightingaleFormatter.formatRecordToString(record, style);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports["default"] = format;
|
|
33
|
-
exports.style = style;
|
|
34
|
-
//# 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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,UAACF,MAAD,EAASG,SAAT,EAAuB;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
|
-
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return styles.reduce(function (string, styleName) {
|
|
10
|
-
switch (styleName) {
|
|
11
|
-
case 'bold':
|
|
12
|
-
return `*${string}*`;
|
|
13
|
-
|
|
14
|
-
case 'italic':
|
|
15
|
-
return `_${string}_`;
|
|
16
|
-
|
|
17
|
-
case 'strikethrough':
|
|
18
|
-
return `~${string}~`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return string;
|
|
22
|
-
}, string);
|
|
23
|
-
}
|
|
24
|
-
function format(record) {
|
|
25
|
-
return formatRecordToString(record, style);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { format as default, 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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,SAAOD,MAAM,CAACG,MAAP,CAAc,UAACF,MAAD,EAASG,SAAT,EAAuB;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
|
-
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return styles.reduce((string, styleName) => {
|
|
10
|
-
switch (styleName) {
|
|
11
|
-
case 'bold':
|
|
12
|
-
return `*${string}*`;
|
|
13
|
-
|
|
14
|
-
case 'italic':
|
|
15
|
-
return `_${string}_`;
|
|
16
|
-
|
|
17
|
-
case 'strikethrough':
|
|
18
|
-
return `~${string}~`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return string;
|
|
22
|
-
}, string);
|
|
23
|
-
}
|
|
24
|
-
function format(record) {
|
|
25
|
-
return formatRecordToString(record, style);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { format as default, 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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,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,34 +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
|
-
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return styles.reduce((string, styleName) => {
|
|
14
|
-
switch (styleName) {
|
|
15
|
-
case 'bold':
|
|
16
|
-
return `*${string}*`;
|
|
17
|
-
|
|
18
|
-
case 'italic':
|
|
19
|
-
return `_${string}_`;
|
|
20
|
-
|
|
21
|
-
case 'strikethrough':
|
|
22
|
-
return `~${string}~`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return string;
|
|
26
|
-
}, string);
|
|
27
|
-
}
|
|
28
|
-
function format(record) {
|
|
29
|
-
return nightingaleFormatter.formatRecordToString(record, style);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports["default"] = format;
|
|
33
|
-
exports.style = style;
|
|
34
|
-
//# 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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,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
|
-
} // eslint-disable-next-line unicorn/no-array-reduce
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return styles.reduce((string, styleName) => {
|
|
10
|
-
switch (styleName) {
|
|
11
|
-
case 'bold':
|
|
12
|
-
return `*${string}*`;
|
|
13
|
-
|
|
14
|
-
case 'italic':
|
|
15
|
-
return `_${string}_`;
|
|
16
|
-
|
|
17
|
-
case 'strikethrough':
|
|
18
|
-
return `~${string}~`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return string;
|
|
22
|
-
}, string);
|
|
23
|
-
}
|
|
24
|
-
function format(record) {
|
|
25
|
-
return formatRecordToString(record, style);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { format as default, 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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,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 // eslint-disable-next-line unicorn/no-array-reduce\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,GAH2D;;;AAM5D,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;;;;"}
|