Skip to content

Commit 45f7fe7

Browse files
committed
Rename file and clean-up
1 parent d59cca2 commit 45f7fe7

9 files changed

Lines changed: 21 additions & 18 deletions

File tree

lib/node_modules/@stdlib/string/startcase/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var startcase = require( '@stdlib/string/startcase' );
3838

3939
#### startcase( str )
4040

41-
Capitalizes the first letter of each word in a `string`.
41+
Capitalizes the first letter of each word in a string.
4242

4343
```javascript
4444
var str = startcase( 'beep boop a foo bar' );

lib/node_modules/@stdlib/string/startcase/benchmark/benchmark.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
25-
var fromCodePoint = require( '@stdlib/string/from-code-point' );
2625
var pkg = require( './../package.json' ).name;
2726
var startcase = require( './../lib' );
2827

2928

3029
// MAIN //
3130

3231
bench( pkg, function benchmark( b ) {
33-
var str;
32+
var values;
3433
var out;
3534
var i;
3635

36+
values = [
37+
'beep boop',
38+
'foo bar',
39+
'xyz abc'
40+
];
41+
3742
b.tic();
3843
for ( i = 0; i < b.iterations; i++ ) {
39-
str = fromCodePoint( i%126 ) + 'eep boop foo bar tic toc';
40-
out = startcase( str );
41-
if ( !isString( out ) ) {
44+
out = startcase( values[ i%values.length ] );
45+
if ( typeof out !== 'string' ) {
4246
b.fail( 'should return a string' );
4347
}
4448
}

lib/node_modules/@stdlib/string/startcase/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{{alias}}( str )
3-
Capitalizes the first letter of each word in an input `string`.
3+
Capitalizes the first letter of each word in an input string.
44

55
Parameters
66
----------

lib/node_modules/@stdlib/string/startcase/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Capitalizes the first letter of each word in an input string.
2323
*
2424
* @param str - string to convert
25-
* @returns start case string
25+
* @returns start-cased string
2626
*
2727
* @example
2828
* var str = startcase( 'beep boop foo bar' );

lib/node_modules/@stdlib/string/startcase/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import startcase = require( './index' );
2626
startcase( 'Last man standing' ); // $ExpectType string
2727
}
2828

29-
// The function does not compile if provided a value other than a string...
29+
// The compiler throws an error if the function is provided a value other than a string...
3030
{
3131
startcase( true ); // $ExpectError
3232
startcase( false ); // $ExpectError
@@ -38,7 +38,7 @@ import startcase = require( './index' );
3838
startcase( ( x: number ): number => x ); // $ExpectError
3939
}
4040

41-
// The function does not compile if provided insufficient arguments...
41+
// The compiler throws an error if the function is provided insufficient arguments...
4242
{
4343
startcase(); // $ExpectError
4444
}

lib/node_modules/@stdlib/string/startcase/examples/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
var startcase = require( './../lib' );
2222

23-
var str;
24-
25-
str = startcase( 'beep boop foo bar' );
23+
var str = startcase( 'beep boop foo bar' );
2624
console.log( str );
2725
// => 'Beep Boop Foo Bar'
2826

lib/node_modules/@stdlib/string/startcase/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
// MODULES //
3434

35-
var startcase = require( './startcase.js' );
35+
var main = require( './main.js' );
3636

3737

3838
// EXPORTS //
3939

40-
module.exports = startcase;
40+
module.exports = main;

lib/node_modules/@stdlib/string/startcase/lib/startcase.js renamed to lib/node_modules/@stdlib/string/startcase/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
24-
var reWhitespace = require( '@stdlib/regexp/whitespace' );
24+
var reWhitespace = require( '@stdlib/regexp/whitespace' ).REGEXP;
2525
var format = require( '@stdlib/string/format' );
2626

2727

@@ -50,7 +50,7 @@ function startcase( str ) {
5050
out = '';
5151
for ( i = 0; i < str.length; i++ ) {
5252
ch = str.charAt( i );
53-
if ( reWhitespace.REGEXP.test( ch ) ) {
53+
if ( reWhitespace.test( ch ) ) {
5454
out += ch;
5555
cap = true;
5656
} else if ( cap ) {

lib/node_modules/@stdlib/string/startcase/test/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tape( 'main export is a function', function test( t ) {
3232
t.end();
3333
});
3434

35-
tape( 'the function throws an error if not provided a primitive string', function test( t ) {
35+
tape( 'the function throws an error if not provided a string', function test( t ) {
3636
var values;
3737
var i;
3838

@@ -42,6 +42,7 @@ tape( 'the function throws an error if not provided a primitive string', functio
4242
null,
4343
void 0,
4444
true,
45+
false,
4546
[],
4647
{},
4748
function noop() {}

0 commit comments

Comments
 (0)