Skip to content

Commit 23b2e2b

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <[email protected]>
1 parent 5eb4b37 commit 23b2e2b

File tree

1 file changed

+8
-7
lines changed
  • lib/node_modules/@stdlib/dstructs/named-typed-tuple/lib

1 file changed

+8
-7
lines changed

lib/node_modules/@stdlib/dstructs/named-typed-tuple/lib/main.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,33 +1200,34 @@ function factory( names, options ) { // eslint-disable-line max-lines-per-functi
12001200
}
12011201

12021202
/**
1203-
* Serializes a tuple as a locale-aware string.
1203+
* Serializes a tuple as a locale-specific string.
12041204
*
12051205
* @private
12061206
* @memberof tuple
1207-
* @param {(string|string[])} [locales] - locale(s)
1208-
* @param {Object} [options] - formatting options
1207+
* @param {(string|Array<string>)} [locales] - locale identifier(s)
1208+
* @param {Object} [options] - configuration options
12091209
* @throws {TypeError} `this` must be the host tuple
1210-
* @returns {string} tuple locale string representation
1210+
* @throws {TypeError} first argument must be a string or an array of strings
1211+
* @throws {TypeError} options argument must be an object
1212+
* @returns {string} string representation
12111213
*/
12121214
function toLocaleString( locales, options ) {
12131215
var opts;
12141216
var loc;
12151217
var out;
12161218
var val;
12171219
var i;
1220+
12181221
if ( this !== tuple ) { // eslint-disable-line no-invalid-this
12191222
throw new TypeError( 'invalid invocation. `this` is not host tuple.' );
12201223
}
1221-
12221224
if ( arguments.length === 0 ) {
12231225
loc = [];
12241226
} else if ( isString( locales ) || isStringArray( locales ) ) {
12251227
loc = locales;
12261228
} else {
12271229
throw new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );
12281230
}
1229-
12301231
if ( arguments.length < 2 ) {
12311232
opts = {};
12321233
} else if ( isObject( options ) ) {
@@ -1239,7 +1240,7 @@ function factory( names, options ) { // eslint-disable-line max-lines-per-functi
12391240
val = tuple[ indices[ i ] ];
12401241
out.push( val.toLocaleString( loc, opts ) );
12411242
}
1242-
return out.join(',');
1243+
return out.join( ',' );
12431244
}
12441245

12451246
/**

0 commit comments

Comments
 (0)