typify-parser is a JavaScript library designed to parse declarative type signature strings, primarily intended for use within the broader `typify` ecosystem for runtime type-checking. It takes human-readable type declarations, such as `(foo, bar 42) -> quux`, and transforms them into a structured JSON Abstract Syntax Tree (AST) representation. This AST details the type components, including function types, product types, identifiers, and literal values like numbers. Additionally, it provides utility methods like `freeVars` to extract unbound type variables from the parsed structure. The package is currently at version `1.1.0`, but it was last published in July 2015, indicating it is no longer actively maintained. Its parent project, `typify`, also appears to be dormant. Developers considering this package should be aware of its abandoned status and the potential compatibility issues with modern JavaScript environments and module systems. Its core differentiation was its ability to convert custom type signature strings into a machine-readable format for subsequent type validation by `typify`.
npm install typify-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to parse a type signature string into its Abstract Syntax Tree (AST) representation and how to extract free variables using the `freeVars` utility.
Consider alternative, actively maintained type parsing or validation libraries. If you must use it, be aware of potential compatibility issues with modern Node.js/browser environments and the lack of security patches.
For use in ESM projects, you may need to rely on Node.js's CJS-to-ESM interoperability layers or transpilation, which can add complexity and overhead.
Running this package in modern Node.js environments may lead to unexpected behavior or runtime errors due to API changes or deprecations in Node.js itself. Exercise caution and thorough testing if integration is attempted.
No dependency data recorded yet.