Skip to content

Commit a103967

Browse files
committed
refactor(material/schematics): fix some typos and add JSDoc
1 parent 382b1b7 commit a103967

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/material/schematics/ng-generate/theming-api/migration.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function detectImports(content: string, prefix: string): {imports: string[], nam
9191
return {imports, namespaces};
9292
}
9393

94-
/** Migrates the Material symbls in a file. */
94+
/** Migrates the Material symbols in a file. */
9595
function migrateMaterialSymbols(content: string, importPath: string, namespaces: string[]): string {
9696
const initialContent = content;
9797
const namespace = 'mat';
@@ -142,6 +142,7 @@ function migrateCdkSymbols(content: string, importPath: string, namespaces: stri
142142
* Renames all Sass symbols in a file based on a pre-defined mapping.
143143
* @param content Content of a file to be migrated.
144144
* @param mapping Mapping between symbol names and their replacements.
145+
* @param namespaces Names to iterate over and pass to getKeyPattern.
145146
* @param getKeyPattern Function used to turn each of the keys into a regex.
146147
* @param formatValue Formats the value that will replace any matches of the pattern returned by
147148
* `getKeyPattern`.
@@ -183,15 +184,15 @@ function insertUseStatement(content: string, importPath: string, namespace: stri
183184
/** Formats a migration key as a Sass mixin invocation. */
184185
function mixinKeyFormatter(namespace: string|null, name: string): RegExp {
185186
// Note that adding a `(` at the end of the pattern would be more accurate, but mixin
186-
// invocations don't necessarily have to include the parantheses. We could add `[(;]`,
187+
// invocations don't necessarily have to include the parentheses. We could add `[(;]`,
187188
// but then we won't know which character to include in the replacement string.
188189
return new RegExp(`@include +${escapeRegExp((namespace ? namespace + '.' : '') + name)}`, 'g');
189190
}
190191

191192
/** Returns a function that can be used to format a Sass mixin replacement. */
192193
function getMixinValueFormatter(namespace: string): (name: string) => string {
193194
// Note that adding a `(` at the end of the pattern would be more accurate,
194-
// but mixin invocations don't necessarily have to include the parantheses.
195+
// but mixin invocations don't necessarily have to include the parentheses.
195196
return name => `@include ${namespace}.${name}`;
196197
}
197198

0 commit comments

Comments
 (0)