nightingale-browser-console-formatter 11.5.2 → 11.7.2
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 +38 -0
- package/babel.config.cjs +14 -0
- package/dist/index-browser-dev.cjs.js +2 -3
- package/dist/index-browser-dev.cjs.js.map +1 -1
- package/dist/index-browser-dev.es.js +2 -4
- package/dist/index-browser-dev.es.js.map +1 -1
- package/dist/index-browser.cjs.js +2 -3
- package/dist/index-browser.cjs.js.map +1 -1
- package/dist/index-browser.es.js +2 -4
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-browsermodern-dev.es.js +2 -4
- package/dist/index-browsermodern-dev.es.js.map +1 -1
- package/dist/index-browsermodern.es.js +2 -4
- package/dist/index-browsermodern.es.js.map +1 -1
- package/dist/index-node12-dev.cjs.js +2 -3
- package/dist/index-node12-dev.cjs.js.map +1 -1
- package/dist/index-node12-dev.mjs +2 -4
- package/dist/index-node12-dev.mjs.map +1 -1
- package/dist/index-node12.cjs.js +2 -3
- package/dist/index-node12.cjs.js.map +1 -1
- package/dist/index-node12.mjs +2 -4
- package/dist/index-node12.mjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +24 -32
- package/rollup.config.mjs +3 -0
- package/src/.eslintrc.json +1 -1
- package/src/index.test.ts +1 -1
- package/src/index.ts +13 -12
- package/index.js +0 -6
package/.eslintrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
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
|
+
## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package nightingale-browser-console-formatter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* update pob-babel to bring back webpack 4 support ([4887431](https://github.com/christophehurpeau/nightingale/commit/4887431b3b272496511f879af022638723b9056e))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [11.7.0](https://github.com/christophehurpeau/nightingale/compare/v11.6.0...v11.7.0) (2021-03-29)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package nightingale-browser-console-formatter
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [11.6.0](https://github.com/christophehurpeau/nightingale/compare/v11.5.4...v11.6.0) (2021-03-21)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* update dependencies and browserlist config ([81d2340](https://github.com/christophehurpeau/nightingale/commit/81d234069412c746ebc99faed778092790f332ca))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [11.5.2](https://github.com/christophehurpeau/nightingale/compare/v11.5.1...v11.5.2) (2021-02-14)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package nightingale-browser-console-formatter
|
package/babel.config.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|
|
@@ -15,8 +15,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
15
15
|
});
|
|
16
16
|
args.push(htmlStyles.map(function (s) {
|
|
17
17
|
return s.open;
|
|
18
|
-
}).join('; '))
|
|
19
|
-
args.push(htmlStyles.map(function (s) {
|
|
18
|
+
}).join('; '), htmlStyles.map(function (s) {
|
|
20
19
|
return s.close;
|
|
21
20
|
}).join('; '));
|
|
22
21
|
return `%c${string}%c`;
|
|
@@ -39,6 +38,6 @@ function createBrowserConsoleFormatter(theme) {
|
|
|
39
38
|
var index = createBrowserConsoleFormatter('light');
|
|
40
39
|
|
|
41
40
|
exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
|
|
42
|
-
exports
|
|
41
|
+
exports["default"] = index;
|
|
43
42
|
exports.style = style;
|
|
44
43
|
//# sourceMappingURL=index-browser-dev.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browser-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,WAAQ,KAAIR,MAAO,IAAnB;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;AAED;;AACA,YAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;;;"}
|
|
@@ -11,8 +11,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
11
11
|
});
|
|
12
12
|
args.push(htmlStyles.map(function (s) {
|
|
13
13
|
return s.open;
|
|
14
|
-
}).join('; '))
|
|
15
|
-
args.push(htmlStyles.map(function (s) {
|
|
14
|
+
}).join('; '), htmlStyles.map(function (s) {
|
|
16
15
|
return s.close;
|
|
17
16
|
}).join('; '));
|
|
18
17
|
return `%c${string}%c`;
|
|
@@ -34,6 +33,5 @@ function createBrowserConsoleFormatter(theme) {
|
|
|
34
33
|
|
|
35
34
|
var index = createBrowserConsoleFormatter('light');
|
|
36
35
|
|
|
37
|
-
export default
|
|
38
|
-
export { createBrowserConsoleFormatter, style };
|
|
36
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
39
37
|
//# sourceMappingURL=index-browser-dev.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browser-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,WAAQ,KAAIR,MAAO,IAAnB;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;AAED;;AACA,YAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
|
@@ -15,8 +15,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
15
15
|
});
|
|
16
16
|
args.push(htmlStyles.map(function (s) {
|
|
17
17
|
return s.open;
|
|
18
|
-
}).join('; '))
|
|
19
|
-
args.push(htmlStyles.map(function (s) {
|
|
18
|
+
}).join('; '), htmlStyles.map(function (s) {
|
|
20
19
|
return s.close;
|
|
21
20
|
}).join('; '));
|
|
22
21
|
return `%c${string}%c`;
|
|
@@ -39,6 +38,6 @@ function createBrowserConsoleFormatter(theme) {
|
|
|
39
38
|
var index = createBrowserConsoleFormatter('light');
|
|
40
39
|
|
|
41
40
|
exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
|
|
42
|
-
exports
|
|
41
|
+
exports["default"] = index;
|
|
43
42
|
exports.style = style;
|
|
44
43
|
//# sourceMappingURL=index-browser.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,WAAQ,KAAIR,MAAO,IAAnB;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;AAED;;AACA,YAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;;;"}
|
package/dist/index-browser.es.js
CHANGED
|
@@ -11,8 +11,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
11
11
|
});
|
|
12
12
|
args.push(htmlStyles.map(function (s) {
|
|
13
13
|
return s.open;
|
|
14
|
-
}).join('; '))
|
|
15
|
-
args.push(htmlStyles.map(function (s) {
|
|
14
|
+
}).join('; '), htmlStyles.map(function (s) {
|
|
16
15
|
return s.close;
|
|
17
16
|
}).join('; '));
|
|
18
17
|
return `%c${string}%c`;
|
|
@@ -34,6 +33,5 @@ function createBrowserConsoleFormatter(theme) {
|
|
|
34
33
|
|
|
35
34
|
var index = createBrowserConsoleFormatter('light');
|
|
36
35
|
|
|
37
|
-
export default
|
|
38
|
-
export { createBrowserConsoleFormatter, style };
|
|
36
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
39
37
|
//# sourceMappingURL=index-browser.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,WAAQ,KAAIR,MAAO,IAAnB;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;AAED;;AACA,YAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
|
@@ -6,8 +6,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
9
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
10
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
9
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
11
10
|
return `%c${string}%c`;
|
|
12
11
|
};
|
|
13
12
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -22,6 +21,5 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
22
21
|
|
|
23
22
|
const index = createBrowserConsoleFormatter('light');
|
|
24
23
|
|
|
25
|
-
export default
|
|
26
|
-
export { createBrowserConsoleFormatter, style };
|
|
24
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
27
25
|
//# sourceMappingURL=index-browsermodern-dev.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browsermodern-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browsermodern-dev.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
|
@@ -6,8 +6,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
9
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
10
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
9
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
11
10
|
return `%c${string}%c`;
|
|
12
11
|
};
|
|
13
12
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -22,6 +21,5 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
22
21
|
|
|
23
22
|
const index = createBrowserConsoleFormatter('light');
|
|
24
23
|
|
|
25
|
-
export default
|
|
26
|
-
export { createBrowserConsoleFormatter, style };
|
|
24
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
27
25
|
//# sourceMappingURL=index-browsermodern.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
|
@@ -10,8 +10,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
13
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
14
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
13
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
15
14
|
return `%c${string}%c`;
|
|
16
15
|
};
|
|
17
16
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -27,6 +26,6 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
27
26
|
const index = createBrowserConsoleFormatter('light');
|
|
28
27
|
|
|
29
28
|
exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
|
|
30
|
-
exports
|
|
29
|
+
exports["default"] = index;
|
|
31
30
|
exports.style = style;
|
|
32
31
|
//# sourceMappingURL=index-node12-dev.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-node12-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;;;"}
|
|
@@ -6,8 +6,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
9
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
10
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
9
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
11
10
|
return `%c${string}%c`;
|
|
12
11
|
};
|
|
13
12
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -22,6 +21,5 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
22
21
|
|
|
23
22
|
const index = createBrowserConsoleFormatter('light');
|
|
24
23
|
|
|
25
|
-
export default
|
|
26
|
-
export { createBrowserConsoleFormatter, style };
|
|
24
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
27
25
|
//# sourceMappingURL=index-node12-dev.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12-dev.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-node12-dev.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
package/dist/index-node12.cjs.js
CHANGED
|
@@ -10,8 +10,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
13
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
14
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
13
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
15
14
|
return `%c${string}%c`;
|
|
16
15
|
};
|
|
17
16
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -27,6 +26,6 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
27
26
|
const index = createBrowserConsoleFormatter('light');
|
|
28
27
|
|
|
29
28
|
exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
|
|
30
|
-
exports
|
|
29
|
+
exports["default"] = index;
|
|
31
30
|
exports.style = style;
|
|
32
31
|
//# sourceMappingURL=index-node12.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-node12.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;;;"}
|
package/dist/index-node12.mjs
CHANGED
|
@@ -6,8 +6,7 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
9
|
-
args.push(htmlStyles.map(s => s.open).join('; '));
|
|
10
|
-
args.push(htmlStyles.map(s => s.close).join('; '));
|
|
9
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
11
10
|
return `%c${string}%c`;
|
|
12
11
|
};
|
|
13
12
|
function createBrowserConsoleFormatter(theme = 'light') {
|
|
@@ -22,6 +21,5 @@ function createBrowserConsoleFormatter(theme = 'light') {
|
|
|
22
21
|
|
|
23
22
|
const index = createBrowserConsoleFormatter('light');
|
|
24
23
|
|
|
25
|
-
export default
|
|
26
|
-
export { createBrowserConsoleFormatter, style };
|
|
24
|
+
export { createBrowserConsoleFormatter, index as default, style };
|
|
27
25
|
//# sourceMappingURL=index-node12.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node12.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style
|
|
1
|
+
{"version":3,"file":"index-node12.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n\n/** @deprecated use createBrowserConsoleFormatter */\nexport default createBrowserConsoleFormatter('light');\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;AAED;;AACA,cAAeY,6BAA6B,CAAC,OAAD,CAA5C;;;;"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAErE,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAErE,eAAO,MAAM,KAAK,qBACG,gBAAgB,QAAQ,MAAM,EAAE,cAC1C,MAAM,UAAU,MAAM,KAAG,MAWjC,CAAC;AAEJ,wBAAgB,6BAA6B,CAC3C,KAAK,GAAE,OAAO,GAAG,MAAgB,GAChC,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAQxD;;AAED,oDAAoD;AACpD,wBAAsD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-browser-console-formatter",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.7.2",
|
|
4
4
|
"description": "Nightingale Browser console formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -14,21 +14,23 @@
|
|
|
14
14
|
"directory": "packages/nightingale-browser-console-formatter"
|
|
15
15
|
},
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
|
+
"type": "commonjs",
|
|
17
18
|
"engines": {
|
|
18
|
-
"node": "
|
|
19
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
19
20
|
},
|
|
20
21
|
"browserslist": [
|
|
22
|
+
"defaults",
|
|
21
23
|
"> 0.2%",
|
|
22
|
-
"Firefox ESR",
|
|
23
24
|
"not ie < 12",
|
|
24
|
-
"not
|
|
25
|
-
"not
|
|
25
|
+
"not safari < 10",
|
|
26
|
+
"not ios_saf < 10"
|
|
26
27
|
],
|
|
27
|
-
"main": "./index.js",
|
|
28
|
+
"main": "./dist/index-node12.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
36
|
"development": {
|
|
@@ -67,9 +69,9 @@
|
|
|
67
69
|
"clean": "rm -Rf docs dist test/node6 coverage",
|
|
68
70
|
"generate:test-coverage": "rm -Rf docs/coverage/ ; NODE_ENV=production BABEL_ENV=test jest --coverage --coverageReporters=pob-lcov-reporter --coverageDirectory=docs/coverage/",
|
|
69
71
|
"lint": "yarn run lint:eslint",
|
|
70
|
-
"lint:eslint": "
|
|
72
|
+
"lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-browser-console-formatter",
|
|
71
73
|
"test": "jest",
|
|
72
|
-
"test:watch": "jest",
|
|
74
|
+
"test:watch": "jest --watch",
|
|
73
75
|
"watch": "pob-watch"
|
|
74
76
|
},
|
|
75
77
|
"prettier": {
|
|
@@ -126,33 +128,23 @@
|
|
|
126
128
|
]
|
|
127
129
|
},
|
|
128
130
|
"dependencies": {
|
|
129
|
-
"nightingale-formatter": "^11.
|
|
130
|
-
"nightingale-types": "^11.
|
|
131
|
+
"nightingale-formatter": "^11.7.2",
|
|
132
|
+
"nightingale-types": "^11.7.2"
|
|
131
133
|
},
|
|
132
134
|
"devDependencies": {
|
|
133
|
-
"@babel/core": "7.
|
|
134
|
-
"@babel/preset-env": "7.
|
|
135
|
-
"@
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"@types/jest": "26.0.20",
|
|
139
|
-
"@typescript-eslint/eslint-plugin": "4.15.0",
|
|
140
|
-
"@typescript-eslint/parser": "4.15.0",
|
|
141
|
-
"babel-jest": "26.6.3",
|
|
142
|
-
"babel-preset-latest-node": "5.4.0",
|
|
135
|
+
"@babel/core": "7.16.0",
|
|
136
|
+
"@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",
|
|
143
140
|
"babel-preset-modern-browsers": "15.0.2",
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"nightingale-levels": "^11.5.2",
|
|
151
|
-
"pob-babel": "26.5.0",
|
|
152
|
-
"pob-lcov-reporter": "4.0.1",
|
|
153
|
-
"rollup": "2.39.0",
|
|
154
|
-
"typescript": "4.1.5",
|
|
141
|
+
"jest": "27.3.1",
|
|
142
|
+
"nightingale-levels": "^11.7.2",
|
|
143
|
+
"pob-babel": "28.5.0",
|
|
144
|
+
"pob-lcov-reporter": "5.4.0",
|
|
145
|
+
"rollup": "2.60.1",
|
|
146
|
+
"typescript": "4.5.2",
|
|
155
147
|
"xunit-file": "1.0.0"
|
|
156
148
|
},
|
|
157
|
-
"gitHead": "
|
|
149
|
+
"gitHead": "00b1ec6c7468b320e268a12eaac70d59a177787b"
|
|
158
150
|
}
|
package/src/.eslintrc.json
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"overrides": [
|
|
11
11
|
{
|
|
12
12
|
"files": ["**/*.test.ts", "__tests__/**/*.ts"],
|
|
13
|
+
"extends": ["@pob/eslint-config-typescript/test"],
|
|
13
14
|
"env": {
|
|
14
15
|
"jest": true
|
|
15
16
|
},
|
|
16
|
-
"extends": ["@pob/eslint-config-typescript/test"],
|
|
17
17
|
"rules": {
|
|
18
18
|
"import/no-extraneous-dependencies": [
|
|
19
19
|
"error",
|
package/src/index.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StyleToHtmlStyle } from 'nightingale-formatter';
|
|
2
2
|
import { styleToHtmlStyleThemeLight } from 'nightingale-formatter';
|
|
3
|
-
import Level from 'nightingale-levels';
|
|
3
|
+
import { Level } from 'nightingale-levels';
|
|
4
4
|
import { createBrowserConsoleFormatter, style } from '.';
|
|
5
5
|
|
|
6
6
|
const styleToHtmlStyle: StyleToHtmlStyle = styleToHtmlStyleThemeLight;
|
package/src/index.ts
CHANGED
|
@@ -6,19 +6,20 @@ import {
|
|
|
6
6
|
} from 'nightingale-formatter';
|
|
7
7
|
import type { LogRecord, Metadata, Styles } from 'nightingale-types';
|
|
8
8
|
|
|
9
|
-
export const style =
|
|
10
|
-
|
|
11
|
-
string: string
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
export const style =
|
|
10
|
+
(styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>
|
|
11
|
+
(styles: Styles, string: string): string => {
|
|
12
|
+
if (!styles || styles.length === 0 || !string) {
|
|
13
|
+
return string;
|
|
14
|
+
}
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);
|
|
17
|
+
args.push(
|
|
18
|
+
htmlStyles.map((s) => s.open).join('; '),
|
|
19
|
+
htmlStyles.map((s) => s.close).join('; '),
|
|
20
|
+
);
|
|
21
|
+
return `%c${string}%c`;
|
|
22
|
+
};
|
|
22
23
|
|
|
23
24
|
export function createBrowserConsoleFormatter(
|
|
24
25
|
theme: 'light' | 'dark' = 'light',
|