dist/src/util.js
function (model, values, functionPrefix) {
            // for a string, see if it has parameter matches, and if so, try to make the substitutions.
            var getValue = function (fromString) {
                    var matches = fromString.match(/(\${.*?})/g);
                    if (matches != null) {
                        for (var i = 0; i < matches.length; i++) {
                            var val = values[matches[i].substring(2, matches[i].length - 1)] || "";
                            if (val != null) {
                                fromString = fromString.replace(matches[i], val);
                            }
                        }
                    }
                    return fromString;
                },
            // process one entry.
                _one = function (d) {
                    if (d != null) {
                        if (_iss(d)) {
                            return getValue(d);
                        }
                        else if (_isf(d) && (functionPrefix == null || (d.name || "").indexOf(functionPrefix) === 0)) {
                            return d(values);
                        }
                        else if (_isa(d)) {
                            var r = [];
                            for (var i = 0; i < d.length; i++)
                                r.push(_one(d[i]));
                            return r;
                        }
                        else if (_iso(d)) {
                            var s = {};
                            for (var j in d) {
                                s[j] = _one(d[j]);
                            }
                            return s;
                        }
                        else {
                            return d;
                        }
                    }
                };

            return _one(model);
        }
function (model, values, functionPrefix) {
            // for a string, see if it has parameter matches, and if so, try to make the substitutions.
            var getValue = function (fromString) {
                    var matches = fromString.match(/(\${.*?})/g);
                    if (matches != null) {
                        for (var i = 0; i < matches.length; i++) {
                            var val = values[matches[i].substring(2, matches[i].length - 1)] || "";
                            if (val != null) {
                                fromString = fromString.replace(matches[i], val);
                            }
                        }
                    }
                    return fromString;
                },
            // process one entry.
                _one = function (d) {
                    if (d != null) {
                        if (_iss(d)) {
                            return getValue(d);
                        }
                        else if (_isf(d) && (functionPrefix == null || (d.name || "").indexOf(functionPrefix) === 0)) {
                            return d(values);
                        }
                        else if (_isa(d)) {
                            var r = [];
                            for (var i = 0; i < d.length; i++)
                                r.push(_one(d[i]));
                            return r;
                        }
                        else if (_iso(d)) {
                            var s = {};
                            for (var j in d) {
                                s[j] = _one(d[j]);
                            }
                            return s;
                        }
                        else {
                            return d;
                        }
                    }
                };

            return _one(model);
        }
function ( model , values , functionPrefix ) { // for a string, see if it has parameter matches, and if so, try to make the substitutions. var getValue = function ( fromString ) { var matches = fromString . match ( / (\${.*?}) / g ) ; if ( matches != null ) { for ( var i = 0 ; i < matches . length ; i ++ ) { var val = values [ matches [ i ] . substring ( 2 , matches [ i ] . length - 1 ) ] || "" ; if ( val != null ) { fromString = fromString . replace ( matches [ i ] , val ) ; } } } return fromString ; } , // process one entry. _one = function ( d ) { if ( d != null ) { if ( _iss ( d ) ) { return getValue ( d ) ; } else if ( _isf ( d ) && ( functionPrefix == null || ( d . name || "" ) . indexOf ( functionPrefix ) === 0 ) ) { return d ( values ) ; } else if ( _isa ( d ) ) { var r = [ ] ; for ( var i = 0 ; i < d . length ; i ++ ) r . push ( _one ( d [ i ] ) ) ; return r ; } else if ( _iso ( d ) ) { var s = { } ; for ( var j in d ) { s [ j ] = _one ( d [ j ] ) ; } return s ; } else { return d ; } } } ; return _one ( model ) ; }
take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function. if you do not provide it, 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.
take the given model and expand out any parameters . functionPrefix is optional and if present helps jsplumb figure out what to do if a value is a Function . if you do not provide it 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 .