Skip to content

Commit 41767a7

Browse files
authored
fix indentation detection (#7616)
1 parent ad240d1 commit 41767a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/kit/src/core/sync/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function write(file, code) {
2727

2828
/** @param {string} str */
2929
export function trim(str) {
30-
const indentation = /** @type {RegExpExecArray} */ (/\n?(\s*)/.exec(str))[1];
30+
const indentation = /** @type {RegExpExecArray} */ (/\n?([ \t]*)/.exec(str))[1];
3131
const pattern = new RegExp(`^${indentation}`, 'gm');
3232
return str.replace(pattern, '').trim();
3333
}

0 commit comments

Comments
 (0)