statsig-io / node-js-server-sdk

Statsig's SDK for server-side Node.js applications.
ISC License
21 stars 14 forks source link

Metadata size check could be optimized #2

Closed vijaye-statsig closed 3 years ago

vijaye-statsig commented 3 years ago

In index.js we are checking if the metadata is too big to send to server. Instead of calling JSON.stringify, since metadata is a Record<string, string> we could just add up the lengths of key & value to get an approximate size.