Skip to content

Commit 6204f5f

Browse files
authored
refactor(material/schematics): fix some typos and add JSDoc (#22610)
1 parent 00c73e3 commit 6204f5f

File tree

1 file changed

+4
-3
lines changed
  • src/material/schematics/ng-update/migrations/theming-api-v12

1 file changed

+4
-3
lines changed

src/material/schematics/ng-update/migrations/theming-api-v12/migration.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function detectImports(content: string, prefix: string): DetectImportResult {
101101
return {imports, namespaces};
102102
}
103103

104-
/** Migrates the Material symbls in a file. */
104+
/** Migrates the Material symbols in a file. */
105105
function migrateMaterialSymbols(content: string, importPath: string,
106106
detectedImports: DetectImportResult): string {
107107
const initialContent = content;
@@ -154,6 +154,7 @@ function migrateCdkSymbols(content: string, importPath: string,
154154
* Renames all Sass symbols in a file based on a pre-defined mapping.
155155
* @param content Content of a file to be migrated.
156156
* @param mapping Mapping between symbol names and their replacements.
157+
* @param namespaces Names to iterate over and pass to getKeyPattern.
157158
* @param getKeyPattern Function used to turn each of the keys into a regex.
158159
* @param formatValue Formats the value that will replace any matches of the pattern returned by
159160
* `getKeyPattern`.
@@ -205,15 +206,15 @@ function insertUseStatement(content: string, importPath: string, importsToIgnore
205206
/** Formats a migration key as a Sass mixin invocation. */
206207
function mixinKeyFormatter(namespace: string|null, name: string): RegExp {
207208
// Note that adding a `(` at the end of the pattern would be more accurate, but mixin
208-
// invocations don't necessarily have to include the parantheses. We could add `[(;]`,
209+
// invocations don't necessarily have to include the parentheses. We could add `[(;]`,
209210
// but then we won't know which character to include in the replacement string.
210211
return new RegExp(`@include +${escapeRegExp((namespace ? namespace + '.' : '') + name)}`, 'g');
211212
}
212213

213214
/** Returns a function that can be used to format a Sass mixin replacement. */
214215
function getMixinValueFormatter(namespace: string): (name: string) => string {
215216
// Note that adding a `(` at the end of the pattern would be more accurate,
216-
// but mixin invocations don't necessarily have to include the parantheses.
217+
// but mixin invocations don't necessarily have to include the parentheses.
217218
return name => `@include ${namespace}.${name}`;
218219
}
219220

0 commit comments

Comments
 (0)