Apply module bundling
[platform/framework/web/wrtjs.git] / node_modules / enhanced-resolve / lib / createInnerContext.js
1 /*
2         MIT License http://www.opensource.org/licenses/mit-license.php
3         Author Tobias Koppers @sokra
4 */
5
6 "use strict";
7
8 module.exports = function createInnerContext(
9         options,
10         message,
11         messageOptional
12 ) {
13         let messageReported = false;
14         let innerLog = undefined;
15         if (options.log) {
16                 if (message) {
17                         innerLog = msg => {
18                                 if (!messageReported) {
19                                         options.log(message);
20                                         messageReported = true;
21                                 }
22                                 options.log("  " + msg);
23                         };
24                 } else {
25                         innerLog = options.log;
26                 }
27         }
28         const childContext = {
29                 log: innerLog,
30                 yield: options.yield,
31                 fileDependencies: options.fileDependencies,
32                 contextDependencies: options.contextDependencies,
33                 missingDependencies: options.missingDependencies,
34                 stack: options.stack
35         };
36         return childContext;
37 };