Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function(file, options, callback) {
if(!file) {
return callback(new Error('No template specified.'));
}
// Create the base context
let baseContext = Dust.makeBase(
// Context globals
{
Template: {
// Always the filename without extension
name: Path.basename(this.name, '.dust')
}
},
// Context options
{
viewFolders: this.root,
template: this.name,
extension: this.ext || Path.extname(file),
locals: options
}
).push(options);
var fs = require('fs'),
fsPath = require('path'),
http = require('http'),
dust = require('dustjs-linkedin'),
baseContext = dust.makeBase({});
var mix = function(s, d) {
for (var i in s) {
d[i] = s[i]
}
return d;
}
module.exports = {
filters : dust.filters
, makeBase: function(obj) {
baseContext = dust.makeBase(mix(baseContext.global, obj));
return baseContext;
}
}
'to': 'window',
'attachment': 'together',
'pin': true
}
]
}
},
'hoverintent': {
'timeout': 300,
'interval': 75,
'sensitivity': 7
}
}
};
settingsContext = dust.makeBase().push(settings);
DarkTip.setting = function(key, data) {
var tplNames = [];
if (typeof data === 'undefined') {
return settingsContext.get(key);
}
tplNames = key.match(/^module\.template\.([^\.].*)$/);
if (tplNames && tplNames.length)
{
data = dust.loadSource(dust.compile(data, tplNames[1]));
}
settingsContext.set(key, data);
return this;
};
DarkTip.css = (function() {
, makeBase: function(obj) {
baseContext = dust.makeBase(mix(baseContext.global, obj));
return baseContext;
}
}