From 7b5b25be317a797b3f9df172bf53394d6d8813b2 Mon Sep 17 00:00:00 2001 From: Elon Volo Date: Mon, 11 Oct 2021 18:24:15 -0400 Subject: [PATCH] Fix for TypeScript params with access modifiers and default values --- ...ams-access-modifier-default-param.input.ts | 9 +++++++++ ...ms-access-modifier-default-param.output.ts | 20 +++++++++++++++++++ __tests__/transform-test.js | 1 + utils.js | 20 +++++++++++++++++-- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 __testfixtures__/method-constructor-logparams-access-modifier-default-param.input.ts create mode 100644 __testfixtures__/method-constructor-logparams-access-modifier-default-param.output.ts diff --git a/__testfixtures__/method-constructor-logparams-access-modifier-default-param.input.ts b/__testfixtures__/method-constructor-logparams-access-modifier-default-param.input.ts new file mode 100644 index 0000000..a4ef57b --- /dev/null +++ b/__testfixtures__/method-constructor-logparams-access-modifier-default-param.input.ts @@ -0,0 +1,9 @@ +export class HttpHandler { + + constructor( + protected routes = 5, + ) { + let q = 5; + } + } + \ No newline at end of file diff --git a/__testfixtures__/method-constructor-logparams-access-modifier-default-param.output.ts b/__testfixtures__/method-constructor-logparams-access-modifier-default-param.output.ts new file mode 100644 index 0000000..832948c --- /dev/null +++ b/__testfixtures__/method-constructor-logparams-access-modifier-default-param.output.ts @@ -0,0 +1,20 @@ +// @ts-ignore +function decycle(u){var f=[],c=[];return function p(o,i){var t,e,n,r=o&&o.toJSON instanceof Function?o.toJSON():o;if(typeof r=="object"&&r!==null){for(t=0;t