enum_as_string 1.0.0+3 copy "enum_as_string: ^1.0.0+3" to clipboard
enum_as_string: ^1.0.0+3 copied to clipboard

A simple utility library for enum-to-string and string-to-enum conversions.

A tiny, simple utility package for enum-to-string and string-to-enum conversions #

This package was originally a fork of enum_to_string by Ryan Knell (rknell). Most code has been rewritten, and large parts of it removed as they were deemed unnecessary, such as string-to-enum-list and camelCase to Start Case value conversions.

Usage #

Conversion of an enumerator value to a string (enum-to-string):

Enum.asString(Direction.up); // Returns 'up'

Conversion of a string to an enumerator value (string-to-enum):

Enum.fromString(Countries.values, 'elSalvador'); // Returns 'Countries.elSalvador'
1
likes
150
pub points
3%
popularity

Publisher

unverified uploader

A simple utility library for enum-to-string and string-to-enum conversions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on enum_as_string