2019-01-29 00:53:39 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////function f(/*a*/a: number, b = { x: 1, z: { s: true } }/*b*/) {
|
|
|
|
//// return b;
|
|
|
|
////}
|
|
|
|
////f(2);
|
|
|
|
|
|
|
|
goTo.select("a", "b");
|
|
|
|
edit.applyRefactor({
|
2019-03-14 21:41:29 +01:00
|
|
|
refactorName: "Convert parameters to destructured object",
|
|
|
|
actionName: "Convert parameters to destructured object",
|
|
|
|
actionDescription: "Convert parameters to destructured object",
|
2019-01-29 00:53:39 +01:00
|
|
|
newContent: `function f({ a, b = { x: 1, z: { s: true } } }: { a: number; b?: { x: number; z: { s: boolean; }; }; }) {
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
f({ a: 2 });`
|
|
|
|
});
|