# to-redux-type

> Converts strings, objects, and arrays to redux action types (screaming snake case) (myValue -> MY_VALUE)

Latest version **1.3.1** (published 2018-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-redux-type
pnpm add to-redux-type
yarn add to-redux-type
bun add to-redux-type
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2018-11-10 |
| First published | 2017-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Braden R. Napier |
| Maintainers | bradynapier |
| Keywords | react, redux, camelCase, screaming snake case, redux-saga, action types, reducers |

## Links

- npm: https://www.npmjs.com/package/to-redux-type
- Repository: https://github.com/Dash-OS/to-redux-type
- Homepage: https://github.com/Dash-OS/to-redux-type#readme
- Issues: https://github.com/Dash-OS/to-redux-type/issues
- npm.io page: https://npm.io/package/to-redux-type

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2018-11-10
- 1.3.0 — 2018-11-10
- 1.2.3 — 2017-05-30
- 1.2.2 — 2017-05-30
- 1.2.1 — 2017-05-29
- 1.2.0 — 2017-05-29
- 1.1.0 — 2017-05-29
- 1.0.2 — 2017-05-28

## README

# 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

```js
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' ]

```

---
_Source: https://npm.io/package/to-redux-type · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
