Lines Matching refs:tr

8 var tr = (module.exports = function (transformer) {  variable
11 tr.Transformer = Transformer;
12 tr.normalizeFn = normalizeFn;
13 tr.normalizeFnAsync = normalizeFnAsync;
14 tr.normalize = normalize;
15 tr.normalizeAsync = normalizeAsync;
17 tr.readFile = Promise.denodeify(fs.readFile);
18 tr.readFileSync = fs.readFileSync;
20 tr.readFile = function () { throw new Error('fs.readFile unsupported'); };
21 tr.readFileSync = function () { throw new Error('fs.readFileSync unsupported'); };
49 }).then(tr.normalizeFn).nodeify(cb);
76 }).then(tr.normalize).nodeify(cb);
79 function Transformer(tr) { argument
80 assert(tr, 'Transformer must be an object');
81 assert(typeof tr.name === 'string', 'Transformer must have a name');
82 assert(typeof tr.outputFormat === 'string', 'Transformer must have an output format');
97 return typeof tr[method] === 'function';
99 this._tr = tr;
145 return tr.normalize(_this._tr.render(str, options, locals)).body;
158 return tr.normalizeFn(this._tr.compile(str, options));
165 return tr.normalizeFnAsync(this._tr.compileAsync(str, options), cb);
167 return tr.normalizeFnAsync(this.compile(str, options), cb);
175 return tr.normalizeFn(this._tr.compileFile(filename, options));
177 return tr.normalizeFn(function (locals) {
178 return tr.normalize(this._tr.renderFile(filename, options, locals)).body;
183 return this.compile(tr.readFileSync(filename, 'utf8'), options);
191 return tr.normalizeFnAsync(this._tr.compileFileAsync(filename, options), cb);
193 return tr.normalizeFnAsync(this.compileFile(filename, options), cb);
197 return tr.normalizeFnAsync(tr.readFile(filename, 'utf8').then(function (str) {
220 return tr.normalize(this._tr.compileClient(str, options));
231 return tr.normalizeAsync(this._tr.compileClientAsync(str, options), cb);
233 return tr.normalizeAsync(this._tr.compileClient(str, options), cb);
245 return tr.normalize(this._tr.compileFileClient(filename, options));
249 return tr.normalize(this._tr.compileClient(tr.readFileSync(filename, 'utf8'), options));
257 return tr.normalizeAsync(this._tr.compileFileClientAsync(filename, options), cb);
259 return tr.normalizeAsync(this._tr.compileFileClient(filename, options), cb);
263 return tr.normalizeAsync(tr.readFile(filename, 'utf8').then(function (str) {
286 return tr.normalize(this._tr.render(str, options, locals));
288 var compiled = tr.normalizeFn(this._tr.compile(str, options));
293 return tr.normalize({body: body, dependencies: compiled.dependencies});
309 return tr.normalizeAsync(this._tr.renderAsync(str, options, locals), cb);
311 return tr.normalizeAsync(this._tr.render(str, options, locals), cb);
313 return tr.normalizeAsync(this.compileAsync(str, options).then(function (compiled) {
324 return tr.normalize(this._tr.renderFile(filename, options, locals));
328 return tr.normalize(this._tr.render(tr.readFileSync(filename, 'utf8'), options, locals));
331 … return tr.normalize({body: compiled.fn(locals || options), dependencies: compiled.dependencies});
344 return tr.normalizeAsync(this._tr.renderFileAsync(filename, options, locals), cb);
346 return tr.normalizeAsync(this._tr.renderFile(filename, options, locals), cb);
349 return tr.normalizeAsync(this.compileFileAsync(filename, options).then(function (compiled) {
355 return tr.normalizeAsync(tr.readFile(filename, 'utf8').then(function (str) {