title: assign values to repeated fields protobufs typescript
body: <p>I have a protobuf message in service.proto</p>
  <pre><code>message DataUpdate {
    uint32 source = 1;
    uint32 destination = 2;
  }
  
  message DataUpdateRequest
  {
    string filepath = 1;
    repeated DataUpdate updates = 2;
  }
  </code></pre>
  <p>and I used <code>protoc</code> to get the js file for the above protobuf file and I assigned the values as follows in typescript file</p>
  <pre class="lang-js prettyprint-override"><code>function exec() {
    const servicePb = require('service_pb');
    const req = new servicePb.DataUpdateRequest();
    req.setFilepath('C:/Users/santhosh/test.txt');
    req.setUpdatesList([{
      source: 1,
      destination: 2,
    }]); // &lt;- this line is throwing an error
    // sending req.serializeBinary() as data to endpoint
  }
  </code></pre>
  <p>The error on setUpdatesList is:</p>
  <pre><code>TypeError: c[e].toArray is not a function
      at Function.push.../../node_modules/google-protobuf/google-protobuf.js.jspb.Message.setRepeatedWrapperField (google-protobuf.js:511:1)
  </code></pre>
  <p>How should I assign value to this type of message?</p>
  <p>I tried from postman with the following json body (and Content-Type: application/json) and it worked</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;filepath&quot;: &quot;C:/Users/santhosh/test.txt&quot;,
      &quot;updates&quot;: [
          {
              &quot;destination&quot;: 2,
              &quot;source&quot;: 1
          }
      ]
  }
  </code></pre>
  <p>How should I assign value to repeated field updatesList in typescript?</p>