Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
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
197
function
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
202
function
run() {
203
const
results = {};
Callers
1
run
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected