UNPKG

@modern-js/utils

Version:

A Progressive React Framework for modern web development.

15 lines (14 loc) 307 B
import path from "path"; const ensureAbsolutePath = (base, filePath) => path.isAbsolute(filePath) ? filePath : path.resolve(base, filePath); const ensureArray = (params) => { if (Array.isArray(params)) { return params; } return [ params ]; }; export { ensureAbsolutePath, ensureArray };