Skip to content

Commit f5b31ad

Browse files
committed
chore: more cleanup
1 parent 629e6e4 commit f5b31ad

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/shared/componentUtils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ export class ComponentUtils {
2626
return componentName.replace(/([A-Z])/g, ' $1').replace(/^./, (str) => str.toUpperCase());
2727
}
2828

29-
public static toKebabCase(str: string): string {
30-
return str
31-
.replace(/([a-z0-9])([A-Z])/g, '$1-$2') // insert dash between camelCase boundaries
32-
.toLowerCase();
33-
}
34-
3529
public static async getNamespacePaths(project: SfProject): Promise<string[]> {
3630
const packageDirs = project.getPackageDirectories();
3731

test/commands/lightning/dev/componentLocalPreview.nut.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { expect } from 'chai';
1111
import { TestSession } from '@salesforce/cli-plugins-testkit';
1212
import dotenv from 'dotenv';
1313
import axios from 'axios';
14-
import { ComponentUtils } from '../../../../src/shared/componentUtils.js';
14+
import { toKebabCase } from './helpers/utils.js';
1515
import { createSfdxProject, createLwcComponent } from './helpers/projectSetup.js';
1616
import { startLightningDevServer } from './helpers/devServerUtils.js';
1717

@@ -78,7 +78,7 @@ describe('LWC Local Preview Integration', () => {
7878
await new Promise((r) => setTimeout(r, STARTUP_DELAY_MS));
7979

8080
// Test the kebab-case component URL with /c- prefix
81-
const componentKebabName = ComponentUtils.toKebabCase(componentName);
81+
const componentKebabName = toKebabCase(componentName);
8282
const componentUrl = `http://localhost:${DEV_SERVER_PORT}/c-${componentKebabName}/`;
8383
let componentHttpSuccess = false;
8484

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2025, salesforce.com, inc.
3+
* All rights reserved.
4+
* Licensed under the BSD 3-Clause license.
5+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
export function toKebabCase(str: string): string {
8+
return str
9+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2') // insert dash between camelCase boundaries
10+
.toLowerCase();
11+
}

0 commit comments

Comments
 (0)