UNPKG

pretty-var-export

Version:

Export any value to valid and equivalent JavaScript code

14 lines (10 loc) 305 B
import options from '../options/options.js'; export default function indent(level: number) { return new Array(level).join(options.indent); } indent.removeAll = function (str: string) { return str.replace(/\s+/g, ''); }; indent.toSpaces = function (str: string) { return str.replace(/\s+/g, ' '); };