Socket
Socket
Sign inDemoInstall

@buka/class-transformer-extra

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @buka/class-transformer-extra

class-transformer-extra contains methods that's aren't included in the class-transform package.


Version published
Weekly downloads
28
Maintainers
1
Install size
1.79 MB
Created
Weekly downloads
 

Changelog

Source

1.1.1 (2024-02-19)

Bug Fixes

  • unabled published to npm (056bff2)

Readme

Source

@buka/class-transformer-extra

version downloads dependencies license Codecov

@buka/class-transformer-extra contains methods that's aren't included in the class-transformer package.

Install

npm install @buka/class-transformer-extra class-transformer
# OR
yarn install @buka/class-transformer-extra class-transformer
# OR
pnpm install @buka/class-transformer-extra class-transformer

Usage

String

methodbefore transformerafter transformer
@Split(",")"a,b,c"["a", "b", "c"]
@Trim()" abc ""abc"
@ToString()123"123"
@ToLowerCase()"ABC""abc"
@ToUpperCase()"abc""ABC"
@Replace("-", "_")"a-b-c""a_b_c"

Date

methodbefore transformerafter transformer
@ToDate()"2024-01-01"new Date("2024-01-01")
@FormatDate("YYYY/MM/DD")"2024-01-01""2024/01/01"

Number

methodbefore transformerafter transformer
@ToNumber()"123"123
@ToBigInt()"123"123n

Boolean

methodbefore transformerafter transformer
@ToBoolean()1true

Array

methodbefore transformerafter transformer
@Filter((num: number) => num > 3)[1,2,3.4,5][4,5]
@Flatten()[1, [2, [3, 4, [5]]]][1,2,3,4,5]
@Uniq()[1,1,2,3,4,4,5][1,2,3,4,5]
@UniqBy(Math.abs)[-1, 1, 2, 3, -3][-1, 2, 3]

Contribute

If you want to report bug or add new decorators, please submit an Issue or Pull Request.

Keywords

FAQs

Last updated on 19 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc