indicative-parser is a foundational utility within the Indicative validation ecosystem, primarily responsible for optimizing schema processing. It achieves this by pre-compiling Indicative's concise validation schemas into an efficient, recursive tree structure. This tree, composed of `object`, `array`, and `literal` nodes, significantly boosts validation performance by providing a pre-parsed, executable representation of the rules, thus avoiding redundant parsing during runtime. The current stable version is 8.0.0. The project maintains an active development pace with incremental updates and major version changes for significant architectural shifts, such as the recent migration of the 'typed schema' feature in v8.0.0 to the main `indicative` repository. Its key differentiator is providing a high-performance parsing layer for Indicative's declarative rule definitions.
npm install indicative-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to parse a validation schema string into Indicative's optimized tree structure using `rulesParser`. It logs the resulting tree and shows how to access specific parsed rules, including error handling for invalid schemas.
Migrate any usage of `typedSchema` to the `@indicative/validator` package. Ensure you are importing `typedSchema` from the correct new location.
Review code that interacts with the `props` of typed schemas from versions before 7.1.4. If you relied on `props` being immutable, you may need to implement defensive copying or adjust logic for mutable data.
Be aware that rule names will be transformed. If you have custom rules or logic that relies on exact `snake_case` rule names after parsing, you will need to adjust your code to expect `camelCase`.
Understand that `literal` in this context refers to the structural role within the parsed schema tree, not the data type of the value being validated. Avoid conflating parser node types with JavaScript data types.
For ES Module environments, use `import { rulesParser } from 'indicative-parser';`. If you are in a CommonJS environment and face this, ensure your project's `package.json` correctly defines `type: 'commonjs'` or that your bundler is configured to handle ESM imports correctly.The `typedSchema` functionality was moved. You must now import it from the main `@indicative/validator` package: `import { typedSchema } from '@indicative/validator';`.Check the spelling of your rule names against the official Indicative documentation. If it's a custom rule, ensure it's properly defined and registered with your Indicative validator instance (though `indicative-parser` itself doesn't register rules, it expects them to be known to the validator that will consume its output).
No dependency data recorded yet.