-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
Conversation
assert/is-complex-string
please review @Planeshifter |
There was a problem hiding this 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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> 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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests whether input string is a complex number representation`. | |
Tests whether input string is a complex number representation. |
|
||
## Usage | ||
|
||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```js | |
```javascript |
|
||
Tests whether input string is a complex number representation`. | ||
|
||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```js | |
```javascript |
|
||
<!-- eslint no-undef: "error" --> | ||
|
||
```js |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* var isCmplx = isComplexString( str ); | |
* var v = isComplexString( str ); |
'0+1i', | ||
'-0.0 + 2.0i', | ||
'-Infinity + 5i', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'-Infinity + 5i', | ||
|
||
'Infinity-Infinityi' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert/is-complex-string
assert/is-complex-string
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
This pull request:
@stdlib/assert/is-complex-string
#1370Checklist
@stdlib-js/reviewers