Library for create enum which support object as values. This library simulation as Swift associated values or Rust enum
TypeScript Enum Utilities
Shareable commitlint config enforcing conventional commits
Copy a descriptor from object A to object B
Persistent ordered mapping from strings
Define a lazily evaluated property on an object
Delete nested properties from an object using dot notation.
Toptal Graphql codegen extensions
Set nested properties on an object using dot notation.
[](https://travis-ci.org/mulesoft-labs/yaml-ast-parser)
HTTP server cookie parsing and serialization
Types for Iconify data
Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.
An utility library to get all values/keys of a Typescript enum
Parses set-cookie headers into objects
Generate hashes from javascript objects in node and the browser.
Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library we tested does this, or does it correctly).
Lowercase the keys of an object
Read/write IEEE754 floating point numbers from/to a Buffer or array-like object
Properties file reader for Node.js
Binary value packing and unpacking
Returns true if a value is a plain object, array or function.
Modify the values of an object
foreach component + npm package
Type system for Ruby supporting coercions, constraints and complex types like structs, value objects, enums etc
This is a simpler wrapper object to make it easy to build usefule Enum/Value Objects
SwifterEnum transforms Rails enums from simple values into powerful objects with methods, computed properties, and type safety. Your enums become smart: payment_status.can_refund?, subscription.price, status.icon - all while maintaining 100% Rails enum compatibility. Drop-in replacement that eliminates scattered helper methods and case statements throughout your codebase.
Provides a lightweight solution for object-oriented enumerations in Ruby in a similar ways as other languages, like Java, do. It consists of a single class (Enum), that can be subclassed to create enumerated types. Each class has a set of predefined instances, that represent the enumerated values. Fatures like support for inheritance and declaring instance methods on enumerated values are supported as well.
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
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.