UNPKG

@observertc/client-monitor-js

Version:

ObserveRTC Client Integration Javascript Library

1 lines 506 B
export function groupBy(t,e){return t.reduce(((t,n)=>{const r=e(n),u=t.get(r);return u?u.push(n):t.set(r,[n]),t}),new Map)}export function clamp(t,e,n){return Math.min(n,Math.max(e,t))}export function roundNumber(t){if(null!=t)return Math.round(t)}export function calculateEmpiricalDeviation(t){if(t.length<2)return;const e=t.reduce(((t,e)=>t+e),0)/t.length,n=t.map((t=>Math.pow(t-e,2))).reduce(((t,e)=>t+e),0)/(t.length-1);return Math.sqrt(n)}export const NULL_UUID="00000000-0000-0000-0000-000000000000";