Skip to content

feat: add array/base/with#1374

Merged
Planeshifter merged 8 commits into
stdlib-js:developfrom
Pratik772846:package-stdlib/array/base/with
Feb 26, 2024
Merged

feat: add array/base/with#1374
Planeshifter merged 8 commits into
stdlib-js:developfrom
Pratik772846:package-stdlib/array/base/with

Conversation

@Pratik772846
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/docs/types/test.ts Outdated
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
Copy Markdown
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.

Comment thread lib/node_modules/@stdlib/array/base/with/examples/index.js Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/examples/index.js Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/examples/index.js Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/examples/index.js Outdated
@Pratik772846
Copy link
Copy Markdown
Contributor Author

@Planeshifter @kgryte I have done the suggested changes.

Comment thread lib/node_modules/@stdlib/array/base/with/package.json Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/lib/index.js Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/docs/repl.txt Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/lib/main.js Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/docs/types/index.d.ts
Comment thread lib/node_modules/@stdlib/array/base/with/docs/types/index.d.ts Outdated
Comment thread lib/node_modules/@stdlib/array/base/with/docs/types/index.d.ts
Comment thread lib/node_modules/@stdlib/array/base/with/README.md Outdated
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Copy link
Copy Markdown
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
Copy Markdown
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