13 lines
1.2 KiB
JavaScript
13 lines
1.2 KiB
JavaScript
exports.type = function (pathStringArg) {
|
|
var urlRegex = /http[s|\s]:\/\/.*/i;
|
|
if (urlRegex.exec(pathStringArg)) {
|
|
return "url";
|
|
}
|
|
else {
|
|
return "local";
|
|
}
|
|
;
|
|
};
|
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0cGF0aC5nZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR1csWUFBSSxHQUFHLFVBQVMsYUFBb0I7SUFDM0MsSUFBSSxRQUFRLEdBQUcsb0JBQW9CLENBQUE7SUFDbkMsRUFBRSxDQUFBLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDN0IsTUFBTSxDQUFDLEtBQUssQ0FBQztJQUNqQixDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixNQUFNLENBQUMsT0FBTyxDQUFDO0lBQ25CLENBQUM7SUFBQSxDQUFDO0FBQ04sQ0FBQyxDQUFDIiwiZmlsZSI6InNtYXJ0cGF0aC5nZXQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwidHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydHBhdGgucGx1Z2luc1wiKTtcblxuZXhwb3J0IGxldCB0eXBlID0gZnVuY3Rpb24ocGF0aFN0cmluZ0FyZzpzdHJpbmcpOnN0cmluZyB7XG4gICAgbGV0IHVybFJlZ2V4ID0gL2h0dHBbc3xcXHNdOlxcL1xcLy4qL2lcbiAgICBpZih1cmxSZWdleC5leGVjKHBhdGhTdHJpbmdBcmcpKXtcbiAgICAgICAgcmV0dXJuIFwidXJsXCI7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIFwibG9jYWxcIjtcbiAgICB9O1xufTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|