Sha256: b13db222fe1406b344ef967f3dda6370476b3a5d8ce3c2eed0f13ed46ca26032

Contents?: true

Size: 491 Bytes

Versions: 69

Compression:

Stored size: 491 Bytes

Contents

define([
    '../lang/toString',
    '../object/get'
], function(toString, get) {

    var stache = /\{\{([^\}]+)\}\}/g; //mustache-like

    /**
     * String interpolation
     */
    function interpolate(template, replacements, syntax){
        template = toString(template);
        var replaceFn = function(match, prop){
            return toString( get(replacements, prop) );
        };
        return template.replace(syntax || stache, replaceFn);
    }

    return interpolate;

});

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
trusty-festivity-extension-2.3.1 node_modules/bower/node_modules/mout/src/string/interpolate.js
trusty-festivity-extension-2.3.0 node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/src/string/interpolate.js