Download the PHP package bahadirbirsoz/converter without Composer
On this page you can find all versions of the php package bahadirbirsoz/converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bahadirbirsoz/converter
More information about bahadirbirsoz/converter
Files in bahadirbirsoz/converter
Package converter
Short Description A class library to convert c# or typescript entity files to dart entity files.
License MIT
Informations about the package converter
The Converter Library
A class library to convert c# entity files to dart entity files.
The idea is to read and parse given file in c# and export dart files with .toJson .fromJson .toMap .fromMap .fromJsonArray methods and parsing json inputs in given entity.
Parser and the writer is planned as abstract classes. But it's a little bir hard to implement an abstract class that applies multiple programming languages. Oh the other hand oop concept is about the same. So, writer is more applicable for abstraction.
Writer will depend on template rendering. So a template engine shall be added to this.
In the end, this class may convert entities from various languages to various languages. It may also have some database reading or writing capabilities.
Years later, TypesScript parser added.
Docker Install
To install this library as docker image, I'm working on it. There are a few issues about host file system
Install
To install this library as global, you can add path of bin
directory to your PATH
variable.
Usage
Currently converting with a config file is supportted.
{ "source": "entities", "source_ext": "cs", // or "ts" "target": "export", "target_ext": "dart" }
Run followig
API
You can read the code for the moment.
TESTS
Tests may include checking if the code is the same after a few conversion.