aureooms/rejuvenate

View on GitHub
src/util/addLeadingDotIfNecessary.js

Summary

Maintainability
A
0 mins
Test Coverage
const addLeadingDotIfNecessary = (path) => {
    if (path.startsWith('./')) return path;
    if (path.startsWith('../')) return path;
    return './' + path;
};

export default addLeadingDotIfNecessary;