Skip to content

Commit 9ef2e8a

Browse files
authored
Merge pull request #53 from eltociear/patch-1
2 parents e106ba6 + 08b3fcc commit 9ef2e8a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

schematics/src/utils/ast-utils.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,17 @@ function nodesByPosition(first: ts.Node, second: ts.Node): number {
190190
}
191191

192192
/**
193-
* Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
194-
* or after the last of occurence of `syntaxKind` if the last occurence is a sub child
193+
* Insert `toInsert` after the last occurrence of `ts.SyntaxKind[nodes[i].kind]`
194+
* or after the last of occurrence of `syntaxKind` if the last occurrence is a sub child
195195
* of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
196196
*
197-
* @param nodes insert after the last occurence of nodes
197+
* @param nodes insert after the last occurrence of nodes
198198
* @param toInsert string to insert
199199
* @param file file to insert changes into
200-
* @param fallbackPos position to insert if toInsert happens to be the first occurence
200+
* @param fallbackPos position to insert if toInsert happens to be the first occurrence
201201
* @param syntaxKind the ts.SyntaxKind of the subchildren to insert after
202202
* @return Change instance
203-
* @throw Error if toInsert is first occurence but fall back is not set
203+
* @throw Error if toInsert is first occurrence but fall back is not set
204204
*/
205205
export function insertAfterLastOccurrence(
206206
nodes: ts.Node[],
@@ -220,7 +220,7 @@ export function insertAfterLastOccurrence(
220220
.pop();
221221
}
222222
if (!lastItem && fallbackPos == undefined) {
223-
throw new Error(`tried to insert ${toInsert} as first occurence with no fallback position`);
223+
throw new Error(`tried to insert ${toInsert} as first occurrence with no fallback position`);
224224
}
225225
const lastItemPosition: number = lastItem ? lastItem.getEnd() : fallbackPos;
226226

0 commit comments

Comments
 (0)