Skip to content

Commit 732896f

Browse files
committed
chore: better imports
1 parent 037d860 commit 732896f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/builders/playwright/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {
66
createBuilder,
77
targetFromTargetString,
88
} from '@angular-devkit/architect';
9-
import type { JsonObject } from '@angular-devkit/core';
10-
import { dasherize } from '@angular-devkit/core/src/utils/strings';
9+
import { type JsonObject, strings } from '@angular-devkit/core';
1110

1211
/**
1312
* Converts the options object back to an argv string array.
@@ -40,7 +39,7 @@ function buildArgs(options: JsonObject): string[] {
4039

4140
// options automatically got converted to camelCase, so we have to convert them back to kebab-case for Playwright.
4241
const dashes = key.length === 1 ? '-' : '--';
43-
const argument = `${dashes}${dasherize(key)}`;
42+
const argument = `${dashes}${strings.dasherize(key)}`;
4443

4544
if (typeof value === 'boolean') {
4645
if (value) {

src/schematics/e2e/index.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { classify, dasherize } from '@angular-devkit/core/src/utils/strings';
1+
import { strings } from '@angular-devkit/core';
22
import {
33
url,
44
type Rule,
@@ -14,10 +14,13 @@ import {
1414
// You don't have to export the function as default. You can also have more than one rule factory
1515
// per file.
1616
export default function e2e(options: { name: string }): Rule {
17-
const name = options.name;
1817
return (tree: Tree, _context: SchematicContext) => {
1918
const templateSource = apply(url('./files'), [
20-
applyTemplates({ classify, name, dasherize }),
19+
applyTemplates({
20+
classify: strings.classify,
21+
name: options.name,
22+
dasherize: strings.dasherize,
23+
}),
2124
move('e2e'),
2225
]);
2326

0 commit comments

Comments
 (0)