helpers/webpack-config-mod/index.js
function parseBabelThing(babelThing) {
    assert_usage([String, Array].includes(babelThing.constructor));
    let name;
    let options;
    if( babelThing.constructor === Array ) {
        name = babelThing[0];
        options = babelThing[1];
    } else {
        name = babelThing;
    }
    assert_usage(name.constructor===String, babelThing);
    spec = [name];
    if( options ) {
        spec.push(options);
    }
    return {name, options, spec};
}
function parseBabelThing(babelThing) {
    assert_usage([String, Array].includes(babelThing.constructor));
    let name;
    let options;
    if( babelThing.constructor === Array ) {
        name = babelThing[0];
        options = babelThing[1];
    } else {
        name = babelThing;
    }
    assert_usage(name.constructor===String, babelThing);
    spec = [name];
    if( options ) {
        spec.push(options);
    }
    return {name, options, spec};
}
function parseBabelThing ( babelThing ) { assert_usage ( [ String , Array ] . includes ( babelThing . constructor ) ) ; let name ; let options ; if ( babelThing . constructor === Array ) { name = babelThing [ 0 ] ; options = babelThing [ 1 ] ; } else { name = babelThing ; } assert_usage ( name . constructor === String , babelThing ) ; spec = [ name ] ; if ( options ) { spec . push ( options ) ; } return { name , options , spec } ; }
Works for babel presets as well as for babel plugins
Works for babel presets as well as for babel plugins