Skip to content

Data specification language in the vein of core.spec for JavaScript

Notifications You must be signed in to change notification settings

scotttrinh/tinydot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinydot

A library for specifying JavaScript data and functions inspired by Clojure's amazing core.spec.

Philosophy 💭

  • Needs to play well with existing tooling
    • Toolkits (lodash, underscore, ramda, mori, etc)
      • A lot of these toolkits have gobs of useful predicates
    • Testing frameworks (mocha, jasmine, etc)
      • We could throw exceptions so you could use existing test frameworks to run the specifications.
      • Should eventually allow for automatic generative test cases based on given predicates.

Roadmap

MVP/0.0.1 🐣

  • Predicate spec
    • conform (conform)
      • If valid, returns destructured data conforming to the spec/predicate
      • If invalid, returns ... something falsy?
    • valid (isValid)
      • Simple predicate function that returns true/false
      • Should check for membership if "predicate" passed is an array
      • Should check for key-set membership if "predicate" passed is an object

1.0.0 🐥

  • Documentation
  • Specs for tinydot 🐶
  • Registry (def)
    • Maps key names to specs
  • Entity maps (keys)
    • Ability to define keyset membership specs
      • Required and optional keys
    • Should check that values conform to all registered specs
  • Function spec (fdef)
    • Args predicate
    • Return value predicate
    • Relationship of arguments to return value
  • Explain (explain)
    • If value does not conform to supplied spec, return JSON explanation
  • Test tooling integration
    • Have examples of running this from a test runnner like Mocha

Stretch 🐔

  • Feature parity with core.spec

Contributing 💞

Actively looking for contributors! Plenty to talk about as we get this thing off the ground and there should be some nice low-hanging fruit once we have some planning and tooling set up.

LICENSE 🍴

This project is MIT-licensed and is free to use and fork. While based on Clojure's EPL-licensed core.spec, it does not actually re-use any of the code from that project.

About

Data specification language in the vein of core.spec for JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published