@@ -1200,33 +1200,34 @@ function factory( names, options ) { // eslint-disable-line max-lines-per-functi
1200
1200
}
1201
1201
1202
1202
/**
1203
- * Serializes a tuple as a locale-aware string.
1203
+ * Serializes a tuple as a locale-specific string.
1204
1204
*
1205
1205
* @private
1206
1206
* @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
1209
1209
* @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
1211
1213
*/
1212
1214
function toLocaleString ( locales , options ) {
1213
1215
var opts ;
1214
1216
var loc ;
1215
1217
var out ;
1216
1218
var val ;
1217
1219
var i ;
1220
+
1218
1221
if ( this !== tuple ) { // eslint-disable-line no-invalid-this
1219
1222
throw new TypeError ( 'invalid invocation. `this` is not host tuple.' ) ;
1220
1223
}
1221
-
1222
1224
if ( arguments . length === 0 ) {
1223
1225
loc = [ ] ;
1224
1226
} else if ( isString ( locales ) || isStringArray ( locales ) ) {
1225
1227
loc = locales ;
1226
1228
} else {
1227
1229
throw new TypeError ( format ( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.' , locales ) ) ;
1228
1230
}
1229
-
1230
1231
if ( arguments . length < 2 ) {
1231
1232
opts = { } ;
1232
1233
} else if ( isObject ( options ) ) {
@@ -1239,7 +1240,7 @@ function factory( names, options ) { // eslint-disable-line max-lines-per-functi
1239
1240
val = tuple [ indices [ i ] ] ;
1240
1241
out . push ( val . toLocaleString ( loc , opts ) ) ;
1241
1242
}
1242
- return out . join ( ',' ) ;
1243
+ return out . join ( ',' ) ;
1243
1244
}
1244
1245
1245
1246
/**
0 commit comments