Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow limiting nested repeating fields #129

Merged
merged 1 commit into from
Feb 2, 2024

Commits on Feb 1, 2024

  1. feat: allow limiting nested repeating fields

    Passes the limit config through to child message decoders to allow
    limiting the length of nested repeating fields at runtime.
    
    E.g.
    
    ```protobuf
    message SubMessage {
      repeated uint32 repeatedField = 1;
    }}
    
    message MyMessage {
      repeated SubMessage messages = 1;
    }
    ```
    
    ```TypeScript
    const message = MyMessage.decode(buf, {
      limit: {
        messages: 5 // limit messages length
        messages$: {
          repeatedField: 5 // limit `repeatedField` field of all messages in the messages field
        }
      }
    })
    ```
    `
    achingbrain committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    d54b939 View commit details
    Browse the repository at this point in the history