import detectIndent from 'detect-indent';
import redent from 'redent';

/**
 * Indent code.
 *
 * @export
 * @param {string} code Code.
 * @returns {string}
 */
export default function indentCode(code: string): string {
	if (typeof code === 'string') {
		const indent = detectIndent(code).indent || '\t';

		code = redent(code, 0, {
			indent
		});

		return code.trim();
	} else {
		return code;
	}
}

import detectIndent from 'detect-indent';
import redent from 'redent';

/**
 * Indent code.
 *
 * @export
 * @param {string} code Code.
 * @returns {string}
 */
export default function indentCode(code: string): string {
	if (typeof code === 'string') {
		let indent = detectIndent(code).indent || '\t';
		code = redent(code, 0, indent);

		return code.trim();
	} else {
		return code;
	}
}

--- 
+++ 
@@ -10,8 +10,11 @@
  */
 export default function indentCode(code: string): string {
 	if (typeof code === 'string') {
-		let indent = detectIndent(code).indent || '\t';
-		code = redent(code, 0, indent);
+		const indent = detectIndent(code).indent || '\t';
+
+		code = redent(code, 0, {
+			indent
+		});
 
 		return code.trim();
 	} else {
:alien: Update code due to new `redent`
