light-sentry-sdk/dist/utils/field-encoder.d.ts

24 lines
891 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 字段短编码映射
*
* 将常用字段名编码为 2-3 个字符的短码,减少上报体积
*
* 编码前:{ "type": "error", "level": "error", "message": "..." }
* 编码后:{ "t": "e", "l": "e", "m": "..." }
*
* 注意:只对最外层高频字段编码,不对嵌套对象深度编码
* 避免复杂嵌套带来的解析问题和兼容性风险
*/
export declare const FIELD_ENCODE_MAP: Record<string, string>;
export declare const FIELD_DECODE_MAP: Record<string, string>;
/**
* 编码事件字段名SDK 端使用)
* 只对最外层字段编码,避免深度编码的复杂性
*/
export declare function encodeFields(obj: Record<string, unknown>): Record<string, unknown>;
/**
* 解码事件字段名(服务端使用)
* 只对最外层字段解码
*/
export declare function decodeFields(obj: Record<string, unknown>): Record<string, unknown>;