swc_ecma_compat_es2015::destructuring

Function destructuring

source
pub fn destructuring(c: Config) -> impl Pass
Expand description

@babel/plugin-transform-destructuring

§Example

§In

let {x, y} = obj;

let [a, b, ...rest] = arr;

§Out

let _obj = obj,
    x = _obj.x,
    y = _obj.y;

let _arr = arr,
    _arr2 = _to_array(_arr),
    a = _arr2[0],
    b = _arr2[1],
    rest = _arr2.slice(2);