mustache_templates-8.x-1.0-beta4/modules/mustache_magic/js/library.js
modules/mustache_magic/js/library.js
/**
* @file
* Magic library inclusion for Mustache templates.
*/
(function (sync) {
var magicLibrary = function (buffer, props) {
return new Proxy(buffer, Object.assign({
get: function (buffer, property, receiver) {
return function () {
return function (text, render) {
return render(text);
};
};
},
has: function(target, prop) {
return typeof prop === 'string' && prop.indexOf('/') > 0;
}
}, props));
};
sync.registry.magic.library = function (buffer) {
return magicLibrary(buffer, {});
};
}(mustacheSync));
