Purpose
Implement a drop-in replacement for @nestjs/common's ClassSerializerInterceptor that uses om-data-mapper instead of class-transformer for object serialization.
Benefits
- 17.28x faster serialization performance compared to class-transformer
- Zero-config drop-in replacement for existing NestJS applications
- Full compatibility with existing
@Expose, @Exclude, @Type, and @Transform decorators
- Leverages existing class-transformer compatibility layer in
src/compat/class-transformer/
Scope
- Create new directory:
src/integrations/nestjs/
- Implement
ClassSerializerInterceptor as a thin wrapper over existing classToPlain function
- Support all NestJS serialization options and decorators
- Ensure tree-shaking works correctly (NestJS code should not be bundled if not used)
- Add comprehensive tests
- Update documentation with migration guide and usage examples
API Compatibility
Should work as a drop-in replacement - users only need to change the import path:
- FROM:
import { ClassSerializerInterceptor } from '@nestjs/common';
- TO:
import { ClassSerializerInterceptor } from 'om-data-mapper/nestjs';
References
Purpose
Implement a drop-in replacement for
@nestjs/common'sClassSerializerInterceptorthat usesom-data-mapperinstead ofclass-transformerfor object serialization.Benefits
@Expose,@Exclude,@Type, and@Transformdecoratorssrc/compat/class-transformer/Scope
src/integrations/nestjs/ClassSerializerInterceptoras a thin wrapper over existingclassToPlainfunctionAPI Compatibility
Should work as a drop-in replacement - users only need to change the import path:
import { ClassSerializerInterceptor } from '@nestjs/common';import { ClassSerializerInterceptor } from 'om-data-mapper/nestjs';References
src/compat/class-transformer/