time-to-botec/js/node_modules/@stdlib/assert/is-capitalized/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

2.3 KiB

isCapitalized

Test if a value is a string having an uppercase first character.

Usage

var isCapitalized = require( '@stdlib/assert/is-capitalized' );

isCapitalized( value )

Tests if a value is a string having an uppercase first character.

var bool = isCapitalized( 'Every noble work is at first impossible.' );
// returns true

bool = isCapitalized( 'HELLO WORLD!' );
// returns true

bool = isCapitalized( 'salt and light' );
// returns false

Notes

  • The function validates that a value is a string. For all other types, the function returns false.

Examples

var isCapitalized = require( '@stdlib/assert/is-capitalized' );

var bool = isCapitalized( 'Hello' );
// returns true

bool = isCapitalized( 'HELLO' );
// returns true

bool = isCapitalized( '' );
// returns false

bool = isCapitalized( 'hello' );
// returns false

CLI

Usage

Usage: is-capitalized [options] [<string>]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ is-capitalized Beep
true

To use as a standard stream,

$ echo -n 'boop' | is-capitalized
false