(length, typeMapping, chunk)
| 908 | } |
| 909 | |
| 910 | #decodeMapItems(length, typeMapping, chunk) { |
| 911 | switch (typeMapping[RESP_TYPES.MAP]) { |
| 912 | case Map: |
| 913 | return this.#decodeMapAsMap( |
| 914 | new Map(), |
| 915 | length, |
| 916 | typeMapping, |
| 917 | chunk |
| 918 | ); |
| 919 | |
| 920 | case Array: |
| 921 | return this.#decodeArrayItems( |
| 922 | new Array(length * 2), |
| 923 | 0, |
| 924 | typeMapping, |
| 925 | chunk |
| 926 | ); |
| 927 | |
| 928 | default: |
| 929 | return this.#decodeMapAsObject( |
| 930 | {}, |
| 931 | length, |
| 932 | typeMapping, |
| 933 | chunk |
| 934 | ); |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | #decodeMapAsMap(map, remaining, typeMapping, chunk) { |
| 939 | // using `remaining` instead of `length` & `map.size` to make it work even if the map contains duplicate keys |
no test coverage detected