sepehr 8d95f34fcc fix: Add debounced Undo/Redo system to avoid character-by-character history
- Add debounced state updates for title and content (500ms delay)
- Immediate UI updates with delayed history saving
- Prevent one-letter-per-undo issue
- Add cleanup for debounce timers on unmount
2026-01-04 14:28:11 +01:00

21 lines
649 B
JavaScript

// src/helper/accepts/accepts.ts
import { parseAccept } from "../../utils/accept.js";
var defaultMatch = (accepts2, config) => {
const { supports, default: defaultSupport } = config;
const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type));
return accept ? accept.type : defaultSupport;
};
var accepts = (c, options) => {
const acceptHeader = c.req.header(options.header);
if (!acceptHeader) {
return options.default;
}
const accepts2 = parseAccept(acceptHeader);
const match = options.match || defaultMatch;
return match(accepts2, options);
};
export {
accepts,
defaultMatch
};