[][src]Function swc_ecma_transforms::compat::es2015::destructuring::destructuring

pub fn destructuring(c: Config) -> impl Fold

@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 = _toArray(_arr),
    a = _arr2[0],
    b = _arr2[1],
    rest = _arr2.slice(2);