MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / checkPath

Function checkPath

out/cli.cjs:64447–64465  ·  view source on GitHub ↗
(path5, originalPath, doThrow)

Source from the content-addressed store, hash-verified

64445 pattern,
64446 negative,
64447 regex
64448 );
64449 };
64450 var throwError = (message, Ctor) => {
64451 throw new Ctor(message);
64452 };
64453 var checkPath = (path5, originalPath, doThrow) => {
64454 if (!isString2(path5)) {
64455 return doThrow(
64456 `path must be a string, but got \`${originalPath}\``,
64457 TypeError
64458 );
64459 }
64460 if (!path5) {
64461 return doThrow(`path must not be empty`, TypeError);
64462 }
64463 if (checkPath.isNotRelative(path5)) {
64464 const r3 = "`path.relative()`d";
64465 return doThrow(
64466 `path should be a ${r3} string, but got "${originalPath}"`,
64467 RangeError
64468 );

Callers 2

_testMethod · 0.85
isPathValidFunction · 0.85

Calls 1

isString2Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…