INNER CODE UNIT · JavaScript
resolvePath
mhkeller/layercake · vite.config.js:8
const resolvePath = relativePath => fileURLToPath(new URL(relativePath, import.meta.url));
/**
* Convert numerical values from a CSV file with `plugin-dsv`
* @param {string} value
* @returns {string|number}
*/
const processCsvValue = value => {
// Examples:
// '' => ''
// 'foo' => 'foo'
// '2018-07-22T22:25:55Z' => '2018-07-22T22:25:55Z'
// '1.23' => 1.23
// '42' => 42
const number = Number(value);
if (value !== '' && !isNaN(number)) {
return number;
} else {