Hi all,
As anyone ever used ts-node/ts-morph. I'm trying to get my params to happen on new lines, but the life of me, no matter what I do. It seems to add them all to the same line.
This is the snippet of logic
const paramsToAdd = [
{ name: 'route', type: 'ActivatedRoute' + '\n', scope: Scope.Protected },
{ name: 'location', type: 'Location' + '\n', scope: Scope.Protected },
{ name: 'routeService', type: 'RouteStateService' + '\n', scope: Scope.Protected },
];
paramsToAdd.forEach(param => {
if (!constructor.getParameter(param.name)) {
constructor.addParameter(param);
}
});
I tried using a writer instead, didn't work
paramsToAdd.forEach(param => {
if (!constructor.getParameter(param.name)) {
constructor.addParameter(writer => {
writer.write(param + '\n');
});
}
});
Any idea's would be greatly appreciated