UNPKG

nest-wechatpay-node-v3

Version:
20 lines (19 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.loadPackage = void 0; /* eslint-disable @typescript-eslint/ban-types */ var common_1 = require("@nestjs/common"); var MISSING_REQUIRED_DEPENDENCY = function (name, reason) { return "The \"" + name + "\" package is missing. Please, make sure to install this library ($ npm install " + name + ") to take advantage of " + reason + "."; }; var logger = new common_1.Logger('PackageLoader'); function loadPackage(packageName, context, loaderFn) { try { return loaderFn ? loaderFn() : require(packageName); } catch (e) { logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context)); process.exit(1); } } exports.loadPackage = loadPackage;