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

feat: add assert/is-complex-string #1417

Closed
wants to merge 1 commit into from
Closed

feat: add assert/is-complex-string #1417

wants to merge 1 commit into from

Conversation

marsian83
Copy link
Contributor

Resolves #1370

Description

This PR adds the package @stdlib/assert/is-complex-string

The package implements assertion for a string represeting a complex number.

Alias: isComplexString

Related Issues

Does this pull request have any related issues?

This pull request:

Checklist

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


@stdlib-js/reviewers

@kgryte kgryte changed the title feat : add @stdlib/assert/is-complex-string feat : add assert/is-complex-string Feb 29, 2024
@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 29, 2024
@marsian83
Copy link
Contributor Author

please review @Planeshifter

Copy link
Member

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

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

Requested changes, once done this PR can be reviewed again


# isComplexString

> Tests whether input string is a complex number representation`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Tests whether input string is a complex number representation`.
> Tests whether input string is a complex number representation.


#### isComplexString( str )

Tests whether input string is a complex number representation`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Tests whether input string is a complex number representation`.
Tests whether input string is a complex number representation.


## Usage

```js
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```js
```javascript


Tests whether input string is a complex number representation`.

```js
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```js
```javascript


<!-- eslint no-undef: "error" -->

```js
Copy link
Member

Choose a reason for hiding this comment

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

same comment

// MODULES //

var isString = require( '@stdlib/assert/is-string' );
var parse = require( '@stdlib/complex/base/parse');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var parse = require( '@stdlib/complex/base/parse');
var parse = require( '@stdlib/complex/base/parse' );

* Test whether input string is a complex number representation.
*
* @param {string} str - input string
* @returns {boolean} a boolean indicated if the string is a valid complex number representation.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @returns {boolean} a boolean indicated if the string is a valid complex number representation.
* @returns {boolean} a boolean indicated if the string is a valid complex number representation

* @example
* var str = '4 + 6i';
*
* var isCmplx = isComplexString( str );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* var isCmplx = isComplexString( str );
* var v = isComplexString( str );

'0+1i',
'-0.0 + 2.0i',
'-Infinity + 5i',

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

'-Infinity + 5i',

'Infinity-Infinityi'

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@Pranavchiku Pranavchiku added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 1, 2024
@Planeshifter Planeshifter changed the title feat : add assert/is-complex-string feat: add assert/is-complex-string Mar 3, 2024
@marsian83 marsian83 closed this by deleting the head repository Mar 28, 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. Needs Changes Pull request which needs changes before being merged. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add @stdlib/assert/is-complex-string
3 participants