NaturalIntelligence / NaturalIntelligence/fast-xml-validator

Wrong exported ValidationError type

Open Beginner friendly
#16 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.