# @umm/enum-tryparse

> Enum.TryParse for .NET 3.5

Latest version **0.1.1** (published 2017-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @umm/enum-tryparse
pnpm add @umm/enum-tryparse
yarn add @umm/enum-tryparse
bun add @umm/enum-tryparse
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-07-21 |
| First published | 2017-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Tetsuya Mori |
| Maintainers | monry |

## Links

- npm: https://www.npmjs.com/package/@umm/enum-tryparse
- Repository: https://github.com/umm-projects/enum_tryparse
- Issues: https://github.com/umm-projects/enum_tryparse/issues
- npm.io page: https://npm.io/package/@umm/enum-tryparse

## Dependencies (3)

- [rsync](https://npm.io/package/rsync.md) ^0.6.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.1

## Recent versions

- 0.1.1 (latest) — 2017-07-21
- 0.1.0 — 2017-07-21

## README

# What?

* `Enum.TryParse` を Unity でも使えるようにする

# Why?

* 2017年7月時点の Unity C# は .NET 3.5 を利用しており、 `Enum.TryParse` は .NET 4.0 以降の機能である
    * 一応 Unity 2017 では Experimental の機能として .NET 4.6 は使えるけどね
* チョイチョイ使いたいシーンがあるので、無理矢理実装してみた

# Install

```shell
$ npm install @umm/enum-tryparse
```

# Usage

```csharp
using ForwardCompatibility;

class Sample {
    enum Hoge {
        Unknown,
        Foo,
        Bar,
    }
    void Fuga() {
        Hoge hoge;
        if (!Enum.TryParse("Fuga", out hoge)) {
            hoge = Hoge.Unknown;
        }
    }
}
```

# License

Copyright (c) 2017 Tetsuya Mori

Released under the MIT license, see [LICENSE.txt](LICENSE.txt)

---
_Source: https://npm.io/package/@umm/enum-tryparse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
