@powersync/service-core 0.0.0-dev-20251124070259 → 0.0.0-dev-20251126121420

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.
@@ -1,6 +0,0 @@
1
- export type ParamLoggingFormatOptions = {
2
- maxKeyCount: number;
3
- maxStringLength: number;
4
- };
5
- export declare const DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS: ParamLoggingFormatOptions;
6
- export declare function formatParamsForLogging(params: Record<string, any>, options?: Partial<ParamLoggingFormatOptions>): any;
@@ -1,26 +0,0 @@
1
- export const DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS = {
2
- maxKeyCount: 10,
3
- maxStringLength: 20
4
- };
5
- export function formatParamsForLogging(params, options = {}) {
6
- const { maxStringLength = DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS.maxStringLength, maxKeyCount = DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS.maxKeyCount } = options;
7
- function trimString(value) {
8
- if (value.length > maxStringLength) {
9
- return value.slice(0, maxStringLength - 3) + '...';
10
- }
11
- return value;
12
- }
13
- return Object.fromEntries(Object.entries(params).map(([key, value], index) => {
14
- if (index == maxKeyCount) {
15
- return ['[...]', '[...]'];
16
- }
17
- if (index > maxKeyCount) {
18
- return [];
19
- }
20
- if (typeof value === 'string') {
21
- return [key, trimString(value)];
22
- }
23
- return [key, trimString(JSON.stringify(value))];
24
- }));
25
- }
26
- //# sourceMappingURL=param-logging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"param-logging.js","sourceRoot":"","sources":["../../src/util/param-logging.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,oCAAoC,GAA8B;IAC7E,WAAW,EAAE,EAAE;IACf,eAAe,EAAE,EAAE;CACpB,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,MAA2B,EAAE,UAA8C,EAAE;IAClH,MAAM,EACJ,eAAe,GAAG,oCAAoC,CAAC,eAAe,EACtE,WAAW,GAAG,oCAAoC,CAAC,WAAW,EAC/D,GAAG,OAAO,CAAC;IAEZ,SAAS,UAAU,CAAC,KAAa;QAC/B,IAAI,KAAK,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACrD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;QACjD,IAAI,KAAK,IAAI,WAAW,EAAE,CAAC;YACzB,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,CAAC;QAED,IAAI,KAAK,GAAG,WAAW,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -1,40 +0,0 @@
1
- export type ParamLoggingFormatOptions = {
2
- maxKeyCount: number;
3
- maxStringLength: number;
4
- };
5
-
6
- export const DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS: ParamLoggingFormatOptions = {
7
- maxKeyCount: 10,
8
- maxStringLength: 20
9
- };
10
-
11
- export function formatParamsForLogging(params: Record<string, any>, options: Partial<ParamLoggingFormatOptions> = {}) {
12
- const {
13
- maxStringLength = DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS.maxStringLength,
14
- maxKeyCount = DEFAULT_PARAM_LOGGING_FORMAT_OPTIONS.maxKeyCount
15
- } = options;
16
-
17
- function trimString(value: string): string {
18
- if (value.length > maxStringLength) {
19
- return value.slice(0, maxStringLength - 3) + '...';
20
- }
21
- return value;
22
- }
23
-
24
- return Object.fromEntries(
25
- Object.entries(params).map(([key, value], index) => {
26
- if (index == maxKeyCount) {
27
- return ['[...]', '[...]'];
28
- }
29
-
30
- if (index > maxKeyCount) {
31
- return [];
32
- }
33
-
34
- if (typeof value === 'string') {
35
- return [key, trimString(value)];
36
- }
37
- return [key, trimString(JSON.stringify(value))];
38
- })
39
- );
40
- }