I'm delving into the world of the typescript compiler API and it seems like there's something I am overlooking. I am trying to find a way to update a specific object in a .ts file using the compiler API.
Current file - some-constant.ts
export const someConstant = {
name: 'Jhon',
lastName: 'Doe',
additionalData: {
age: 44,
height: 145,
someProp: 'OLD_Value'
/**
* Some comments that describes what's going on here
*/
}
};
In the end, my desired outcome is as follows:
export const someConstant = {
name: 'Jhon',
lastName: 'Doe',
additionalData: {
age: 999,
height: 3333,
someProp: 'NEW_Value'
eyeColor: 'brown',
email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93e0fcfef6f6fef2faffd3f4fef2faffbdf0fcfe">[email protected]</a>',
otherProp: 'with some value'
}
};