Skip to content

Commit 057f54a

Browse files
committed
Fix description and clean-up
1 parent 5276e4a commit 057f54a

File tree

8 files changed

+20
-14
lines changed

8 files changed

+20
-14
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# constantcase
2222

23-
> Returns a string converted to a constant case.
23+
> Convert a string to constant case.
2424
2525
<!-- Package usage documentation. -->
2626

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

+9-5
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 constantcase = 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';
40-
out = constantcase( str );
41-
if ( !isString( out ) ) {
44+
out = constantcase( values[ i%values.length ] );
45+
if ( typeof out !== 'string' ) {
4246
b.fail( 'should return a string' );
4347
}
4448
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Converts a string to constant case.
2323
*
2424
* @param str - string to convert
25-
* @returns a constant-cased string
25+
* @returns constant-cased string
2626
*
2727
* @example
2828
* var str = constantcase( 'beep' );

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import constantcase = require( './index' );
2626
constantcase( 'Hello World!' ); // $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
constantcase( true ); // $ExpectError
3232
constantcase( false ); // $ExpectError
@@ -38,7 +38,7 @@ import constantcase = require( './index' );
3838
constantcase( ( 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
constantcase(); // $ExpectError
4444
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939

4040
// MODULES //
4141

42-
var constantcase = require( './main.js' );
42+
var main = require( './main.js' );
4343

4444

4545
// EXPORTS //
4646

47-
module.exports = constantcase;
47+
module.exports = main;

lib/node_modules/@stdlib/string/constantcase/lib/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
// MODULES //
2222

2323
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
24-
var uppercase = require( '@stdlib/string/uppercase' );
25-
var replace = require( '@stdlib/string/replace' );
24+
var uppercase = require( '@stdlib/string/base/uppercase' );
25+
var replace = require( '@stdlib/string/base/replace' );
2626
var format = require( '@stdlib/string/format' );
27-
var trim = require( '@stdlib/string/trim' );
27+
var trim = require( '@stdlib/string/base/trim' );
2828

2929

3030
// VARIABLES //

lib/node_modules/@stdlib/string/constantcase/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"string",
6262
"str",
6363
"case",
64+
"constant",
6465
"convert"
6566
],
6667
"__stdlib__": {}

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

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ tape( 'the function throws an error if not provided a string', function test( t
4040
5,
4141
NaN,
4242
true,
43+
false,
4344
null,
4445
void 0,
4546
[],

0 commit comments

Comments
 (0)