1.3.1 • Published 5 years ago

to-redux-type v1.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

to-redux-type

Converts camelCase to SCREAMING_SNAKE_CASE with special considerations for wildcard (*) and handling of short strings (systemRX vs systemRx --> SYSTEM_RX)

By design, for arrays and objects, values that start with @ are not converted and instead are returned without the @ included. This is not escapeable at this time.

Simple Example

import ToReduxType from 'to-redux-type'

// string

const pre = 'myValue'

const post = ToReduxType(pre) ; // MY_VALUE

// object

const pre2 = {
  myValue: 'my value!',
  'SYSTEM_*': 'system wildcard',
  '@noCONVERT': 'no conversion'
}

const post2 = ToReduxType(pre2) ; 
// { MY_VALUE: 'my value!', 'SYSTEM_*': 'system wildcard', 'noCONVERT': 'no conversion' }

// array

const pre3 = [ 'myValue', 'ANOTHER_VALUE', '@@@noCONVERT' ]

const post3 = ToReduxType(pre3) ; // [ 'MY_VALUE', 'ANOTHER_VALUE', '@@noCONVERT' ]
1.3.1

5 years ago

1.3.0

5 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago