Dmitry Volyntsev
February 10, 2023 12:08AM
details: https://hg.nginx.org/njs/rev/12a6d0517ae8
branches:
changeset: 2045:12a6d0517ae8
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Feb 09 18:34:51 2023 -0800
description:
Types: fixed Fetch API types.

diffstat:

test/ts/test.ts | 3 +++
ts/ngx_core.d.ts | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 4da29a050b6e -r 12a6d0517ae8 test/ts/test.ts
--- a/test/ts/test.ts Thu Feb 09 18:34:46 2023 -0800
+++ b/test/ts/test.ts Thu Feb 09 18:34:51 2023 -0800
@@ -91,6 +91,9 @@ async function http_module(r: NginxHTTPR
throw 'oops'
};

+ let out: Array<string> = reply.headers.getAll("foo");
+ let has: boolean = reply.headers.has("foo");
+
return reply.text()
})
.then(body => r.return(200, body))
diff -r 4da29a050b6e -r 12a6d0517ae8 ts/ngx_core.d.ts
--- a/ts/ngx_core.d.ts Thu Feb 09 18:34:46 2023 -0800
+++ b/ts/ngx_core.d.ts Thu Feb 09 18:34:51 2023 -0800
@@ -10,13 +10,13 @@ interface NgxResponseHeaders {
* with the specified name.
* @param name A name of the header.
*/
- getAll(name:NjsStringLike): NjsByteString;
+ getAll(name:NjsStringLike): Array<NjsByteString>;
/**
* Returns a boolean value indicating whether a header with
* the specified name exists.
* @param name A name of the header.
*/
- has(name:NjsStringLike): NjsByteString;
+ has(name:NjsStringLike): boolean;
}

interface NgxResponse {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Types: fixed Fetch API types.

Dmitry Volyntsev 412 February 10, 2023 12:08AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 194
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready