Function apply_function_dictionary_to_object

  • Takes an object whos keys are fields in a dictionary and values are functions and calls each function with a supplied argument and assings the result to the corresping key of the return object

    Parameters

    Returns any

    ret - An object whose keys index the corresponding result of the transformer function

    let fd = { 'a' : ()=>"hi" , 'b' : (e)=>e.toLowerCase } 
    let res = apply_function_dictionary_to_object(fd, "HELLO")
    //returns { 'a' : "hi" , 'b' : "hello" }