Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tatami-ng

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tatami-ng - npm Package Compare versions

Comparing version 0.4.14 to 0.4.15

4

dist/browser/index.js

@@ -34,4 +34,4 @@ var I1=Object.defineProperty;var c=(w,L)=>{for(var N in L)I1(w,N,{get:L[N],enumerable:!0,configurable:!0,set:(E)=>L[N]=()=>E})};var P1=(w,L)=>()=>(w&&(L=w(w=0)),L);var p=((w)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(w,{get:(L,N)=>(typeof require!=="undefined"?require:L)[N]}):w)(function(w){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+w+'" is not supported')});var R={};c(R,{uptime:()=>{{return G1}},type:()=>{{return A1}},totalmem:()=>{{return B1}},tmpdir:()=>{{return b1}},release:()=>{{return y1}},platform:()=>{{return h1}},networkInterfaces:()=>{{return i1}},loadavg:()=>{{return z1}},hostname:()=>{{return R1}},homedir:()=>{{return k1}},getNetworkInterfaces:()=>{{return r1}},freemem:()=>{{return j1}},endianness:()=>{{return D1}},default:()=>{{return x1}},cpus:()=>{{return F1}},arch:()=>{{return g1}},EOL:()=>{{return l1}}});var Z1,n,T1,f1,u1,C1,_1,q1,v1,d1,t,x1,D1,R1,z1,G1,j1,B1,F1,A1,y1,g1,h1,b1,l1,k1,i1,r1;var z=P1(()=>{Z1=Object.create,n=Object.defineProperty,T1=Object.getOwnPropertyDescriptor,f1=Object.getOwnPropertyNames,u1=Object.getPrototypeOf,C1=Object.prototype.hasOwnProperty,_1=(w,L)=>()=>(L||w((L={exports:{}}).exports,L),L.exports),q1=(w,L,N,E)=>{if(L&&typeof L=="object"||typeof L=="function")for(let M of f1(L))!C1.call(w,M)&&M!==N&&n(w,M,{get:()=>L[M],enumerable:!(E=T1(L,M))||E.enumerable});return w},v1=(w,L,N)=>(N=w!=null?Z1(u1(w)):{},q1(L||!w||!w.__esModule?n(N,"default",{value:w,enumerable:!0}):N,w)),d1=_1((w)=>{w.endianness=function(){return"LE"},w.hostname=function(){return typeof location<"u"?location.hostname:""},w.loadavg=function(){return[]},w.uptime=function(){return 0},w.freemem=function(){return Number.MAX_VALUE},w.totalmem=function(){return Number.MAX_VALUE},w.cpus=function(){return[]},w.type=function(){return"Browser"},w.release=function(){return typeof navigator<"u"?navigator.appVersion:""},w.networkInterfaces=w.getNetworkInterfaces=function(){return{}},w.arch=function(){return"javascript"},w.platform=function(){return"browser"},w.tmpdir=w.tmpDir=function(){return"/tmp"},w.EOL=`

1 ms = 1 millisecond = 1'000\u03BCs = 1'000'000ns = 1e-9ps = 1e-3s
`)}function U1({size:w,avg:L=!0,iter:N=!0,rmoe:E=!0,min_max:M=!0,percentiles:S=!0}){return`${"benchmark".padEnd(w," ")}${!L?"":"time (avg)".padStart(14," ")}${!N?"":"iter/s".padStart(14," ")}${!E?"":"error margin".padStart(14," ")}${!M?"":"(min \u2026 max)".padStart(24," ")}${!S?"":` ${"p50".padStart(9," ")} ${"p75".padStart(9," ")} ${"p99".padStart(9," ")} ${"p995".padStart(9," ")}`}`}function X1(w,L,{size:N,avg:E=!0,iter:M=!0,colors:S=!0,rmoe:V=!0,min_max:W=!0,percentiles:J=!0}){return`${w.padEnd(N," ")}${!E?"":`${F(S,K(L.avg))}/iter`.padStart(14+10*S," ")}${!M?"":`${F(S,M1(L.iter))}`.padStart(14+10*S," ")}${!V?"":`\xB1 ${A(S,l(L.rmoe))}`.padStart(14+10*S," ")}${!W?"":`(${d(S,K(L.min))} \u2026 ${b(S,K(L.max))})`.padStart(24+20*S," ")}${!J?"":` ${X(S,K(L.p50)).padStart(9+10*S," ")} ${X(S,K(L.p75)).padStart(9+10*S," ")} ${X(S,K(L.p99)).padStart(9+10*S," ")} ${X(S,K(L.p995)).padStart(9+10*S," ")}`}${!L.ss?` ${B(S,"!")}`:""}`}function r(w,{colors:L=!0}){if(w.every((E)=>E.error!=null))throw new Error("Cannot summarize benchmarks with error");if(w.length<2)throw new Error("Cannot summarize less than two benchmarks");w.sort((E,M)=>E.stats.avg-M.stats.avg);const N=w.find((E)=>E.baseline)??w[0];return`${`${v(L,"summary")}${N.group==null||N.group.startsWith(f)?"":X(L,` for ${N.group}`)}`}\n ${v(L,d(L,N.name))}${w.filter((E)=>E!==N).map((E)=>{const M=E.stats.avg/H(N.stats.avg),V=M*Math.sqrt((N.stats.sd/H(N.stats.avg))**2+(E.stats.sd/H(E.stats.avg))**2)/H(Math.sqrt(N.stats.samples+E.stats.samples)),W=u[(N.stats.samples+E.stats.samples-1||1).toString()]||u.infinity,Y=V*W/H(M)*100;return`\n ${y[1>M?"red":"green"](L,1>M?k(1/H(M)):k(M))} \xB1 ${A(L,l(Y))} times ${1>M?"slower":"faster"} than ${v(L,d(L,E.name))}`}).join("")}`}function Iw(w,L=void 0){if(w!=null&&typeof w!=="string"&&Object.prototype.toString.call(w).slice(8,-1)!=="Object"&&![Function,U].includes(w.constructor))throw new TypeError(`expected string, object or function, got ${w.constructor.name}`);if([Function,U].includes(w.constructor))L=w;if(![Function,U].includes(L.constructor))throw new TypeError(`expected function, got ${L.constructor.name}`);if(Object.prototype.toString.call(w).slice(8,-1)==="Object"){if(w.name!=null&&typeof w.name!=="string")throw new TypeError(`expected string as 'name' option, got ${w.name.constructor.name}`);if(w.summary!=null&&typeof w.summary!=="boolean")throw new TypeError(`expected boolean as 'summary' option, got ${w.summary.constructor.name}`);if(w.before!=null&&![Function,U].includes(w.before.constructor))throw new TypeError(`expected function as 'before' option, got ${w.before.constructor.name}`);if(w.after!=null&&![Function,U].includes(w.after.constructor))throw new TypeError(`expected function as 'after' option, got ${w.after.constructor.name}`)}if(Z=(typeof w==="string"?w.trim():w.name?.trim())||`${f}${x.size+1}`,!x.has(Z))x.set(Z,{summary:w.summary??!0,before:w.before??I,after:w.after??I});if(U===L.constructor)L().then(()=>{Z=null});else L(),Z=null}function Pw(w,L=void 0,N={}){if([Function,U].includes(w.constructor))L=w,w=L.name;h(L,N),w=w.trim(),Q.push({before:N.before??I,fn:L,after:N.after??I,name:w,group:Z,time:_,samples:q,warmup:!0,baseline:!1,async:U===L.constructor})}function Hw(w,L=void 0,N={}){if([Function,U].includes(w.constructor))L=w,w=L.name;h(L,N),w=w.trim(),Q.push({before:N.before??I,fn:L,after:N.after??I,name:w,group:Z,time:_,samples:q,warmup:!0,baseline:!0,async:U===L.constructor})}function Jw(){x.clear(),Q.length=0}async function Kw(w={}){if(Object.prototype.toString.call(w).slice(8,-1)!=="Object")throw new TypeError(`expected object, got ${w.constructor.name}`);if(w.samples!=null&&typeof w.samples!=="number")throw new TypeError(`expected number as 'samples' option, got ${w.samples.constructor.name}`);if(w.time!=null&&typeof w.time!=="number")throw new TypeError(`expected number as 'time' option, got ${w.time.constructor.name}`);if(w.warmup!=null&&typeof w.warmup!=="boolean")throw new TypeError(`expected boolean as 'warmup' option, got ${w.warmup.constructor.name}`);if(w.json!=null&&typeof w.json!=="number"&&typeof w.json!=="boolean"&&typeof w.json!=="string")throw new TypeError(`expected number or boolean or string as 'json' option, got ${w.json.constructor.name}`);if(typeof w.json==="string"&&!Object.values(D).includes(w.json))throw new TypeError(`expected one of ${Object.values(D).join(", ")} as 'json' option, got ${w.json}`);if(w.file!=null&&typeof w.file!=="string")throw new TypeError(`expected string as 'file' option, got ${w.file.constructor.name}`);if(typeof w.file==="string"&&w.file.trim().length===0)throw new TypeError("expected non-empty string as 'file' option");w=j({silent:!1,colors:!s,size:S1(Q.map((S)=>S.name))},w);const L=w.silent===!0?I:E1,N={benchmarks:Q,cpu:o,runtime:`${P} ${a} (${e})`};if(!w.json&&Q.length>0)L(X(w.colors,`cpu: ${N.cpu}`)),L(X(w.colors,`runtime: ${N.runtime}`)),L(""),L(U1(w)),L(i(w));let E=Q.filter((S)=>S.group==null),M=await W1(E,L,w);if(E=E.filter((S)=>S.error==null),!w.json&&E.length>1)L(""),L(r(E,w));for(let[S,V]of x){if(!w.json){if(M)L("");if(!S.startsWith(f))L(`\u2022 ${S}`);if(M||!S.startsWith(f))L(X(w.colors,i(w)))}let W=Q.filter((J)=>J.group===S);if(U===V.before.constructor?await V.before():V.before(),M=await W1(W,L,w),U===V.after.constructor?await V.after():V.after(),W=W.filter((J)=>J.error==null),V.summary===!0&&!w.json&&W.length>1)L(""),L(r(W,w))}if(!w.json&&w.units)L(V1(w));if(w.json){let S;switch(w.json){case D.bmf:S=JSON.stringify($1(N));break;default:S=JSON.stringify(N,void 0,typeof w.json!=="number"?0:w.json)}if(L(S),w.file)w1(w.file,S)}return JSON.parse(JSON.stringify(N))}var Z=null,x=new Map,Q=[],W1=async(w,L,N={})=>{let E=!1;for(let M of w){E=!0,L1(M,N);try{if(M.stats=await N1(M.fn,M.before,M.after,{async:M.async,samples:M.samples,time:M.time,warmup:M.warmup}),!N.json)L(X1(M.name,M.stats,N))}catch(S){if(M.error=S,!N.json)L(O1(M.name,M.error,N))}}return E};export{Kw as run,Iw as group,Jw as clear,Pw as bench,Hw as baseline};
`)}function U1({size:w,avg:L=!0,iter:N=!0,rmoe:E=!0,min_max:M=!0,percentiles:S=!0}){return`${"benchmark".padEnd(w," ")}${!L?"":"time (avg)".padStart(14," ")}${!N?"":"iter/s".padStart(14," ")}${!E?"":"error margin".padStart(14," ")}${!M?"":"(min \u2026 max)".padStart(24," ")}${!S?"":` ${"p50".padStart(9," ")} ${"p75".padStart(9," ")} ${"p99".padStart(9," ")} ${"p995".padStart(9," ")}`}`}function X1(w,L,{size:N,avg:E=!0,iter:M=!0,colors:S=!0,rmoe:V=!0,min_max:W=!0,percentiles:J=!0}){return`${w.padEnd(N," ")}${!E?"":`${F(S,K(L.avg))}/iter`.padStart(14+10*S," ")}${!M?"":`${F(S,M1(L.iter))}`.padStart(14+10*S," ")}${!V?"":`\xB1 ${A(S,l(L.rmoe))}`.padStart(14+10*S," ")}${!W?"":`(${d(S,K(L.min))} \u2026 ${b(S,K(L.max))})`.padStart(24+20*S," ")}${!J?"":` ${X(S,K(L.p50)).padStart(9+10*S," ")} ${X(S,K(L.p75)).padStart(9+10*S," ")} ${X(S,K(L.p99)).padStart(9+10*S," ")} ${X(S,K(L.p995)).padStart(9+10*S," ")}`}${!L.ss?` ${B(S,"!")}`:""}`}function r(w,{colors:L=!0}){if(w.some((E)=>E.error!=null))throw new Error("Cannot summarize benchmarks with error");if(w.length<2)throw new Error("Cannot summarize less than two benchmarks");w.sort((E,M)=>E.stats.avg-M.stats.avg);const N=w.find((E)=>E.baseline)??w[0];return`${`${v(L,"summary")}${N.group==null||N.group.startsWith(f)?"":X(L,` for ${N.group}`)}`}\n ${v(L,d(L,N.name))}${w.filter((E)=>E!==N).map((E)=>{const M=E.stats.avg/H(N.stats.avg),V=M*Math.sqrt((N.stats.sd/H(N.stats.avg))**2+(E.stats.sd/H(E.stats.avg))**2)/H(Math.sqrt(N.stats.samples+E.stats.samples)),W=u[(N.stats.samples+E.stats.samples-1||1).toString()]||u.infinity,Y=V*W/H(M)*100;return`\n ${y[1>M?"red":"green"](L,1>M?k(1/H(M)):k(M))} \xB1 ${A(L,l(Y))} times ${1>M?"slower":"faster"} than ${v(L,d(L,E.name))}`}).join("")}`}function Iw(w,L=void 0){if(w!=null&&typeof w!=="string"&&Object.prototype.toString.call(w).slice(8,-1)!=="Object"&&![Function,U].includes(w.constructor))throw new TypeError(`expected string, object or function, got ${w.constructor.name}`);if([Function,U].includes(w.constructor))L=w;if(![Function,U].includes(L.constructor))throw new TypeError(`expected function, got ${L.constructor.name}`);if(Object.prototype.toString.call(w).slice(8,-1)==="Object"){if(w.name!=null&&typeof w.name!=="string")throw new TypeError(`expected string as 'name' option, got ${w.name.constructor.name}`);if(w.summary!=null&&typeof w.summary!=="boolean")throw new TypeError(`expected boolean as 'summary' option, got ${w.summary.constructor.name}`);if(w.before!=null&&![Function,U].includes(w.before.constructor))throw new TypeError(`expected function as 'before' option, got ${w.before.constructor.name}`);if(w.after!=null&&![Function,U].includes(w.after.constructor))throw new TypeError(`expected function as 'after' option, got ${w.after.constructor.name}`)}if(Z=(typeof w==="string"?w.trim():w.name?.trim())||`${f}${x.size+1}`,!x.has(Z))x.set(Z,{summary:w.summary??!0,before:w.before??I,after:w.after??I});if(U===L.constructor)L().then(()=>{Z=null});else L(),Z=null}function Pw(w,L=void 0,N={}){if([Function,U].includes(w.constructor))L=w,w=L.name;h(L,N),w=w.trim(),Q.push({before:N.before??I,fn:L,after:N.after??I,name:w,group:Z,time:_,samples:q,warmup:!0,baseline:!1,async:U===L.constructor})}function Hw(w,L=void 0,N={}){if([Function,U].includes(w.constructor))L=w,w=L.name;h(L,N),w=w.trim(),Q.push({before:N.before??I,fn:L,after:N.after??I,name:w,group:Z,time:_,samples:q,warmup:!0,baseline:!0,async:U===L.constructor})}function Jw(){x.clear(),Q.length=0}async function Kw(w={}){if(Object.prototype.toString.call(w).slice(8,-1)!=="Object")throw new TypeError(`expected object, got ${w.constructor.name}`);if(w.samples!=null&&typeof w.samples!=="number")throw new TypeError(`expected number as 'samples' option, got ${w.samples.constructor.name}`);if(w.time!=null&&typeof w.time!=="number")throw new TypeError(`expected number as 'time' option, got ${w.time.constructor.name}`);if(w.warmup!=null&&typeof w.warmup!=="boolean")throw new TypeError(`expected boolean as 'warmup' option, got ${w.warmup.constructor.name}`);if(w.json!=null&&typeof w.json!=="number"&&typeof w.json!=="boolean"&&typeof w.json!=="string")throw new TypeError(`expected number or boolean or string as 'json' option, got ${w.json.constructor.name}`);if(typeof w.json==="string"&&!Object.values(D).includes(w.json))throw new TypeError(`expected one of ${Object.values(D).join(", ")} as 'json' option, got ${w.json}`);if(w.file!=null&&typeof w.file!=="string")throw new TypeError(`expected string as 'file' option, got ${w.file.constructor.name}`);if(typeof w.file==="string"&&w.file.trim().length===0)throw new TypeError("expected non-empty string as 'file' option");w=j({silent:!1,colors:!s,size:S1(Q.map((S)=>S.name))},w);const L=w.silent===!0?I:E1,N={benchmarks:Q,cpu:o,runtime:`${P} ${a} (${e})`};if(!w.json&&Q.length>0)L(X(w.colors,`cpu: ${N.cpu}`)),L(X(w.colors,`runtime: ${N.runtime}`)),L(""),L(U1(w)),L(i(w));let E=Q.filter((S)=>S.group==null),M=await W1(E,L,w);if(E=E.filter((S)=>S.error==null),!w.json&&E.length>1)L(""),L(r(E,w));for(let[S,V]of x){if(!w.json){if(M)L("");if(!S.startsWith(f))L(`\u2022 ${S}`);if(M||!S.startsWith(f))L(X(w.colors,i(w)))}let W=Q.filter((J)=>J.group===S);if(U===V.before.constructor?await V.before():V.before(),M=await W1(W,L,w),U===V.after.constructor?await V.after():V.after(),W=W.filter((J)=>J.error==null),V.summary===!0&&!w.json&&W.length>1)L(""),L(r(W,w))}if(!w.json&&w.units)L(V1(w));if(w.json){let S;switch(w.json){case D.bmf:S=JSON.stringify($1(N));break;default:S=JSON.stringify(N,void 0,typeof w.json!=="number"?0:w.json)}if(L(S),w.file)w1(w.file,S)}return JSON.parse(JSON.stringify(N))}var Z=null,x=new Map,Q=[],W1=async(w,L,N={})=>{let E=!1;for(let M of w){E=!0,L1(M,N);try{if(M.stats=await N1(M.fn,M.before,M.after,{async:M.async,samples:M.samples,time:M.time,warmup:M.warmup}),!N.json)L(X1(M.name,M.stats,N))}catch(S){if(M.error=S,!N.json)L(O1(M.name,M.error,N))}}return E};export{Kw as run,Iw as group,Jw as clear,Pw as bench,Hw as baseline};
//# debugId=73175B4CA12FE9FE64756e2164756e21
//# debugId=0BC9F3BBA91ABC6164756e2164756e21

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "0.4.14",
"version": "0.4.15",
"packageManager": "bun@1.1.13",

@@ -9,0 +9,0 @@ "types": "./src/index.d.ts",

@@ -75,3 +75,3 @@ <h1 align=center>tatami-ng</h1>

...
} from 'https://cdn.jsdelivr.net/npm/tatami-ng@0.4.14/dist/browser/index.js'
} from 'https://cdn.jsdelivr.net/npm/tatami-ng@0.4.15/dist/browser/index.js'
</script>

@@ -78,0 +78,0 @@ ```

@@ -128,3 +128,3 @@ import { tTable, tatamiNgGroup } from '../constants.js';

export function summary(benchmarks, { colors = true }) {
if (benchmarks.every(benchmark => benchmark.error != null)) {
if (benchmarks.some(benchmark => benchmark.error != null)) {
throw new Error('Cannot summarize benchmarks with error');

@@ -131,0 +131,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc