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

[RFC]: add supporting for testing whether a value is a constant-cased string #534

Closed
3 tasks done
kgryte opened this issue Oct 8, 2022 · 0 comments · Fixed by #540
Closed
3 tasks done

[RFC]: add supporting for testing whether a value is a constant-cased string #534

kgryte opened this issue Oct 8, 2022 · 0 comments · Fixed by #540
Labels
difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! RFC Request for comments. Feature requests and proposed changes.

Comments

@kgryte
Copy link
Member

kgryte commented Oct 8, 2022

Description

This RFC proposes to add support for testing whether a value is a constant-cased string.

var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var constantcase = require( '@stdlib/string/base/constantcase' );

function isConstantcase( value ) {
    return ( isString( value ) && constantcase( value ) === value );
}

Package: @stdlib/assert/is-constantcase
alias: isConstantcase

Related Issues

No.

Questions

No.

Other

Reference packages:

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Good First Issue A good first issue for new contributors! labels Oct 8, 2022
@kgryte kgryte changed the title [RFC]: add supporting for testing whether a value is a constant cased string [RFC]: add supporting for testing whether a value is a constant-cased string Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
1 participant