The TypeScript code string to extract the class member access modifiers from.
A record where the keys are the names of the class members and the values are their corresponding access modifiers.
This function does not handle public class members as they do not explicitly have an access modifier in TypeScript.
an error if the provided code string is not valid TypeScript code.
const code = `
class MyClass {
private myPrivateMethod() {}
protected myProtectedMethod() {}
}`;
tsGetClassMemberAccessModifiers(code);
//=> { myPrivateMethod: 'private', myProtectedMethod: 'protected' }
Generated using TypeDoc
Returns a map of the private and protected class properties and methods of the provided TypeScript code for a class.