Skip to content

Commit

Permalink
removed @field everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Dec 20, 2019
1 parent 19f89f5 commit ad8fb42
Show file tree
Hide file tree
Showing 22 changed files with 731 additions and 780 deletions.
22 changes: 11 additions & 11 deletions packages/benchmark/bench-big.spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import 'jest';
import 'reflect-metadata';
import {classToPlain, EnumField, Exclude, Field, plainToClass} from "../core";
import {classToPlain, f, plainToClass} from "../core";
import {plainToClass as classTransformerPlainToClass, classToPlain as classTransformerClassToPlain, Exclude as ctExclude, Transform, Type} from "class-transformer";
import {bench} from "./util";
import {Plan, SubModel} from "@marcj/marshal/tests/entities";

export class SimpleModel {
@Field()
@f
name: string;

@Field()
@f
type: number = 0;

@Field()
@f
yesNo: boolean = false;

@EnumField(Plan)
@f.enum(Plan)
plan: Plan = Plan.DEFAULT;

@Field()
@f
created: Date = new Date;

@Field([String])
@f.array(String)
types: string[] = [];

@Field([SubModel])
@f.array(SubModel)
children: SubModel[] = [];

@Field({SubModel})
@f.map(SubModel)
childrenMap: { [key: string]: SubModel } = {};

notMapped: { [key: string]: any } = {};

@Field().exclude()
@f.exclude()
excluded: string = 'default';

@Field().exclude('plain')
@f.exclude('plain')
excludedForPlain: string = 'excludedForPlain';

constructor(name: string) {
Expand Down
6 changes: 3 additions & 3 deletions packages/benchmark/bench.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'jest';
import 'reflect-metadata';
import {classToPlain, Field, plainToClass} from "../core";
import {classToPlain, f, plainToClass} from "../core";
import {plainToClass as classTransformerPlainToClass, classToPlain as classTransformerClassToPlain} from "class-transformer";
import {bench} from "./util";


export class MarshalSuperSimple {
constructor(
@Field() public id: number,
@Field() public name: string
@f public id: number,
@f public name: string
) {}
}

Expand Down

0 comments on commit ad8fb42

Please sign in to comment.