Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsrsasign] add missing null type in X509CRL.getRevCertArray() #69462

Merged
merged 2 commits into from May 3, 2024

Conversation

bindon
Copy link
Contributor

@bindon bindon commented Apr 29, 2024

The null type is missing in getRevCertArray() within the X509CRL.d.ts file.

/**
 * get array for revokedCertificates field<br/>
 * name getRevCertArray
 * memberOf X509CRL#
 *
 * @return Array array of revokedCertificate parameter or null
 * @see X509CRL#getRevCert
 *
 * @description
 * This method returns parsed revokedCertificates field value as
 * array of revokedCertificate parameter.
 * If the field doesn't exists, it returns null.
 *
 * @example
 * crl = new X509CRL("-----BEGIN X509 CRL...");
 * crl.getRevCertArray() &rarr;
 * [{sn:"123a", date:"208025235959Z", ext: [{extname:"cRLReason",code:3}]},
 *  {sn:"123b", date:"208026235959Z", ext: [{extname:"cRLReason",code:0}]}]
 */
getRevCertArray(): RevokedCertificate[]; // this! + "| null"

The null type is also missing as described in the comments below.

  • @ return Array array of revokedCertificate parameter or null
  • If the field doesn't exists, it returns null.

The part implemented in JavaScript is as follows:

this.getRevCertArray = function() {
  if (this.posRevCert == null) return null; // this line!
    var a = [];
    var idx = _getIdxbyList(this.hex, 0, [0, this.posRevCert]);
    var aIdx = _getChildIdx(this.hex, idx);
    for (var i = 0; i < aIdx.length; i++) {
    var hRevCert = _getTLV(this.hex, aIdx[i]);
    a.push(this.getRevCert(hRevCert));
  }
  return a;
};

@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 29, 2024

@bindon Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69462,
  "author": "bindon",
  "headCommitOid": "0d9ff3e650f03b8f6ea9da2e22c357cb70e46eb3",
  "mergeBaseOid": "d693ab3ced5aa2b8d86838f721006b16414bb21e",
  "lastPushDate": "2024-04-29T04:45:59.000Z",
  "lastActivityDate": "2024-05-03T04:27:01.000Z",
  "mergeOfferDate": "2024-05-02T19:20:36.000Z",
  "mergeRequestDate": "2024-05-03T04:27:01.000Z",
  "mergeRequestUser": "bindon",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "jsrsasign",
      "kind": "edit",
      "files": [
        {
          "path": "types/jsrsasign/jsrsasign-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/jsrsasign/modules/X509CRL.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "ffflorian"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "ffflorian",
      "date": "2024-05-02T19:19:56.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 2081882417,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Apr 29, 2024
@typescript-bot
Copy link
Contributor

🔔 @ffflorian — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Apr 29, 2024
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels May 2, 2024
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board May 2, 2024
@typescript-bot
Copy link
Contributor

@bindon: Everything looks good here. I am ready to merge this PR (at 0d9ff3e) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@ffflorian: you can do this too.)

@bindon
Copy link
Contributor Author

bindon commented May 3, 2024

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board May 3, 2024
@typescript-bot typescript-bot merged commit 7193e57 into DefinitelyTyped:master May 3, 2024
4 checks passed
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants