Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
460 B
Text
14 lines
460 B
Text
export default function reduce(values, reducer, value) {
|
|
if (typeof reducer !== "function") throw new TypeError("reducer is not a function");
|
|
const iterator = values[Symbol.iterator]();
|
|
let done, next, index = -1;
|
|
if (arguments.length < 3) {
|
|
({done, value} = iterator.next());
|
|
if (done) return;
|
|
++index;
|
|
}
|
|
while (({done, value: next} = iterator.next()), !done) {
|
|
value = reducer(value, next, ++index, values);
|
|
}
|
|
return value;
|
|
}
|