UNPKG

@graphql-guru/loader

Version:

Core loaders from GraphQL Guru Servers

52 lines (41 loc) 1.63 kB
'use strict'; /* * Config loader */ 'use-strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _utils = require('../utils'); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } exports.default = function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { var configPath, config; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; _context.next = 3; return (0, _utils.globPathsAsync)('environment.js'); case 3: configPath = _context.sent; config = require(configPath[0]); return _context.abrupt('return', config.default); case 8: _context.prev = 8; _context.t0 = _context['catch'](0); console.log(_context.t0); case 11: case 'end': return _context.stop(); } } }, _callee, this, [[0, 8]]); })); function environmentLoaderAsync() { return _ref.apply(this, arguments); } return environmentLoaderAsync; }(); //# sourceMappingURL=environment-loader.js.map