MCPcopy Index your code
hub / github.com/tleunen/babel-plugin-module-resolver / nodeResolvePath

Function nodeResolvePath

src/utils.js:4–10  ·  view source on GitHub ↗
(modulePath, basedir, extensions)

Source from the content-addressed store, hash-verified

2import resolve from 'resolve';
3
4export function nodeResolvePath(modulePath, basedir, extensions) {
5 try {
6 return resolve.sync(modulePath, { basedir, extensions });
7 } catch (e) {
8 return null;
9 }
10}
11
12export function isRelativePath(nodePath) {
13 return nodePath.match(/^\.?\.\//);

Callers 3

findPathInRootsFunction · 0.90
checkIfPackageExistsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected