mapster

A library to quickly generate functions converting instances of type A to B

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-22 05:29

Installation

nimble install mapster
choosenim install mapster
git clone https://github.com/PhilippMDoerner/mapster

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
mapster - - - - - - -

Source

Repository https://github.com/PhilippMDoerner/mapster
Homepage https://github.com/PhilippMDoerner/mapster
Registry Source nimble_official

README

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!