Skip to content

Commit cd41fa3

Browse files
fix(javascript): use proper null check instead of truthiness for required params (generated)
algolia/api-clients-automation#6498 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent b2006b2 commit cd41fa3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function validateRequired(field: string, method: string, value: unknown): void {
2-
if (value === null || value === undefined || (typeof value === 'string' && value.length === 0)) {
2+
if (value == null || (typeof value === 'string' && value.length === 0)) {
33
throw new Error(`Parameter \`${field}\` is required when calling \`${method}\`.`);
44
}
55
}

0 commit comments

Comments
 (0)