A TypeScript string enum for compile-time safety when working with event.key
Sort interface and string enum keys
TypeScript Enum Utilities
Transform TypeScript `const` enums
[](https://travis-ci.org/mulesoft-labs/yaml-ast-parser)
Library for getting the names and values of typescript enum
HTTP methods as a TypeScript enum.
Babel preset for TypeScript `const` enums
HTTP status codes as a TypeScript enum.
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Sanitize strings for use as JavaScript identifiers & property names
Enum utilities for typescript, inspired by flow enums
Shared Zod schemas for Clipboard's contracts.
A TypeScript enum of all locales, such as "en-US".
gRPC utility library for loading .proto files
Infer typescript types from your JSON schemas!
ActiveRecord-style API for IndexedDB with TypeScript support
compile json schema to typescript typings
Shareable commitlint config enforcing conventional commits
Modern type-safe way of building CLIs
Walks your node_modules tree
PostgreSQL AST utils for pgsql-parser
`safety-match` provides pattern matching for JavaScript, TypeScript, and Flow.
Builds a logical conjunction (AND) of multiple JSON schemas
Make ActiveRecord 4's Enum store as strings instead of integers.
Gem provide ability to use enum of active record with string field at postgreSQL and store available values at config(yml file)
Enumify lets you add an enum command to ActiveRecord models There are four things that the enumify gems adds to your model Validation - The enumify adds a validation to make sure that the field only receives accepted values Super Cool Methods - adds ? and ! functions for each enum value (canceled? - is it canceled, canceled! - change the state to canceled) Callback support - you can add a x_callback method which will be called each time the status changes Scopes - you can easily query for values of the enum
== StringEnum is a concern that makes it easy to work with enums. Include the module, then invoke the class method string_enum with the attribute name followed by the list of valid values. This will add checks, writers, and constants for each value.
Enumerate adds an `enumerate` command to all ActiveRecord models, enabling you to work with string or integer columns as if they were enums. The following features are added to your model: Validation - ensures that the field only receives accepted values Predicate Methods - adds ? and ! functions for each enum value Scopes - you can easily query for values of the enum
A simple Gem to enable any `ActiveRecord::Base` object to store a set of attributes in a set like structure represented through a bitfield on the database level. You only have to specify the name of the set to hold the attributes in question an the rest is done for you through some fine selected Ruby magic. Here is a simple example of how you could use the gem: class Person < ActiveRecord::Base has_set :interests end To get this to work you need some additional work done first: 1. You need an unsigned 8-Byte integer column in your database to store the bitfield. It is expected that the column is named after the name of the set with the suffix `_bitfield` appended (e.g. `interests_bitfield`). You can change that default behavior by providing the option `:column_name` (e.g. `has_set :interests, :column_name => :my_custom_column`). 2. You need a class that provides the valid values to be stored within the set and map the single bits back to something meaningful. The class should be named after the name of the set (you can change this through the `:enum_class` option). This class could be seen as an enumeration and must implement the following simple interface: * There must be a class method `values` to return all valid enumerators in the defined enumeration. * Each enumerator must implement a `name` method to return a literal representation for identification. The literal must be of the type `String`. * Each enumerator must implement a `bitfield_index` method to return the exponent of the number 2 for calculation the position of this enumerator in the bitfield. **Attention** Changing this index afterwards will destroy your data integrity. Here is a simple example of how to implement such a enumeration type while using the the `renum` gem for simplicity. You are free to use anything else that matches the described interface. enum :Interests do attr_reader :bitfield_index Art(0) Golf(1) Sleeping(2) Drinking(3) Dating(4) Shopping(5) def init(bitfield_index) @bitfield_index = bitfield_index end end