Skip to main content

Home > @jsplumb/util > populate

populate() function#

Take the given model and expand out any parameters.


export declare function populate(model: any, values: any, functionPrefix?: string, doNotExpandFunctions?: boolean): any;


modelanyObject to populate with values.
valuesanyObject containing values to populate
functionPrefixstringThis is optional, and if present, helps jsplumb figure out what to do if a value is a Function. if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix will be executed; other functions will be passed as values to the output.
doNotExpandFunctionsbooleanDefaults to false. If true, Functions will be passed directly from values to model without being executed.