UNPKG

479 BJavaScriptView Raw
1var glob = require('glob');
2
3/**
4 * 给文本加上双引号
5 *
6 * @param {string} content 文本内容
7 * @param {Object} attrs 属性
8 * @param {string} attrs.pattern 匹配规则
9 * @param {Object} scope 作用域
10 * @param {Function} scope.execImport 导入数据
11 */
12module.exports = function processor(content, attrs, scope) {
13 var pattern = scope.execImport(attrs.pattern);
14 return JSON.stringify(new glob(pattern, {
15 cwd: scope.getDirname(),
16 sync: true
17 }));
18};
\No newline at end of file