@kcuf/sls-logger-base 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/coverage/clover.xml +170 -180
- package/coverage/coverage-final.json +10 -10
- package/coverage/index.html +9 -9
- package/coverage/src/class/index.html +1 -1
- package/coverage/src/class/index.ts.html +1 -1
- package/coverage/src/class/sls-logger.ts.html +59 -59
- package/coverage/src/class/sls-pipe.ts.html +36 -36
- package/coverage/src/const/index.html +1 -1
- package/coverage/src/const/index.ts.html +1 -1
- package/coverage/src/factory/create-logger.ts.html +1 -1
- package/coverage/src/factory/generate-create-logger.ts.html +11 -17
- package/coverage/src/factory/index.html +5 -5
- package/coverage/src/index.html +1 -1
- package/coverage/src/index.ts.html +1 -1
- package/coverage/src/util/build-post-body.ts.html +14 -14
- package/coverage/src/util/convert-error-to-plain.ts.html +1 -1
- package/coverage/src/util/convert-log-info.ts.html +19 -19
- package/coverage/src/util/create-sls-log-quick.ts.html +1 -1
- package/coverage/src/util/flatten-object.ts.html +65 -50
- package/coverage/src/util/{flatten-should-ignore.ts.html → flatten-test-path.ts.html} +17 -59
- package/coverage/src/util/get-log-once-key.ts.html +6 -6
- package/coverage/src/util/get-silent-countdown.ts.html +1 -1
- package/coverage/src/util/index.html +12 -12
- package/coverage/src/util/index.ts.html +2 -2
- package/coverage/src/util/merge-default-params.ts.html +1 -1
- package/coverage/src/util/{merge-should-ignore.ts.html → merge-dont-send.ts.html} +8 -8
- package/coverage/src/util/resolve-default-params.ts.html +4 -4
- package/dist/cjs/class/sls-logger.js +11 -11
- package/dist/cjs/factory/generate-create-logger.js +4 -4
- package/dist/cjs/util/flatten-object.js +16 -11
- package/dist/cjs/util/flatten-test-path.js +11 -0
- package/dist/cjs/util/index.js +3 -3
- package/dist/cjs/util/merge-dont-send.js +14 -0
- package/dist/esm/class/sls-logger.js +11 -11
- package/dist/esm/class/sls-logger.js.map +1 -1
- package/dist/esm/factory/generate-create-logger.js +5 -5
- package/dist/esm/factory/generate-create-logger.js.map +1 -1
- package/dist/esm/types/common.js.map +1 -1
- package/dist/esm/types/options.js.map +1 -1
- package/dist/esm/util/flatten-object.js +16 -11
- package/dist/esm/util/flatten-object.js.map +1 -1
- package/dist/esm/util/flatten-test-path.js +6 -0
- package/dist/esm/util/flatten-test-path.js.map +1 -0
- package/dist/esm/util/index.js +1 -1
- package/dist/esm/util/index.js.map +1 -1
- package/dist/esm/util/merge-dont-send.js +9 -0
- package/dist/esm/util/merge-dont-send.js.map +1 -0
- package/dist/types/class/sls-logger.d.ts +1 -1
- package/dist/types/factory/generate-create-logger.d.ts +1 -1
- package/dist/types/types/common.d.ts +2 -12
- package/dist/types/types/options.d.ts +19 -12
- package/dist/types/util/flatten-object.d.ts +2 -2
- package/dist/types/util/flatten-test-path.d.ts +2 -0
- package/dist/types/util/index.d.ts +1 -1
- package/dist/types/util/merge-dont-send.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/util/flatten-should-ignore.js +0 -22
- package/dist/cjs/util/merge-should-ignore.js +0 -14
- package/dist/esm/util/flatten-should-ignore.js +0 -17
- package/dist/esm/util/flatten-should-ignore.js.map +0 -1
- package/dist/esm/util/merge-should-ignore.js +0 -9
- package/dist/esm/util/merge-should-ignore.js.map +0 -1
- package/dist/types/util/flatten-should-ignore.d.ts +0 -2
- package/dist/types/util/merge-should-ignore.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IFlattenOptions } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* 有时候为了统计方便,需要把传入的对象展平,比如 error 对象,可能会展平成如下形状:
|
|
4
4
|
*
|
|
@@ -10,4 +10,4 @@ import type { ISlsFlattenOptions } from '../types';
|
|
|
10
10
|
* }
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export default function flattenObject<T extends object>(o: T, options: string |
|
|
13
|
+
export default function flattenObject<T extends object>(o: T, options: string | IFlattenOptions): Record<string, unknown>;
|
|
@@ -6,4 +6,4 @@ export { default as convertErrorToPlain } from './convert-error-to-plain';
|
|
|
6
6
|
export { default as resolveDefaultParams } from './resolve-default-params';
|
|
7
7
|
export { default as createSlsLogQuick } from './create-sls-log-quick';
|
|
8
8
|
export { default as mergeDefaultParams } from './merge-default-params';
|
|
9
|
-
export { default as
|
|
9
|
+
export { default as mergeDontSend } from './merge-dont-send';
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = flattenShouldIgnore;
|
|
7
|
-
function flattenShouldIgnore(ignore, path, key, value) {
|
|
8
|
-
if (/^_/.test(key)) {
|
|
9
|
-
// 默认不记录 _ 打头的所有数据
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
if (!ignore) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if (typeof ignore === 'function') {
|
|
16
|
-
return ignore(key, value, path);
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(ignore)) {
|
|
19
|
-
return ignore.includes(key);
|
|
20
|
-
}
|
|
21
|
-
return key === ignore;
|
|
22
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = mergeShouldIgnore;
|
|
7
|
-
function mergeShouldIgnore(factoryShouldIgnore, shouldIgnore) {
|
|
8
|
-
if (!factoryShouldIgnore || !shouldIgnore) {
|
|
9
|
-
return shouldIgnore || factoryShouldIgnore;
|
|
10
|
-
}
|
|
11
|
-
return function () {
|
|
12
|
-
return factoryShouldIgnore() || shouldIgnore();
|
|
13
|
-
};
|
|
14
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default function flattenShouldIgnore(ignore, path, key, value) {
|
|
2
|
-
if (/^_/.test(key)) {
|
|
3
|
-
// 默认不记录 _ 打头的所有数据
|
|
4
|
-
return true;
|
|
5
|
-
}
|
|
6
|
-
if (!ignore) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (typeof ignore === 'function') {
|
|
10
|
-
return ignore(key, value, path);
|
|
11
|
-
}
|
|
12
|
-
if (Array.isArray(ignore)) {
|
|
13
|
-
return ignore.includes(key);
|
|
14
|
-
}
|
|
15
|
-
return key === ignore;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=flatten-should-ignore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flatten-should-ignore.js","names":["flattenShouldIgnore","ignore","path","key","value","test","Array","isArray","includes"],"sources":["../../../src/util/flatten-should-ignore.ts"],"sourcesContent":["import type {\n ISlsFlattenOptions\n} from '../types';\n\nexport default function flattenShouldIgnore(ignore: ISlsFlattenOptions['ignore'], path: string, key: string, value: unknown): boolean {\n if (/^_/.test(key)) { // 默认不记录 _ 打头的所有数据\n return true;\n }\n \n if (!ignore) {\n return false;\n }\n \n if (typeof ignore === 'function') {\n return ignore(key, value, path);\n }\n \n if (Array.isArray(ignore)) {\n return ignore.includes(key);\n }\n \n return key === ignore;\n}"],"mappings":"AAIA,eAAe,SAASA,mBAAmBA,CAACC,MAAoC,EAAEC,IAAY,EAAEC,GAAW,EAAEC,KAAc,EAAW;EACpI,IAAI,IAAI,CAACC,IAAI,CAACF,GAAG,CAAC,EAAE;IAAE;IACpB,OAAO,IAAI;EACb;EAEA,IAAI,CAACF,MAAM,EAAE;IACX,OAAO,KAAK;EACd;EAEA,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAChC,OAAOA,MAAM,CAACE,GAAG,EAAEC,KAAK,EAAEF,IAAI,CAAC;EACjC;EAEA,IAAII,KAAK,CAACC,OAAO,CAACN,MAAM,CAAC,EAAE;IACzB,OAAOA,MAAM,CAACO,QAAQ,CAACL,GAAG,CAAC;EAC7B;EAEA,OAAOA,GAAG,KAAKF,MAAM;AACvB","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default function mergeShouldIgnore(factoryShouldIgnore, shouldIgnore) {
|
|
2
|
-
if (!factoryShouldIgnore || !shouldIgnore) {
|
|
3
|
-
return shouldIgnore || factoryShouldIgnore;
|
|
4
|
-
}
|
|
5
|
-
return function () {
|
|
6
|
-
return factoryShouldIgnore() || shouldIgnore();
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=merge-should-ignore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merge-should-ignore.js","names":["mergeShouldIgnore","factoryShouldIgnore","shouldIgnore"],"sources":["../../../src/util/merge-should-ignore.ts"],"sourcesContent":["import type {\n IShouldIgnore\n} from '../types';\n\nexport default function mergeShouldIgnore(factoryShouldIgnore?: IShouldIgnore, shouldIgnore?: IShouldIgnore): IShouldIgnore | undefined {\n if (!factoryShouldIgnore || !shouldIgnore) {\n return shouldIgnore || factoryShouldIgnore;\n }\n \n return (): boolean | void => factoryShouldIgnore() || shouldIgnore();\n}"],"mappings":"AAIA,eAAe,SAASA,iBAAiBA,CAACC,mBAAmC,EAAEC,YAA4B,EAA6B;EACtI,IAAI,CAACD,mBAAmB,IAAI,CAACC,YAAY,EAAE;IACzC,OAAOA,YAAY,IAAID,mBAAmB;EAC5C;EAEA,OAAO;IAAA,OAAsBA,mBAAmB,CAAC,CAAC,IAAIC,YAAY,CAAC,CAAC;EAAA;AACtE","ignoreList":[]}
|