source: trip-planner-front/node_modules/@babel/plugin-transform-runtime/lib/get-runtime-path/index.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = _default;
7
8var _path = require("path");
9
10var _module = require("module");
11
12function _default(moduleName, dirname, absoluteRuntime) {
13 if (absoluteRuntime === false) return moduleName;
14 return resolveAbsoluteRuntime(moduleName, _path.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime));
15}
16
17function resolveAbsoluteRuntime(moduleName, dirname) {
18 try {
19 return _path.dirname((((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
20 paths: [b]
21 }, M = require("module")) => {
22 let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
23
24 if (f) return f;
25 f = new Error(`Cannot resolve module '${r}'`);
26 f.code = "MODULE_NOT_FOUND";
27 throw f;
28 })(`${moduleName}/package.json`, {
29 paths: [dirname]
30 })).replace(/\\/g, "/");
31 } catch (err) {
32 if (err.code !== "MODULE_NOT_FOUND") throw err;
33 throw Object.assign(new Error(`Failed to resolve "${moduleName}" relative to "${dirname}"`), {
34 code: "BABEL_RUNTIME_NOT_FOUND",
35 runtime: moduleName,
36 dirname
37 });
38 }
39}
Note: See TracBrowser for help on using the repository browser.