build/generate.js
function strip(obj) {

    if (!obj || ! obj instanceof Object || typeof obj === 'string') {
        return undefined;
    }

    if (obj instanceof Array) {
        for (const value of obj) {
            strip(value);
        }
    } else {

        delete obj['loc'];
        delete obj['start'];
        delete obj['end'];

        Object.keys(obj).forEach(key => strip(obj[key]));
    }

    return obj;
}
function strip(obj) {

    if (!obj || ! obj instanceof Object || typeof obj === 'string') {
        return undefined;
    }

    if (obj instanceof Array) {
        for (const value of obj) {
            strip(value);
        }
    } else {

        delete obj['loc'];
        delete obj['start'];
        delete obj['end'];

        Object.keys(obj).forEach(key => strip(obj[key]));
    }

    return obj;
}
function strip ( obj ) { if ( ! obj || ! obj instanceof Object || typeof obj === 'string' ) { return undefined ; } if ( obj instanceof Array ) { for ( const value of obj ) { strip ( value ) ; } } else { delete obj [ 'loc' ] ; delete obj [ 'start' ] ; delete obj [ 'end' ] ; Object . keys ( obj ) . forEach ( key => strip ( obj [ key ] ) ) ; } return obj ; }
Strips location information out of babel ast, so we can regen clean code from the ast
@param obj - babylon ast
@returns ast
Strips location information out of babel ast so we can regen clean code from the ast