From 7205005acaa18c63f126946b6ff0b4646e6598bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20R=C3=A8gne?= Date: Thu, 14 May 2026 16:22:24 +0200 Subject: [PATCH 1/2] docs: Fix typo `Typeson.Promise` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16c4a4d..af96331 100644 --- a/README.md +++ b/README.md @@ -605,7 +605,7 @@ reconstructed). #### `TypesonPromise` class If you have a type which you wish to have resolved asynchronously, you -can can return a `Typeson.Promise` (which works otherwise like a `Promise`) +can can return a `TypesonPromise` (which works otherwise like a `Promise`) and call its first supplied argument (`resolve`) when ready. The reason we expect this class to be used here instead of regular `Promise`s @@ -626,7 +626,7 @@ const typeson = new Typeson({sync: false}).register({ return x instanceof MyAsync; }, function (o) { - return new Typeson.Promise(function (resolve, reject) { + return new TypesonPromise(function (resolve, reject) { setTimeout(function () { // Do something more useful in real code if (Date.now() % 2) { From 609bf55c9178be32d2f2d84dfab8dfcea01eb162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20R=C3=A8gne?= Date: Thu, 14 May 2026 17:08:49 +0200 Subject: [PATCH 2/2] Fixup Typeson-Promise --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af96331..9ba5ab2 100644 --- a/README.md +++ b/README.md @@ -426,7 +426,7 @@ As with `encapsulate` but automatically throws upon obtaining a `TypesonPromise` #### `encapsulateAsync` (obj, [opts]) -As with `encapsulate` but automatically throws upon obtaining a non-`TypesonPromise` return result from the replacer (as only a `Typeson-Promise` is expected for asynchronous types). +As with `encapsulate` but automatically throws upon obtaining a non-`TypesonPromise` return result from the replacer (as only a `TypesonPromise` is expected for asynchronous types). ##### Sample