An express transformer, validator library
Proper decorator-based transformation / serialization / deserialization of plain javascript objects to class constructors
TS Compiler transformer for formatjs
A Metro config for running React Native projects with the Metro bundler
This is a library to aid in instrumenting Node.js libraries at build or load time.
The Hermes runtime, used by React Native for Android, is able to output [Chrome Trace Events](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview) in JSON Object Format.
SVG transformer for react-native
Perform rapid conversation and validation of JSON structure between Postman Collection Format v1 and v2
Stream transformer that prefixes lines with timestamps and other things.
remark plugin to transform remark syntax tree (mdast) to Slate document tree, and vice versa. Made for WYSIWYG markdown editor.
🚇 Config parser for Metro.
Jest transformer for LWC and engine
Modify the values of an object
Patch typescript to support custom transformers in tsconfig.json
Fast, unopinionated, minimalist web framework
<h1 align="center"> Hermes Profile Transformer </h1>
a jest transformer for testing with svg files in react
This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)
Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.
TypeScript transformer that enforces error handling via branded Throws<T, E> types
to help transform on
Tools for minimal TypeScript transpilation of Vue SFCs
Javascript implementation of ANTLR Grammar for the OpenFGA DSL and parser from and to the OpenFGA JSON Syntax
Ts transform plugins helpers
Provides a series of s-expression transformations useful for automatic refactoring or morphing of Ruby/Rails/Sinatra code.
A simple DSL for expressing and evaluating basic Matrix transformations and arithmetic operations
A compiler and library that transforms highly readable Simple Regex Language patterns into regular expressions.
json_data_extractor makes it easy to extract data from complex JSON structures, such as API responses or configuration files, using a schema that defines the path to the data and any necessary transformations. The schema is defined as a simple Ruby hash that maps keys to paths and optional modifiers.
Re:map; an expressive and feature-rich data transformation mapper for Ruby 3. It gives the developer the expressive power of JSONPath, without the hassle of using strings. Its compiler is written on top of an immutable, primitive data structure utilizing ruby's refinements & pattern matching capabilities – making it blazingly fast
jrf is a JSON filter with the power and speed of Ruby. It lets you write transforms as Ruby expressions, so you can use arbitrary Ruby logic. It supports extraction, filtering, flattening, sorting, and aggregation in stage pipelines.
Morphix provides a clear, expressive DSL for transforming data structures in Ruby. Perfect for API response normalization, JSON reshaping, and ETL pipelines.
Less2Sass is an easy to use converter between Less and Sass, respectively SCSS, dynamic stylesheet formats. It is based on abstract syntax tree transformation instead of the common string replacement methods using regular expressions. It does not support a lot of language features, yet. However, when finished, it will offer the developers an easy way to convert between these formats without the following manual conversion as it is today.
The DynamicSchema gem provides a elegant and expressive way to define a domain-specific language (DSL) schemas, making it effortless to build and validate complex Ruby hashes. This is particularly useful when dealing with intricate configurations or interfacing with external APIs, where data structures need to adhere to specific formats and validations. By allowing default values, type constraints, nested schemas, and transformations, DynamicSchema ensures that your data structures are both robust and flexible. New in 2.0, DynamicSchema adds DynamicSchema::Struct which faciliates effortless definition and construction of complex object hierarchies, with optional type coersion and validation. Where DynamicSchema simplified configuration and API payload construction, DynamicSchema::Struct simplifies construction of complex API reponses.
== Synopsys Class-level configuration DSL == Installation gem install config_accessor == Examples require 'config_accessor' class Remote configurable! config_accessor :host, :default => "localhost" config_accessor :port, :default => "80", :transform => :to_i config_accessor :proxy_host, :proxy_port end class Local < Remote config_accessor :l_port end Remote.host # => "localhost" Remote.port # => 80 Remote.proxy_host # => nil r = Remote.new r.port = "81" r.port # => 81 Remote.port # => 80 Remote.port = 82 # next expressions are equivalent r.port # => 81 r.config[:port] # => 81 r.config["port"] # => 81 r.config.port # => 81 # It supports inheritance, subclasses cannot change superclasses configurations Local.port # => 80 # You can do it with +configure+ method Local.configure do port 81 end # or Local.configure do |config| config.port 81 end
# Procer **NOTE: Experimental. Use it to experience what a default `to_proc` could have been. For production code, I recommend an explicit transformation, like the one provided by the gem `jgomo3-func`**. A reasonable good default `to_proc` method for all objects. Install with: ``` gem install procer ``` When you require Procer, all objects will have a default `to_proc` method which will try to call one of the following methods, in the given order: - `call` - `[]` - `===` Many methods which receive a block, can benefit greatly from this because you can now pass an object to perform the block role. Think of the Enumerable module and all its methods. Many objects define `===`, but not `to_proc`. So they will be nicely usable in a `case/when` expression, but not in other contexts. This is the case of classes and ranges, which you can use in `case/when` expressions, but they don't define `to_proc`. Now they do define `to_proc` so they are useful in those contexts. Examples: ```ruby require 'procer' [1, 2, '3', '4', 5, 6].filter(&Numeric) # => [1, 2, 5, 6] [-10, 100, -2, 3, 20, -33].filter(&(0..50)) # => [3, 20] ``` Also, Hashes already implement `to_proc` and that is useful with Enumerator. We can use it as a transformation table with `map`: ```ruby table = { 1 => 'one', 2 => 'two', 3 => 'three' } [3, 1, 2].map(&table) # => ['three, 'one, 'two'] ``` Sadly, Arrays, even when they have the same interface as hashes as a function of indices, don't implement `to_proc` and so they can't be used in the same way. Until now. ```ruby table = ['zero', 'one', 'two'] [2, 0, 1].map(&table) # => ['two', 'zero', 'one'] ``` Alternatively, you could have used `values_at`: ```ruby table.values_at([3, 1, 2]) # In the Hash example table.values_at([2, 0, 1]) # In the Array example ``` But the map solution is more generic and `table` can be anything that implements `to_proc` and not something that necessarily implements `values_at`. Notice that if the object implements `[]` that will triumph over `===`. It was unexpected when I tried to use Integers as the object, as they implement `[]` as a way to access their binary form: ```ruby 5 # b101 [5[2], 5[1], 5[0]] # [1, 0, 1] ``` So the proc will work like that: ```ruby [2, 4, 5].map(&5) # Actual => [1, 0, 0] # I was expecting => [false, false, true] ```
= sql_valued_columns SqlValuedColumns is an ActiveRecord plugin that will let you have specific SQL statements executed on INSERT / UPDATE. It will call the SQL function you provide, passing the arguments specified in the call to sql_column. See the documentation for SqlValuedColumns::ClassMethods#sql_column for more information regarding usage, including passing Strings and Proc objects as arguments to your SQL function. Example: You have a model with two columns, one named "another_column" and the other named "size_of_another_column". Whenever you insert data into "another_column", you want to have size_of_another_column have the result of the SQL function LENGTH inserted into it. class MyModel < ActiveRecord::Base sql_column :size_of_another_column, "LENGTH", :another_column end Example 2: You have a model with three columns, position, latitude and longitude. Latitude and longitude are values expressed as angles, and position is a special datatype for your database that represents the X/Y/Z projection of that particular latitude and longitude (example: http://www.postgresql.org/docs/8.3/static/earthdistance.html ) When you insert data with latitude and longitude, you want to automatically call a function in your database to transform the latitude and longitude into the appropriate represenation. class MyModel < ActiveRecord::Base sql_column :position, "ll_to_earth", :latitude, :longitude end Example 3: You are an insane criminal who has somehow learned SQL. You would like to make anyone who runs your code to suffer database punishing queries and odd security and data formatting issues that will make them rue the day they ever learned of computers. class MyModel < ActiveRecord::Base sql_column :a_column, "(SELECT count(id) FROM large_list_of_things)", :raw => true sql_column :another_column, '(SELECT count(other_id) FROM other_large_list_of_things WHERE some_column = \'#{some_model_method}\')', :raw => true end == Notes No tests yet, am lazy. == Copyright Copyright (c) 2009 Chris Zelenak. See LICENSE for details.