MCPcopy
hub / github.com/lebab/lebab / transform

Method transform

src/transform/class/PotentialClass.js:92–101  ·  view source on GitHub ↗

* Replaces original constructor function and manual prototype assignments * with ClassDeclaration.

()

Source from the content-addressed store, hash-verified

90 * with ClassDeclaration.
91 */
92 transform() {
93 multiReplaceStatement({
94 parent: this.parent,
95 node: this.fullNode,
96 replacements: [this.toClassDeclaration()],
97 });
98 this.replacements.forEach(multiReplaceStatement);
99
100 this.methods.forEach(method => method.remove());
101 }
102
103 toClassDeclaration() {
104 return {

Callers 1

leaveFunction · 0.80

Calls 3

toClassDeclarationMethod · 0.95
multiReplaceStatementFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected