MCPcopy Index your code
hub / github.com/darkreader/darkreader / push

Function push

src/utils/color.ts:242–260  ·  view source on GitHub ↗
(matchEnd: number)

Source from the content-addressed store, hash-verified

240 let unitStart = -1;
241
242 const push = (matchEnd: number) => {
243 const numEnd = unitStart > -1 ? unitStart : matchEnd;
244 const $num = input.slice(numStart, numEnd);
245 let n = parseFloat($num);
246 const r = range[numbers.length];
247 if (unitStart > -1) {
248 const unit = input.slice(unitStart, matchEnd);
249 const u = units[unit];
250 if (u != null) {
251 n *= r / u;
252 }
253 }
254 if (r > 1) {
255 n = Math.round(n);
256 }
257 numbers.push(n);
258 numStart = -1;
259 unitStart = -1;
260 };
261
262 for (let i = searchStart; i < searchEnd; i++) {
263 const c = input.charCodeAt(i);

Callers 1

getNumbersFromStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected