No description
Find a file
dependabot[bot] 0983b5e64c
Bump jiro4989/setup-nim-action from 1 to 2 (#25)
Bumps [jiro4989/setup-nim-action](https://github.com/jiro4989/setup-nim-action) from 1 to 2.
- [Release notes](https://github.com/jiro4989/setup-nim-action/releases)
- [Commits](https://github.com/jiro4989/setup-nim-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: jiro4989/setup-nim-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-23 11:06:10 +01:00
.github Bump jiro4989/setup-nim-action from 1 to 2 (#25) 2025-12-23 11:06:10 +01:00
docs/book #20 Fix Usage typo 2023-09-27 19:47:09 +02:00
src #13 add nimibook (#15) 2023-09-21 17:22:52 +02:00
tests Develop (#12) 2023-09-10 14:24:48 +02:00
changelog.md #20 Fix Usage typo 2023-09-27 19:47:09 +02:00
mapster.nimble Make micros version static 2023-10-23 17:01:33 +01:00
nbook.nim #20 Fix Usage typo 2023-09-27 19:47:09 +02:00
nimib.toml #13 add nimibook (#15) 2023-09-21 17:22:52 +02:00
README.md #20 Fix Usage typo 2023-09-27 19:47:09 +02:00

Mapster

Run Tests

Because life's too short to map A to B

Mapster is a simple package to help generate procedures/functions for you to map an instance of type A to type B.

Very often A and B share a lot of fields and there is only a small set of exceptions where actual logic is required.

Mapster helps by adding all assignments from instance A to B to the proc for you where the field names and types are identical, allowing you to focus on the few fields that require logic.

Installation

Install Mapster with Nimble:

$ nimble install -y mapster

Add Mapster to your .nimble file:

requires "mapster"

Supports

Operations

  • Single Parameter mapping procs(A --> B)
  • Multi Parameter mapping procs ((A1, A2, ...) --> B)
  • In-place mapping procs (var A, B)
  • Multi Parameter in-place mapping procs (var A, B1, B2, ...)
  • Any amount of custom assignments or logic within the (in-place) mapping procs
  • Optional: Compile-time validation for your (in-place) mapping procs!

Types

  • Object types
  • Object Variant Types (only with mapVariant)
  • Ref Object Types
  • Ref Object Variant Types (only with mapVariant)
  • Named Tuple Types

Getting Started

Take a look at the nimibook docs!