index.js
function load_shims_sync(paths, browser) {
    // identify if our file should be replaced per the browser field
    // original filename|id -> replacement
    var shims = Object.create(null);
    var cur_path;

    while (cur_path = paths.shift()) {
        var pkg_path = path.join(cur_path, 'package.json');

        try {
            var data = fs.readFileSync(pkg_path, 'utf8');
            find_shims_in_package(data, cur_path, shims, browser);
            return shims;
        }
        catch (err) {
            // ignore paths we can't open
            // avoids an exists check
            if (err.code === 'ENOENT') {
                continue;
            }

            throw err;
        }
    }
    return shims;
}
function load_shims_sync(paths, browser) {
    // identify if our file should be replaced per the browser field
    // original filename|id -> replacement
    var shims = Object.create(null);
    var cur_path;

    while (cur_path = paths.shift()) {
        var pkg_path = path.join(cur_path, 'package.json');

        try {
            var data = fs.readFileSync(pkg_path, 'utf8');
            find_shims_in_package(data, cur_path, shims, browser);
            return shims;
        }
        catch (err) {
            // ignore paths we can't open
            // avoids an exists check
            if (err.code === 'ENOENT') {
                continue;
            }

            throw err;
        }
    }
    return shims;
}
function load_shims_sync ( paths , browser ) { // identify if our file should be replaced per the browser field // original filename|id -> replacement var shims = Object . create ( null ) ; var cur_path ; while ( cur_path = paths . shift ( ) ) { var pkg_path = path . join ( cur_path , 'package.json' ) ; try { var data = fs . readFileSync ( pkg_path , 'utf8' ) ; find_shims_in_package ( data , cur_path , shims , browser ) ; return shims ; } catch ( err ) { // ignore paths we can't open // avoids an exists check if ( err . code === 'ENOENT' ) { continue ; } throw err ; } } return shims ; }
paths is mutated synchronously load shims from first package.json file found
paths is mutated synchronously load shims from first package . json file found