Skip to content

feat: add array/base/with #1374

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

Merged

Conversation

Pratik772846
Copy link
Contributor

@Pratik772846 Pratik772846 commented Feb 24, 2024

updates value at a particular index

Fixes #1328

Resolves # Issue 1328

Description

What is the purpose of this pull request?

This pull request:

  • a adds 'with' functionality into the array packages of stdlib

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #
  • fixes #

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

updates value at a particular index

Fixes stdlib-js#1328
@Planeshifter Planeshifter self-requested a review February 24, 2024 21:16
@kgryte kgryte added Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review. Utilities Issue or pull request concerning general utilities. labels Feb 24, 2024
@kgryte kgryte changed the title feat: added @stdlib/array/base/with feat: add array/base/with Feb 24, 2024
Copy link
Contributor

@stdlib-bot stdlib-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this; made a few changes and left a bunch of comments that will have to be addressed, but overall this is coming along well!

One important change we should make is throwing when the index is out of bounds to match the native Array.prototype.with method.

var bench = require( '@stdlib/bench' );
var rand = require( '@stdlib/random/base/randu' );
var pkg = require( '@stdlib/array/base/with/package.json' ).name;
var value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's declare this variable inside the benchmark function at L34, as we don't need it in the outer scope.

@Pratik772846
Copy link
Contributor Author

@Planeshifter @kgryte I have done the suggested changes.

Signed-off-by: Philipp Burckhardt <[email protected]>
@Planeshifter
Copy link
Member

@Pratik772846 Thanks for your contribution and good catch concerning with being a reserved keyword. Will merge once CI has passed.

@Planeshifter Planeshifter reopened this Feb 26, 2024
@Planeshifter Planeshifter merged commit 4253607 into stdlib-js:develop Feb 26, 2024
@Pratik772846 Pratik772846 deleted the package-stdlib/array/base/with branch March 5, 2024 08:50
@Planeshifter Planeshifter removed the Needs Review A pull request which needs code review. label Mar 26, 2024
@kgryte
Copy link
Member

kgryte commented Apr 6, 2024

@Pratik772846 Would you mind checking the box in the OP that you read the contributing guidelines? We need to ensure that box is checked for all external contributions. Thanks!

kgryte added a commit that referenced this pull request Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add @stdlib/array/base/with
4 participants