hexo/node_modules/peberminta/lib/util.mjs

9 lines
241 B
JavaScript
Raw Normal View History

2024-05-09 16:35:20 +08:00
function clamp(left, x, right) {
return Math.max(left, Math.min(x, right));
}
function escapeWhitespace(str) {
return str.replace(/(\t)|(\r)|(\n)/g, (m, t, r) => t ? '\\t' : r ? '\\r' : '\\n');
}
export { clamp, escapeWhitespace };