Stimulus action parameter int64 problem

Hi,

I’m developing a small application which works with twitter snowflake format (Snowflake ID - Wikipedia). The problem is that this is represented as an 64bit integer.

When using it as an action parameter like

<button data-action="form#send" class="btn btn-danger btn-sm"
  data-form-action-param="delete"
  data-form-command-id-param="1204863685244223529">Delete
</button>

this is parsed into

{
  "action": "delete",
  "commandId": 1204863685244223500
}

Would it be possible to call Number.isSafeInteger() before automatically converting it into an in the controller?

Thanks

1 Like