Refuse a non-finite number where a text field coerces one
Mirror / push (push) Successful in 4s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 36s
Test / test (20) (pull_request) Successful in 30s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 29s
Test / test (26) (pull_request) Successful in 30s
Mirror / push (push) Successful in 4s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 36s
Test / test (20) (pull_request) Successful in 30s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 29s
Test / test (26) (pull_request) Successful in 30s
This commit is contained in:
@@ -99,6 +99,10 @@ function wantText(value: ParamValue): Result<{ text: string }> {
|
||||
return { err: new Error(`Expected a string or a number, got ${typeof value}`) };
|
||||
}
|
||||
|
||||
if (typeof value === 'number' && !Number.isFinite(value)) {
|
||||
return { err: new Error(`Expected a finite number, got ${String(value)}`) };
|
||||
}
|
||||
|
||||
const text = String(value);
|
||||
|
||||
return pastLatin1(text) ?? { text };
|
||||
|
||||
Reference in New Issue
Block a user