Skip to content

Commit 6f15123

Browse files
Citoleebyron
authored andcommitted
Fix typos in dedent code (#1200)
1 parent 1158cd4 commit 6f15123

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/jsutils/dedent.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
*/
99

1010
/**
11-
* fixes identation by removing leading spaces from each line
11+
* fixes indentation by removing leading spaces from each line
1212
*/
13-
function fixIdent(str: string): string {
14-
const indent = /^\n?( *)/.exec(str)[1]; // figure out ident
13+
function fixIndent(str: string): string {
14+
const indent = /^\n?( *)/.exec(str)[1]; // figure out indent
1515
return str
16-
.replace(RegExp('^' + indent, 'mg'), '') // remove ident
16+
.replace(RegExp('^' + indent, 'mg'), '') // remove indent
1717
.replace(/^\n*/m, '') // remove leading newline
1818
.replace(/ *$/, ''); // remove trailing spaces
1919
}
2020

2121
/**
22-
* An ES6 string tag that fixes identation. Also removes leading newlines
22+
* An ES6 string tag that fixes indentation. Also removes leading newlines
2323
* but keeps trailing ones
2424
*
2525
* Example usage:
@@ -45,5 +45,5 @@ export default function dedent(
4545
}
4646
}
4747

48-
return fixIdent(res);
48+
return fixIndent(res);
4949
}

0 commit comments

Comments
 (0)