[njs] Types: fixed NgxKeyValuePair definition.

noreply at nginx.com noreply at nginx.com
Wed Aug 14 22:20:02 UTC 2024


details:   https://github.com/nginx/njs/commit/4630230c3d53a28c777d9c5d07efbb1a4ebc3446
branches:  master
commit:    4630230c3d53a28c777d9c5d07efbb1a4ebc3446
user:      Thomas P. <TPXP at users.noreply.github.com>
date:      Tue, 30 Jul 2024 14:20:19 +0200
description:
Types: fixed NgxKeyValuePair definition.

NgxSharedDict.items() returns an array of `[key, value]` pairs, as `Object.entries()`.

---
 ts/ngx_core.d.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts/ngx_core.d.ts b/ts/ngx_core.d.ts
index af8fc4f3..b459c929 100644
--- a/ts/ngx_core.d.ts
+++ b/ts/ngx_core.d.ts
@@ -250,7 +250,7 @@ interface NgxFetchOptions {
 declare class SharedMemoryError extends Error {}
 
 type NgxSharedDictValue = string | number;
-type NgxKeyValuePair<V> = { key: string, value: V };
+type NgxKeyValuePair<V> = [string, V];
 
 /**
  * Interface of a dictionary shared among the working processes.


More information about the nginx-devel mailing list