UNPKG

filepond

Version:

FilePond, where files go to stretch their bits.

26 lines (25 loc) • 538 B
/*! * FilePond v5.0.2 * Copyright (c) 2017-2026 Pqina B.V. * Released under the MIT License * https://filepond.com */ import { noop as p } from "./placeholder.js"; function s(n, i) { const { timeout: r = 16, beforeDebounce: m = p, runLast: c = !0 } = i ?? {}; let e, u; return (...t) => { m(...t), clearTimeout(u); const o = Date.now(); if (e && o - e < r) { c && (u = setTimeout(() => { e = Date.now(), n(...t); }, o - e)); return; } e = o, n(...t); }; } export { s as debounce };