{"version":3,"file":"dynamic-mapper-angular.mjs","sources":["../../src/lib/mapper.ts","../../src/lib/mapper.module.ts","../../src/public-api.ts","../../src/dynamic-mapper-angular.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken } from '@angular/core';\nimport { Mapper as BaseMapper, MapperConfiguration, Profile } from '@dynamic-mapper/mapper';\n\nexport const MAPPING_PROFILE = new InjectionToken<Profile>('MappingProfile');\n\n@Injectable()\nexport class Mapper extends BaseMapper {\n  constructor(@Inject(MAPPING_PROFILE) profiles: Profile[]) {\n    super(new MapperConfiguration(cfg => profiles.forEach(p => cfg.addProfile(p))));\n  }\n}\n","import { ModuleWithProviders, NgModule, Type } from '@angular/core';\nimport { Mapper, MAPPING_PROFILE } from './mapper';\nimport { Profile } from '@dynamic-mapper/mapper';\n\nexport function createProfileProvider(profile) {\n  return { provide: MAPPING_PROFILE, useClass: profile, multi: true };\n}\n\n@NgModule({\n  providers: [Mapper]\n})\nexport class MapperModule {\n  static withProfiles(profiles: Type<Profile>[]): ModuleWithProviders<MapperModule> {\n    return {\n      ngModule: MapperModule,\n      providers: profiles.map(createProfileProvider)\n    };\n  }\n}\n","/*\n * Public API Surface of mapper-integration\n */\n\nexport * from './lib/mapper.module';\nexport * from './lib/mapper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["BaseMapper"],"mappings":";;;;MAGa,eAAe,GAAG,IAAI,cAAc,CAAU,gBAAgB,EAAE;AAE7E,MACa,MAAO,SAAQA,QAAU,CAAA;AACpC,IAAA,WAAA,CAAqC,QAAmB,EAAA;QACtD,KAAK,CAAC,IAAI,mBAAmB,CAAC,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACjF;AAHU,uBAAA,OAAA,IAAA,GAAA,SAAA,cAAA,CAAA,CAAA,EAAA,EAAA,OAAA,KAAA,CAAA,IAAA,MAAM,cACG,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