UNPKG

@acot/utils

Version:
15 lines (14 loc) 540 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFilepath = void 0; const path_1 = __importDefault(require("path")); const regex = /^\.{1,2}[/\\]/u; const isFilepath = (nameOrPath) => { return (regex.test(nameOrPath) || path_1.default.parse(nameOrPath).ext !== '' || path_1.default.isAbsolute(nameOrPath)); }; exports.isFilepath = isFilepath;