1 | /**
|
2 | * @function _tmpl
|
3 | * @private
|
4 | * @returns {string}
|
5 | */
|
6 | ;
|
7 |
|
8 | const fs = require('fs'),
|
9 | stringcase = require('stringcase'),
|
10 | types = require('./types');
|
11 |
|
12 | /** @lends _tmpl */
|
13 | function _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 | }
|
22 | module.exports = _tmpl;
|