MCPcopy
hub / github.com/cure53/DOMPurify / percentile

Function percentile

scripts/benchmark.js:197–200  ·  view source on GitHub ↗
(values, p)

Source from the content-addressed store, hash-verified

195}
196
197function percentile(values, p) {
198 const s = [...values].sort((x, y) => x - y);
199 return s[Math.min(s.length - 1, Math.floor((p / 100) * s.length))];
200}
201
202function run() {
203 const results = {};

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…