An invalid creationDate fails with a bare RangeError

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
angular, typescript

Research direction

Start with the validation in engine/index.ts around line 218, then read rendering-api.md to follow how the existing language and pageMode errors are documented. The issue reports failing tests for invalid dates; use those cases to check the behavior. Done means an invalid creationDate throws ngpdf: invalid creationDate and the error is listed in the docs.

Written by the indexing model from the issue text.

Description

bug

[creationDate]="new Date(row.generatedAt)" with a missing or bad value rejects with Invalid time value, with no ngpdf: prefix and no hint of what caused it.

engine/index.ts:218 accepts an Invalid Date, because it only tests date instanceof Date.

@ngpdf/core 1.0.1. Each case was reproduced with a failing test.

Expected

An ngpdf: error naming creationDate. rendering-api.md: "Errors from ngpdf start with ngpdf:". language and pageMode are already checked.

Done when

  • An Invalid Date throws ngpdf: invalid creationDate.
  • It is listed with the other errors in rendering-api.md.
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
8h 9m
Merged PRs (30d)
129

Getting set up

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.

More from ngpdf/ngpdf

All issues in ngpdf/ngpdf

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.