Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

ComponentDefinition validators are key-specific #1

Closed
sayhisam1 opened this issue Nov 10, 2021 · 0 comments
Closed

ComponentDefinition validators are key-specific #1

sayhisam1 opened this issue Nov 10, 2021 · 0 comments

Comments

@sayhisam1
Copy link
Owner

sayhisam1 commented Nov 10, 2021

Currently, the validators property of ComponentDefinitions is a map from key to function. This means that arbitrary keys cannot be validated.

Proposed changes:

  • rename validators -> validator
  • validator is now a function that takes in the entire data dict, and returns a bool (similar to t library)

This change also has the neat side-effect of supporting t directly, since users can now pass their t typecheck directly to validator.

I'm not entirely sure what to name the argument - we may want to add support for validating the entity that a component is attached to.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant