1.0.4 • Published 1 year ago

ts-enum-plus v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
1 year ago

ts-enum-plus

This repo contains a typescript enum expand class and decorators

Getting started

npm i ts-enum-plus --save

or 

yarn add ts-enum-plus --save

Simple Example

class SimpleEnums extends EnumPlus {
    @EnumDesc(1, '销售出货')
    static test1: SimpleEnums;

    @EnumDesc(2, '货物调拨')
    static test2: SimpleEnums;
}

SimpleEnums.test1.getKey() // 1
SimpleEnums.test1.getValue() // 销售出货
SimpleEnums.test2.getKey() // 2
SimpleEnums.test2.getValue() // 货物调拨
SimpleEnums.findValue(1) // 销售出货
SimpleEnums.findValue(2) // 货物调拨
SimpleEnums.findKey('销售出货') // 1
SimpleEnums.findKey('货物调拨') // 2
SimpleEnums.toArray() // [{key: 1, value: '销售出货'}, {key: 2, value: '货物调拨'}]
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago