1 line of code: How to convert spaces to tabs
const spacesToTabs = (str, tabsize = 4) =&gt;   str.replace(new RegExp(` {${tabsize}}`, "g"),...
Tags: javascript, webdev, productivity, codequality