Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/compressObj"

Index

Functions

Functions

compressObj

  • compressObj(obj: any, tgt?: any, path?: any[]): any
  • Compress an object into string notation. Used with TeDB's indexing

    Example

    const doc = {
        nested: {
            obj: {
                is: "full",
            },
            num: 3,
        },
        tgt: [1, 2],
    }
    const target: any = {};
    compressObj(doc, target);
    console.log(target);
    // {
    //    "nested.obj.is": "full",
    //    "nested.num": 3,
    //    "tgt.0": 1,
    //    "tgt.1": 2,
    // }
    

    Parameters

    • obj: any
    • Default value tgt: any = {}
    • Default value path: any[] = []

    Returns any

Generated using TypeDoc