sanctuary-js / sanctuary

:see_no_evil: Refuge from unsafe JavaScript
https://sanctuary.js.org
MIT License
3.03k stars 94 forks source link

feat: Make types accessible by name in `S` #717

Open jceb opened 2 years ago

jceb commented 2 years ago

Currently, S.env provides the environment with all defined types, however there's no way of directly accessing the types by name. Functions like S.is need a reference to a type to work properly so the proposal is to make types accessible by name from S, e.g. via S.types.TYPE or via refactoring S.env into a map so S.env.TYPE can be used.

davidchambers commented 9 months ago

Turning S.env into an object or a map is a great idea!