1.0.9 • Published 12 days ago

@anchan828/typeorm-transformers v1.0.9

Weekly downloads
561
License
MIT
Repository
github
Last release
12 days ago

@anchan828/typeorm-transformers

npm NPM

Description

Transformer collection for TypeORM

Installation

$ npm i --save typeorm @anchan828/typeorm-transformers

Transformers

BooleanTransformer

Transform value between integer and boolean.

@Entity()
class BooleanTransformerTest extends BaseEntity {
  @PrimaryGeneratedColumn()
  public id!: number;

  @Column({
    type: "tinyint",
    width: 1,
    nullable: true,
    transformer: new BooleanTransformer(),
  })
  public bool!: boolean;
}

JsonTransformer

Transform value between object and json.

Note: The JsonTransformer stores JSON as a string, not as a JSON type.

class TestJson {
  name!: string;
}
@Entity()
class JsonTransformerTest extends BaseEntity {
  @PrimaryGeneratedColumn()
  public id!: number;

  @Column({
    type: "varchar",
    width: 255,
    nullable: true,
    transformer: new JsonTransformer<TestJson>({ name: "test" }),
  })
  public data!: TestJson;
}

StaticFileTransformer

Transform value between data and filePath.

@Entity()
class StaticFileTransformerTest extends BaseEntity {
  @PrimaryGeneratedColumn()
  public id!: number;

  @Column({
    transformer: new StaticFileTransformer({ dirname: tmpdir() }),
    type: "varchar",
  })
  public file!: BinaryLike;
}

License

MIT

1.0.9

12 days ago

1.0.8

19 days ago

1.0.7

26 days ago

1.0.6

1 month ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

1.0.5

1 month ago

1.0.4

2 months ago

1.0.3

2 months ago

0.9.0

2 months ago

0.8.11

2 months ago

0.8.10

3 months ago

0.8.9

3 months ago

0.8.8

3 months ago

0.8.5

4 months ago

0.8.4

4 months ago

0.8.7

3 months ago

0.8.6

4 months ago

0.7.20

5 months ago

0.7.19

5 months ago

0.7.18

5 months ago

0.7.17

6 months ago

0.7.16

6 months ago

0.8.1

5 months ago

0.8.0

5 months ago

0.8.3

4 months ago

0.8.2

4 months ago

0.7.13

6 months ago

0.7.12

7 months ago

0.7.15

6 months ago

0.7.14

6 months ago

0.7.11

7 months ago

0.7.10

7 months ago

0.7.9

7 months ago

0.7.8

8 months ago

0.7.7

8 months ago

0.7.6

8 months ago

0.7.5

8 months ago

0.7.4

9 months ago

0.7.3

9 months ago

0.7.2

9 months ago

0.7.1

9 months ago

0.7.0

9 months ago

0.6.6

9 months ago

0.6.5

10 months ago

0.6.4

10 months ago

0.6.3

10 months ago

0.6.2

10 months ago

0.6.1

10 months ago

0.5.3

11 months ago

0.5.2

11 months ago

0.5.1

11 months ago

0.4.39

11 months ago

0.5.0

11 months ago

0.4.38

11 months ago

0.4.37

11 months ago

0.4.36

11 months ago

0.4.35

12 months ago

0.4.34

12 months ago

0.4.33

12 months ago

0.4.31

1 year ago

0.4.32

1 year ago

0.4.30

1 year ago

0.4.28

1 year ago

0.4.29

1 year ago

0.4.27

1 year ago

0.4.26

1 year ago

0.4.25

1 year ago

0.4.24

1 year ago

0.4.23

1 year ago

0.4.22

1 year ago

0.4.21

1 year ago

0.4.20

1 year ago

0.4.19

1 year ago

0.4.18

1 year ago

0.4.17

1 year ago

0.4.16

1 year ago

0.4.15

1 year ago

0.4.14

1 year ago

0.4.13

1 year ago

0.4.12

1 year ago

0.4.11

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.65

2 years ago

0.3.64

2 years ago

0.3.63

2 years ago

0.3.61

2 years ago

0.3.60

2 years ago

0.3.59

2 years ago

0.3.58

2 years ago

0.3.57

2 years ago

0.3.56

2 years ago

0.3.55

2 years ago

0.3.54

2 years ago

0.3.53

2 years ago

0.3.52

2 years ago

0.3.51

2 years ago

0.3.50

2 years ago

0.3.49

2 years ago

0.3.48

2 years ago

0.3.47

2 years ago

0.3.46

2 years ago

0.3.45

2 years ago

0.3.44

2 years ago

0.3.43

2 years ago

0.3.42

2 years ago

0.3.41

2 years ago

0.3.40

2 years ago

0.3.39

2 years ago

0.3.38

2 years ago

0.3.37

2 years ago

0.3.36

2 years ago

0.3.35

2 years ago

0.3.34

2 years ago

0.3.33

2 years ago

0.3.32

2 years ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.29

2 years ago

0.3.28

2 years ago

0.3.27

3 years ago

0.3.26

3 years ago

0.3.25

3 years ago

0.3.24

3 years ago

0.3.22

3 years ago

0.3.21

3 years ago

0.3.20

3 years ago

0.3.19

3 years ago

0.3.18

3 years ago

0.3.17

3 years ago

0.3.16

3 years ago

0.3.15

3 years ago

0.3.14

3 years ago

0.3.13

3 years ago

0.3.12

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.9

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago