@benev/slate
Version:
frontend web stuff
10 lines • 335 B
JavaScript
export function trim_to_history_limit(array, limit) {
while (array.length > limit)
array.shift();
return array;
}
export function record_snapshot(history, state, limit) {
history.snapshots.push(structuredClone(state));
trim_to_history_limit(history.snapshots, limit);
}
//# sourceMappingURL=history_tools.js.map