8000 GitHub - jtannas/katachi: A tool for describing and validating objects as intuitively as possible.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jtannas/katachi

Repository files navigation

Gem Version Coverage Status CodeRabbit Pull Request Reviews

Katachi

A tool for describing and validating objects as intuitively as possible.

Katachi.compare(
    value: {name: 'John', age: 30},
    shape: {name: String, age: Integer}
).match? # => true

Find out more at jtannas.github.io/katachi.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add katachi

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install katachi

Future Features Under Consideration

  • More shapes (e.g. :$email, :$url, :$iso_8601)
  • More "matching modifiers" (e.g. all_of, one_of, none_of)
  • More output formats (e.g. to_json, to_hash, etc...)
  • Custom shape codes (e.g. :email_is_invalid)
  • Rails integration (e.g. validates_shape_of)
  • Shape-to-TypeScript conversion
  • Shape-to-Zod conversion
  • Shape-to-OpenAPI conversion
  • katachi-rspec-api for testing+documenting APIs in a way inspired by RSwag

Development and Contributing

See CONTRIBUTING.md for information on how to contribute to Katachi. Alternatively, you can check out the Contributing section on the documentation site.

License

The gem is available as open source under the terms of the MIT License.

About

A tool for describing and validating objects as intuitively as possible.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages

0