Can I make `string.yaml` like `string.json`?
I haven't been able to figure out a way of extending it with my own
yaml
https://arktype.io/docs/scopes#submodules 🤔3 Replies
Extending a built-in submodule like this is a little trickier than creating a new top-level keyword or submodule that doesn't overlap an existing one.
Are you wanting
string.yaml
to appear in the global scope or just in a specific scope you create?I’ll take either. I have a custom $ scope that works great. I tried making a string sub module on that that attempted to …type.string.internal or something (I’m mobile, sorry for no code blocks!), but that broke all existing string.* types.
I went with yaml.string.parse and yaml.object.stringify, but it only loses the discoverability and similarity with string.json and object.json, for example.
Does this work for you?