@legalplace/model-lightweight
v1.1.6
Published
Transforms a ModelV3 into a lightweight variant for wizard-only loading
Maintainers
Keywords
Readme
@legalplace/model-lightweight
Transforms a full ModelV3 into a smaller copy suitable for loading only the questionnaire in wizardx (no ancillary documents, no hidden output options, no meta.output on remaining options).
Install
yarn add @legalplace/model-lightweightUsage
import type { ModelV3 } from "@legalplace/models-v3-types";
import { ReferencesParser } from "@legalplace/referencesparser";
import { toLightweight } from "@legalplace/model-lightweight";
const fullModel: ModelV3 = /* ... */;
const lightModel = toLightweight(fullModel);
const references = new ReferencesParser(lightModel).getReferences();variables on the model are left unchanged. Build and upload references.json from the lightweight model in your own pipeline if needed.
Scripts
| Script | Description |
| ------------ | ------------------------------------ |
| yarn build | Compile src/ to dist/ |
| yarn test | Run Jest |
| yarn test:ci | CI Jest (JUnit reporter) |
| yarn lint | Typecheck + ESLint |
License
MIT
