mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix urlString function for multiple arguments
This commit is contained in:
parent
8bdc6bb3ae
commit
c280f35d4f
@ -368,7 +368,7 @@ export class StackClientInterface {
|
||||
} else {
|
||||
const error = await res.text();
|
||||
|
||||
const errorObj = new StackAssertionError(`Failed to send request to ${url}: ${res.status} ${error}`, { request: params, res });
|
||||
const errorObj = new StackAssertionError(`Failed to send request to ${url}: ${res.status} ${error}`, { request: params, res, path });
|
||||
|
||||
if (res.status === 508 && error.includes("INFINITE_LOOP_DETECTED")) {
|
||||
// Some Vercel deployments seem to have an odd infinite loop bug. In that case, retry.
|
||||
|
||||
@ -76,7 +76,7 @@ export function trimLines(s: string): string {
|
||||
*
|
||||
* Useful for implementing your own template literal tags.
|
||||
*/
|
||||
export function templateIdentity(strings: TemplateStringsArray | readonly string[], ...values: any[]): string {
|
||||
export function templateIdentity(strings: TemplateStringsArray | readonly string[], ...values: string[]): string {
|
||||
return strings.reduce((result, str, i) => result + str + (values[i] ?? ''), '');
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ export function url(strings: TemplateStringsArray | readonly string[], ...values
|
||||
* Any values passed are encoded.
|
||||
*/
|
||||
export function urlString(strings: TemplateStringsArray | readonly string[], ...values: (string|number|boolean)[]): string {
|
||||
return templateIdentity(strings, values.map(encodeURIComponent));
|
||||
return templateIdentity(strings, ...values.map(encodeURIComponent));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user