UNPKG

448 BJavaScriptView Raw
1/**
2 * @function _tmpl
3 * @private
4 * @returns {string}
5 */
6"use strict";
7
8const fs = require('fs'),
9 stringcase = require('stringcase'),
10 types = require('./types');
11
12/** @lends _tmpl */
13function _tmpl(type) {
14 let dirname = __dirname + '/../';
15 let filename = types[stringcase.camelcase(type).trim()];
16 if(!filename){
17 return null;
18 }
19 return fs.readFileSync(dirname + filename).toString();
20
21}
22module.exports = _tmpl;