I think the next thing holding back this lib is the lack of automatic typescript support.
One way to manage this would be to change the way TypeScript support is provided and to create a compiler/watcher for auto compiling types to node_modules.
This would allow PDSL to be strongly typed by simply adding a unique typescript key identifier.
Behind the scenes types would be compiled to somewhere in node modules:
// node_modules/pdsl/___types.ts
export type PDSLTypes = {
isUser: { name: string, age: number }
}
The type signature of the returned function would look something like this:
type PredicateFn = <T>(input:any) => input is PDSLTypes[T]
Not sure if it is possible to maintain backward compatibility need to look up if conditionals are possible in TypeScript - I have a feeling they might be....
I think the next thing holding back this lib is the lack of automatic typescript support.
One way to manage this would be to change the way TypeScript support is provided and to create a compiler/watcher for auto compiling types to node_modules.
This would allow PDSL to be strongly typed by simply adding a unique typescript key identifier.
Behind the scenes types would be compiled to somewhere in node modules:
The type signature of the returned function would look something like this:
Not sure if it is possible to maintain backward compatibility need to look up if conditionals are possible in TypeScript - I have a feeling they might be....