@stdlib/assert-is-constantcase
v0.2.2
Published
Test if a value is a constant-case string.
Downloads
11
Keywords
Readme
isConstantcase
Test if a value is a constantcase string.
Installation
npm install @stdlib/assert-is-constantcase
Usage
var isConstantcase = require( '@stdlib/assert-is-constantcase' );
isConstantcase( value )
Tests if a value
is a constantcase string
.
var bool = isConstantcase( 'BEEP_BOOP' );
// returns true
bool = isConstantcase( 'BEEP and BOOP' );
// returns false
Notes
- The function validates that a
value
is astring
. For all other types, the function returnsfalse
.
Examples
var isConstantcase = require( '@stdlib/assert-is-constantcase' );
console.log( isConstantcase( 'BEEP_BOOP' ) );
// => true
console.log( isConstantcase( 'BEEP and BOOP' ) );
// => false
console.log( isConstantcase( 'BEEP_BOOP_BEEP' ) );
// => true
console.log( isConstantcase( 'b' ) );
// => false
console.log( isConstantcase( 'B' ) );
// => true
console.log( isConstantcase( '!' ) );
// => false
console.log( isConstantcase( 'beep boop' ) );
// => false
See Also
@stdlib/assert-is-constantcase-cli
: CLI package for use as a command-line utility.@stdlib/assert-is-string
: test if a value is a string.@stdlib/assert-is-camelcase
: test if a value is a camelcase string.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.