Skip to content

Commit 0901c7f

Browse files
authored
Apply suggestions from code review
1 parent 6dee165 commit 0901c7f

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

lib/node_modules/@stdlib/string/base/reverse-code-points/lib/main.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ function reverse( str ) {
7676
// We found a surrogate pair:
7777
out = ch1 + ch2 + out;
7878
i += 1; // bump the index to process the next code unit
79-
}
80-
else {
79+
} else {
8180
out = ch1 + out;
8281
}
83-
}
84-
else {
82+
} else {
8583
out = ch1 + out;
8684
}
8785
}

lib/node_modules/@stdlib/string/base/reverse-code-points/test/test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tape( 'the function returns an empty string if provided an empty string', functi
3737
t.end();
3838
});
3939

40-
tape( 'the function reverses the Unicode code point of a provided string (ascii)', function test( t ) {
40+
tape( 'the function reverses the Unicode code points of a provided string (ascii)', function test( t ) {
4141
var out;
4242

4343
out = reverse( 'hello world' );
@@ -52,7 +52,7 @@ tape( 'the function reverses the Unicode code point of a provided string (ascii)
5252
t.end();
5353
});
5454

55-
tape( 'the function reverses the Unicode code point of a provided string (Unicode)', function test( t ) {
55+
tape( 'the function reverses the Unicode code points of a provided string (Unicode)', function test( t ) {
5656
var out;
5757

5858
out = reverse( 'अनुच्छेद' );
@@ -64,7 +64,7 @@ tape( 'the function reverses the Unicode code point of a provided string (Unicod
6464
t.end();
6565
});
6666

67-
tape( 'the function reverses the Unicode code point of a provided string (surrogate pair)', function test( t ) {
67+
tape( 'the function reverses the Unicode code points of a provided string (surrogate pair)', function test( t ) {
6868
var out;
6969

7070
out = reverse( 'foo\uD834\uDF06bar' );

lib/node_modules/@stdlib/string/base/reverse-grapheme-clusters/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@stdlib/string/base/first-grapheme-clusters",
2+
"name": "@stdlib/string/base/reverse-grapheme-clusters",
33
"version": "0.0.0",
4-
"description": "Reverse the grapheme cluster (i.e., user-perceived character) of a string.",
4+
"description": "Reverse the grapheme clusters (i.e., user-perceived characters) of a string.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

lib/node_modules/@stdlib/string/base/reverse/lib/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function reverse( str ) {
4747
var i;
4848

4949
out = '';
50-
for ( i = str.length - 1; i >= 0; i--) {
51-
out += str[i];
50+
for ( i = str.length - 1; i >= 0; i-- ) {
51+
out += str[ i ];
5252
}
5353
return out;
5454
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ out = reverseString( 'Lorem ipsum 𝌆 dolor sit ameͨ͆t.' );
4747

4848
The function supports the following options:
4949

50-
- **mode**: type of characters to return. Must be one of the following:
50+
- **mode**: type of characters to reverse. Must be one of the following:
5151

5252
- `'grapheme'`: grapheme clusters. Appropriate for strings containing visual characters which can span multiple Unicode code points (e.g., emoji).
5353
- `'code_point'`: Unicode code points. Appropriate for strings containing visual characters which are comprised of more than one Unicode code unit (e.g., ideographic symbols and punctuation and mathematical alphanumerics).

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{{alias}}( str[, options] )
3-
Reverses a `string`.
3+
Reverses a string.
44

55
Parameters
66
----------
@@ -11,7 +11,7 @@
1111
Options.
1212

1313
options.mode: string (optional)
14-
Type of characters to return. The following modes are supported:
14+
Type of characters to reverse. The following modes are supported:
1515

1616
- grapheme: grapheme clusters. Appropriate for strings containing visual
1717
characters which can span multiple Unicode code points (e.g., emoji).

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
*/
2626
interface Options {
2727
/**
28-
* Specifies the type of characters to return (default: 'grapheme').
28+
* Specifies the type of characters to reverse (default: 'grapheme').
2929
*
3030
* ## Notes
3131
*
32-
* - The following option values are supported:
32+
* - The following modes are supported:
3333
*
3434
* - `'grapheme'`: grapheme clusters. Appropriate for strings containing visual characters which can span multiple Unicode code points (e.g., emoji).
3535
* - `'code_point'`: Unicode code points. Appropriate for strings containing visual characters which are comprised of more than one Unicode code unit (e.g., ideographic symbols and punctuation and mathematical alphanumerics).

lib/node_modules/@stdlib/string/reverse/docs/usage.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Options:
66
-h, --help Print this message.
77
-V, --version Print the package version.
88
--split sep Delimiter for stdin data. Default: '/\\r?\\n/'.
9-
--mode mode Type of character to return. Default: 'grapheme'.
9+
--mode mode Type of character to reverse. Default: 'grapheme'.

lib/node_modules/@stdlib/string/reverse/test/test.cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ tape( 'the command-line interface reverses a string argument', opts, function te
162162
}
163163
});
164164

165-
tape( 'the command-line interface supports specifying the type of characters to return', opts, function test( t ) {
165+
tape( 'the command-line interface supports specifying the type of characters to reverse', opts, function test( t ) {
166166
var cmd = [
167167
EXEC_PATH,
168168
'-e',

0 commit comments

Comments
 (0)