0.3.1 • Published 3 years ago
@fresha/code-morph-ts v0.3.1
@fresha/code-morph-ts
This package simplifies programmatic generation and modification of TypeScript
code. It bases itself on ts-morph, providing additional functionality.
Installation
$ npm install @fresha/code-morph-tsUsage
addImportDeclaration,addImportDeclarations- add one or more import declarations. Prevents duplicate imports.addConstant,addVariable- define a constant or a variableaddFunction- add a function declarationaddObjectLiteralProperty,addObjectLiteralProperties,addObjectLiteralObjectProperty,addObjectLiteralArrayProperty- add one or more properties to an object literaladdDecorator- add a decoratoraddTypeAlias,addTypeLiteralAlias- add type aliasesaddTypeLiteralProperty,addFunctionTypeProperty,addTypeLiteralCall- add one or more properties to type literals