Skip to content

Commit 8ef0e47

Browse files
committed
RESP docs
1 parent fcb3a01 commit 8ef0e47

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/RESP3.md renamed to docs/RESP.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# RESP3 => JS Type Mappings:
1+
# RESP2 -> JS
2+
3+
- Integer (`:`) => `number`
4+
- Simple String (`+`) => `string | Buffer`
5+
- Blob String (`$`) => `string | Buffer`
6+
- Simple Error (`-`) => `ErrorReply`
7+
- Array (`*`) => `Array`
8+
9+
# RESP3 -> JS
210

311
- Null (`_`) => `null`
412
- Boolean (`#`) => `boolean`
@@ -19,7 +27,7 @@
1927
2028
## Map keys and Set members
2129

22-
When decoding Map to `Map | object` or Set to `Set`, keys/members of type "Simple String" or "Blob String" will be decoded as `string`s (ignoring flags) to allow lookup by type. If you need them as `Buffer`s, make sure to decode `Map`s/`Set`s as `Array`s.
30+
When decoding Map to `Map | object` or Set to `Set`, keys/members (respectively) of type "Simple String" or "Blob String" will be decoded as `string`s (ignoring flags) to allow lookup by type. If you need them as `Buffer`s, make sure to decode `Map`s/`Set`s as `Array`s.
2331

2432
## Not Implemented
2533

0 commit comments

Comments
 (0)