1.0.2 • Published 9 months ago

data-transfer-object-ts v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

DTO TS

This package provides Data Transfer Object functions. With this package, you can easily convert your data to DTO.

Installation

  • Using NPM

    npm install data-transfer-object-ts

Usage

  1. Import the components into your project
    import NativeDTO from 'data-transfer-object-ts'
  2. Use functions in your project
     const data = {
       name: 'John',
       surname: 'Doe',
       age: 25,
       address: {
          city: 'New York',
          country: 'USA',
       },
     }
     const encodedData = NativeDTO.encode(data)
     console.log(encodedData)
     const decodedData = NativeDTO.decode(encodedData)
     console.log(decodedData)

Type

OptionType
payload{ type: string, data?: any}

API

OptionType
encode( payload: payload ) => string
decode( data: string) => payload

Contributing

All contributions are welcome. If you would like to contribute to this project, feel free to submit pull requests. Prior to making significant changes, I recommend opening an issue to discuss the changes.

License

This project is licensed under the MIT license. For more information, refer to the LICENSE file.

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago