( w: Writer, type: D.ScalarValueType | D.EnumValueType, list: ReadonlyArray<unknown> )
| 998 | } |
| 999 | |
| 1000 | const writePackedValues = ( |
| 1001 | w: Writer, |
| 1002 | type: D.ScalarValueType | D.EnumValueType, |
| 1003 | list: ReadonlyArray<unknown> |
| 1004 | ): void => { |
| 1005 | let index = 0 |
| 1006 | try { |
| 1007 | if (type.kind === "enum") { |
| 1008 | for (; index < list.length; index++) writeEnum(w, type, list[index]) |
| 1009 | } else { |
| 1010 | const write = scalarWriters[type.scalar] |
| 1011 | for (; index < list.length; index++) write(w, list[index]) |
| 1012 | } |
| 1013 | } catch (error) { |
| 1014 | rethrow(error, index) |
| 1015 | } |
| 1016 | } |
| 1017 | |
| 1018 | const writeMapKey = (w: Writer, type: D.ScalarValueType, key: string): void => { |
| 1019 | w.tag(1, wireTypeOf(type) as ProtobufWriter.WireType) |
no test coverage detected