UNPKG

kiss-cli

Version:

Keep It Stupid Simple - An agnostic file snippets :kiss:

16 lines (12 loc) 336 B
const path = require('path'); const isDot = str => { const base = path.basename(str); return base === '.' || base === '..'; }; const checkIsFile = file => { const isvalid = file && typeof file === 'string' && file.trim() !== '' && !isDot(file); if (!isvalid) return false; return file; }; module.exports = checkIsFile;