Skip to content

Properly type Lazy.js Sequence.chunk method#46699

Merged
elibarzilay merged 1 commit into
DefinitelyTyped:masterfrom
fan-tom:lazyjs_chunk_type
Aug 27, 2020
Merged

Properly type Lazy.js Sequence.chunk method#46699
elibarzilay merged 1 commit into
DefinitelyTyped:masterfrom
fan-tom:lazyjs_chunk_type

Conversation

@fan-tom

@fan-tom fan-tom commented Aug 12, 2020

Copy link
Copy Markdown
Contributor

Assigns proper type to Sequence.chunk and improves Sequence.flatten return type

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

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: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • Include tests for your changes
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

Improve `flatten` return type
@fan-tom fan-tom requested a review from Bartvds as a code owner August 12, 2020 15:20
@typescript-bot typescript-bot added the Author is Owner The author of this PR is a listed owner of the package. label Aug 12, 2020
@typescript-bot

typescript-bot commented Aug 12, 2020

Copy link
Copy Markdown
Contributor

@fan-tom 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.

Status

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

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

Inactive

This PR has been inactive for 14 days — waiting for a DT maintainer!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 46699,
  "author": "fan-tom",
  "owners": [
    "Bartvds",
    "miso440",
    "gablorquet",
    "fan-tom"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "ceaae4c",
  "headCommitOid": "ceaae4c0f6cf04d66104c2eb7b37762013d5585e",
  "mergeIsRequested": false,
  "stalenessInDays": 14,
  "lastPushDate": "2020-08-12T15:09:09.000Z",
  "lastCommentDate": "2020-08-12T15:23:48.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46699/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "newPackages": [],
  "packages": [
    "lazy.js"
  ],
  "files": [
    {
      "path": "types/lazy.js/index.d.ts",
      "kind": "definition",
      "package": "lazy.js"
    },
    {
      "path": "types/lazy.js/lazy.js-tests.ts",
      "kind": "test",
      "package": "lazy.js"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 0,
  "isChangesRequested": false
}

@typescript-bot

Copy link
Copy Markdown
Contributor

🔔 @Bartvds @miso440 @gablorquet — 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.

@danger-public

Copy link
Copy Markdown

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

lazy.js (unpkg)

was missing the following properties:

  1. VERSION
  2. noop
  3. identity
  4. equality
  5. createWrapper
as well as these 15 other properties...

Sequence, ArrayLikeSequence, ObjectLikeSequence, StringLikeSequence, StreamLikeSequence, GeneratedSequence, AsyncSequence, AsyncHandle, clone, deprecate, curry, curryRight, createCallback, createComparator, extensions

Generated by 🚫 dangerJS against ceaae4c

@typescript-bot

Copy link
Copy Markdown
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46699 diff
Batch compilation
Memory usage (MiB) 32.9 34.6 +5.0%
Type count 3509 3936 +12%
Assignability cache size 517 573 +11%
Language service
Samples taken 553 576 +4%
Identifiers in tests 553 576 +4%
getCompletionsAtPosition
    Mean duration (ms) 75.8 79.8 +5.3%
    Mean CV 14.7% 14.9%
    Worst duration (ms) 188.0 210.4 +11.9%
    Worst identifier fnMapCallback fnMapCallback
getQuickInfoAtPosition
    Mean duration (ms) 74.5 78.6 +5.6%
    Mean CV 14.7% 14.8% +1.1%
    Worst duration (ms) 194.6 229.6 +18.0%
    Worst identifier map map

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Aug 12, 2020
@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Aug 22, 2020
@elibarzilay

Copy link
Copy Markdown
Contributor

Merging it, but note that the issue you referred to was closed just a few days after this PR -- see this.

@elibarzilay elibarzilay merged commit 7e4cb54 into DefinitelyTyped:master Aug 27, 2020
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Sep 2, 2020
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Unmerged The author did not merge the PR when it was ready.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants