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

[yauzl-promise] adjust types following v4 rewrite #69641

Merged
merged 9 commits into from
May 21, 2024

Conversation

LucVidal360
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/overlookmotel/yauzl-promise
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

Description

Starting v4.0.0, yauzl-promise was rewritten from scratch. Cf. overlookmotel/yauzl-promise@v3.0.0...v4.0.0

As such, several class properties were deleted/added/modified.

This PR is an attempt to fix the types to match the current implementation.

Exported properties

I tried to reflect only the officially documented properties, even though several more exist in the implementation.
However, I left undocumented properties if they were already exported in DefinitelyTyped, to avoid unnecessary breaking changes.

comment and filename: string or Buffer?

I've exported ZipFile.comment, Entry.comment and Entry.filename as string.
However, if the decodeStrings option is explicitly set to false, these 3 properties will effectively be Buffers.

  • I could have exported them as string | Buffer, but I suppose most of the library users use the default option, and expect strings.
  • I probably could have make ZipFile and Entry generic classes, depending on the type of decodeStrings, but it felt overkill here, adding complexity.
  • To alleviate this issue, I've added a jsdoc entry on the offending properties, to warn users of this fact.

@typescript-bot
Copy link
Contributor

typescript-bot commented May 18, 2024

@LucVidal360 Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

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 a DT maintainer

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69641,
  "author": "LucVidal360",
  "headCommitOid": "f5b4bb0bfb375f40e437107f33ea202c4b05d6e8",
  "mergeBaseOid": "425f0ebe145ac9337b0bcbd1084a548d729b4963",
  "lastPushDate": "2024-05-18T21:08:09.000Z",
  "lastActivityDate": "2024-05-18T21:08:09.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "yauzl-promise",
      "kind": "edit",
      "files": [
        {
          "path": "types/yauzl-promise/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/yauzl-promise/yauzl-promise-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 2119003780,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). No Other Owners This DT module only has one owner, so we can't have someone verify the change. labels May 18, 2024
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board May 18, 2024
@typescript-bot
Copy link
Contributor

🔔 @LucVidal360 — there are no owners, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board May 18, 2024
@weswigham weswigham merged commit 802ab1a into DefinitelyTyped:master May 21, 2024
4 checks passed
@typescript-bot typescript-bot removed this from Needs Maintainer Action in New Pull Request Status Board May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Other Owners This DT module only has one owner, so we can't have someone verify the change. Popular package This PR affects a popular package (as counted by NPM download counts).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants