UNPKG

rewiremock

Version:

Advanced dependency mocking device.

30 lines (26 loc) 694 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.fileExists = fileExists; var FS_MODULE_NAME = 'fs'; var fs = void 0; if (typeof __webpack_modules__ === 'undefined') { try { fs = require(FS_MODULE_NAME); } catch (e) { //nop } } function fileExists(path) { if (typeof __webpack_modules__ !== 'undefined') { var npath = path[0] === '.' ? path : '.' + path; return __webpack_modules__[npath] && npath; } try { return !fs.accessSync(path, fs.F_OK) && path; } catch (e) { return false; } } var ensureRequire = exports.ensureRequire = typeof __webpack_require__ !== 'undefined' ? __webpack_require__ : eval('require');