Skip to content

Commit aad0f60

Browse files
committed
chore: format
1 parent c5e7bc4 commit aad0f60

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Serializer/EnumConverter.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ JsonSerializerOptions options
9191
switch (type)
9292
{
9393
case JsonTokenType.String:
94+
{
95+
var stringValue = reader.GetString();
96+
if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue))
9497
{
95-
var stringValue = reader.GetString();
96-
if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue))
97-
{
98-
return enumValue;
99-
}
100-
101-
break;
102-
}
103-
case JsonTokenType.Number:
104-
{
105-
var numValue = reader.GetInt32();
106-
_numberToEnum.TryGetValue(numValue, out var enumValue);
10798
return enumValue;
10899
}
100+
101+
break;
102+
}
103+
case JsonTokenType.Number:
104+
{
105+
var numValue = reader.GetInt32();
106+
_numberToEnum.TryGetValue(numValue, out var enumValue);
107+
return enumValue;
108+
}
109109
}
110110

111111
return default;

clients/algoliasearch-client-csharp/algoliasearch/Utils/QueryStringHelper.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ public static string ParameterToString(object obj)
3636
case bool boolean:
3737
return boolean ? "true" : "false";
3838
case ICollection collection:
39-
{
40-
var entries = new List<string>();
41-
foreach (var entry in collection)
42-
entries.Add(ParameterToString(entry));
43-
return string.Join(",", entries);
44-
}
39+
{
40+
var entries = new List<string>();
41+
foreach (var entry in collection)
42+
entries.Add(ParameterToString(entry));
43+
return string.Join(",", entries);
44+
}
4545
case Enum when HasEnumMemberAttrValue(obj):
4646
return GetEnumMemberAttrValue(obj);
4747
case AbstractSchema schema when obj.GetType().IsClass:
48-
{
49-
return ParameterToString(schema.ActualInstance);
50-
}
48+
{
49+
return ParameterToString(schema.ActualInstance);
50+
}
5151
default:
5252
return Convert.ToString(obj, CultureInfo.InvariantCulture);
5353
}

templates/javascript/clients/client/api/ingestionHelpers.mustache

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
1313
*/
1414
async chunkedPush(
15-
{ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, referenceIndexName }: ChunkedPushOptions,
15+
{
16+
indexName,
17+
objects,
18+
action = 'addObject',
19+
waitForTasks,
20+
batchSize = 1000,
21+
referenceIndexName,
22+
}: ChunkedPushOptions,
1623
requestOptions?: RequestOptions,
1724
): Promise<Array<WatchResponse>> {
1825
let records: Array<PushTaskRecords> = [];
@@ -23,10 +30,7 @@ async chunkedPush(
2330
records.push(obj as PushTaskRecords);
2431
if (records.length === batchSize || i === objects.length - 1) {
2532
responses.push(
26-
await this.push(
27-
{ indexName, pushTaskPayload: { action, records }, referenceIndexName },
28-
requestOptions,
29-
),
33+
await this.push({ indexName, pushTaskPayload: { action, records }, referenceIndexName }, requestOptions),
3034
);
3135
records = [];
3236
}
@@ -51,7 +55,7 @@ async chunkedPush(
5155
}
5256

5357
throw error;
54-
})
58+
});
5559
},
5660
validate: (response) => response !== undefined,
5761
aggregator: () => (retryCount += 1),
@@ -65,6 +69,5 @@ async chunkedPush(
6569
}
6670
}
6771

68-
6972
return responses;
7073
},

templates/php/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
349349

350350
++$count;
351351

352-
if ($waitForTasks && (count($responses) % 50 === 0 || $count === sizeof($objects) - 1)) {
352+
if ($waitForTasks && (0 === count($responses) % 50 || $count === sizeof($objects) - 1)) {
353353
$timeoutCalculation = 'Algolia\AlgoliaSearch\Support\Helpers::linearTimeout';
354354
355355
foreach ($responses as $response) {

0 commit comments

Comments
 (0)