2019-02-02 01:44:22 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////function foo(/*a*/a: number, b: number/*b*/) {
|
|
|
|
//// return { bar: () => a + b };
|
|
|
|
////}
|
|
|
|
////var x = foo(1, 2).bar();
|
|
|
|
|
|
|
|
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-02-02 01:44:22 +01:00
|
|
|
newContent: `function foo({ a, b }: { a: number; b: number; }) {
|
|
|
|
return { bar: () => a + b };
|
|
|
|
}
|
|
|
|
var x = foo({ a: 1, b: 2 }).bar();`
|
|
|
|
});
|