@clynn-fe/akfe-editor-jsonc
Version:
JSON Compress by using a map to reduce the size of keys and using gzip
21 lines (20 loc) • 646 B
TypeScript
export declare const unique: <T>(arr: T[]) => T[];
export declare const isObject: (obj: any) => boolean;
/**
* Converts a bidimensional array to object
*/
export declare const biDimensionalArrayToObject: <T>(arr: [string | number, T][]) => {
[key: string]: T;
[key: number]: T;
};
/**
* Convert a number to their ascii code/s.
*/
export declare const numberToKey: (index: number, totalChar?: number, offset?: number) => number[];
/**
* 使用给定的 map oKeys 来替换 obj 里的 key
* 该方法不改变传入的 obj
*/
export declare const transformKeys: (obj: any, oKeys: {
[key: string]: string;
}, target?: {}) => any;