1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | const _ = require('lodash');
|
8 | const Requizzle = require('./lib/requizzle');
|
9 |
|
10 | module.exports = function requizzle(options) {
|
11 | let instance;
|
12 |
|
13 | if (!options || typeof options !== 'object') {
|
14 | throw new TypeError('Requizzle\'s options parameter must be a non-null object.');
|
15 | }
|
16 | options = _.clone(options);
|
17 | options.parent = module.parent;
|
18 |
|
19 | return filepath => {
|
20 | instance = instance || new Requizzle(options);
|
21 |
|
22 | return instance.requizzle(filepath);
|
23 | };
|
24 | };
|
25 | module.exports.Requizzle = Requizzle;
|
26 |
|
27 |
|
28 | delete require.cache[__filename];
|