Socket
Socket
Sign inDemoInstall

@automapper/core

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automapper/core

AutoMapper TypeScript Core


Version published
Weekly downloads
49K
increased by4.71%
Maintainers
1
Weekly downloads
 
Created
Source

@automapper/core

This is the core package that will handle mapping configurations and mapping operations.

Installation

npm i @automapper/core

or with yarn

yarn add @automapper/core

Usage

@automapper/core exposes createMapper() method to create a Mapper object with a accompany MappingStrategy (read more about Strategies)

createMapper accepts a CreateMapperOptions object with the following shape:

export interface CreateMapperOptions {
    strategyInitializer: MappingStrategyInitializer<MetadataIdentifier>;
    errorHandler?: ErrorHandler;
    namingConventions?: NamingConventionInput;
}

Read more about usage on documentation site

Strategies

A given Mapper is accompanied by a Strategy by providing strategyInitializer when using createMapper().

A Strategy will be responsible for:

  • Discover metadata (eg: classes uses @AutoMap() decorator to discover the metadata of the properties on the Classes)
  • Retrieve metadata: how the metadata should be retrieved from the discovery phase (eg: classes discovers and stores the metadata to Reflect, retrieve metadata simply gets them from Reflect)
  • Apply metadata: how the metadata is applied to the Model

@automapper provides the following official strategies:

  • @automapper/classes: Work with TS/ES6 classes.
  • @automapper/pojos: Work with Interfaces/Types along with POJOs. In projects that do not make use of Class, pojos can be used instead.
  • @automapper/mikro: Work together with TS/ES6 classes along with MikroORM
  • @automapper/sequelize: Work together with TS/ES6 classes along with Sequelize

Keywords

FAQs

Package last updated on 23 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc