2019-01-29 00:53:39 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////function f(/*a*/a: number, b: string = "1"/*b*/): string {
|
|
|
|
//// return b;
|
|
|
|
////}
|
|
|
|
////f(4, "b");
|
|
|
|
|
|
|
|
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 = "1" }: { a: number; b?: string; }): string {
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
f({ a: 4, b: "b" });`
|
|
|
|
});
|