@godspeedsystems/prisma-deterministic-search-field-encryption
Version:
Transparent and customizable field-level encryption at rest for Prisma based on prisma-field-encryption package
21 lines (20 loc) • 747 B
TypeScript
export declare type Literal = string | number | boolean | null;
export declare type Dict = {
[key: string]: Json;
};
export declare type Json = Literal | Array<Json> | Dict;
export declare type JsonType = 'string' | 'number' | 'boolean' | 'null' | 'array' | 'object';
export interface Item {
key?: string;
path: string[];
node: Json;
type: JsonType;
}
/**
* Traverse a JSON object depth-first, in a `reduce` manner.
*
* @param input The root node to traverse
* @param callback A function to call on each visited node
* @param initialState Think of this as the last argument of `reduce`
*/
export declare function traverseTree<State>(input: Json, callback: (state: State, item: Item) => State, initialState: State): void;