node_modules/svelte-preprocess/dist/modules/utils.js
// finds a existing path up the tree
finds a existing path up the tree
finds a existing path up the tree
function findUp({ what, from }) {
    const { root, dir } = (0, path_1.parse)(from);
    let cur = dir;
    try {
        while (cur !== root) {
            const possiblePath = (0, path_1.join)(cur, what);
            if ((0, fs_1.existsSync)(possiblePath)) {
                return possiblePath;
            }
            cur = (0, path_1.dirname)(cur);
        }
    }
    catch (e) {
        console.error(e);
    }
    return null;
}
function findUp ( { what , from } ) { const { root , dir } = ( 0 , path_1 . parse ) ( from ) ; let cur = dir ; try { while ( cur !== root ) { const possiblePath = ( 0 , path_1 . join ) ( cur , what ) ; if ( ( 0 , fs_1 . existsSync ) ( possiblePath ) ) { return possiblePath ; } cur = ( 0 , path_1 . dirname ) ( cur ) ; } } catch ( e ) { console . error ( e ) ; } return null ; }
finds a existing path up the tree
finds a existing path up the tree