NaturalIntelligence / NaturalIntelligence/fast-xml-validator
Wrong exported ValidationError type
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
ValidationError in fast-xml-validator/lib/fxv.d.cts is definded different than in sources:
In lib:
type ValidationError = {
err: {
code: string;
msg: string,
line: number,
col: number
};
};
In sources (src/ValidationError.js):
export default class ValidationError extends Error {
constructor(message, code, line, col) {
super(message);
this.name = this.constructor.name;
this.code = code;
this.line = line;
this.col = col;
Error.captureStackTrace?.(this, this.constructor);
}
}
I can't properly use the class in typescript
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the exported declaration in fast-xml-validator/lib/fxv.d.cts with the implementation in src/ValidationError.js. Update the public type so it accurately represents the exported ValidationError class and its fields, allowing TypeScript users to use the class correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100