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

Function checkPathExt

out/cli.cjs:1007–1023  ·  view source on GitHub ↗
(path5, options)

Source from the content-addressed store, hash-verified

1005 isexe.sync = sync;
1006 var fs7 = require("fs");
1007 function checkPathExt(path5, options) {
1008 var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
1009 if (!pathext) {
1010 return true;
1011 }
1012 pathext = pathext.split(";");
1013 if (pathext.indexOf("") !== -1) {
1014 return true;
1015 }
1016 for (var i3 = 0; i3 < pathext.length; i3++) {
1017 var p4 = pathext[i3].toLowerCase();
1018 if (p4 && path5.substr(-p4.length).toLowerCase() === p4) {
1019 return true;
1020 }
1021 }
1022 return false;
1023 }
1024 function checkStat(stat, path5, options) {
1025 if (!stat.isSymbolicLink() && !stat.isFile()) {
1026 return false;

Callers 1

checkStatFunction · 0.85

Calls 1

toLowerCaseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…