Skip to content

Wrong exported ValidationError type #16

Description

@djkfx

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions