mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-11 02:03:10 +00:00
* add 1MB restriction to LightPush and Relay * fix condition * improve lightPush test * update test * add isomorphic-webcrypto * import module * add errors to SendResult and tests * fix lint
11 lines
195 B
TypeScript
11 lines
195 B
TypeScript
const MB = 1024 ** 2;
|
|
const SIZE_CAP = 1; // 1 MB
|
|
|
|
export const isSizeValid = (payload: Uint8Array): boolean => {
|
|
if (payload.length / MB > SIZE_CAP) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
};
|