Skip to content

Commit b8cc7da

Browse files
committed
rename regex, and small regex modification
1 parent 2a00f9f commit b8cc7da

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/devextreme-angular/src/core/deprecated-config-warning.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { logWarning } from './warning-helper';
55

66
const warnedUsages = new Set<string>();
77

8-
const LEGACY_CLASS_NAME_REGEXP = /^Dx([io])([A-Za-z0-9]+)Component$/;
8+
const NESTED_CLASS_NAME_REGEXP = /^(Dx[io][A-Z]\w+)Component$/;
99

1010
type DeprecatedConfigEntry = Record<string, string>;
1111

@@ -15,15 +15,14 @@ function getLegacySelector(nestedOption: BaseNestedOption): string | undefined {
1515
return undefined;
1616
}
1717

18-
const match = LEGACY_CLASS_NAME_REGEXP.exec(className);
18+
const match = NESTED_CLASS_NAME_REGEXP.exec(className);
1919
if (!match) {
2020
return undefined;
2121
}
2222

23-
const [, type, rest] = match;
24-
const prefix = type === 'o' ? 'dxo-' : 'dxi-';
23+
const [, legacyName] = match;
2524

26-
return `${prefix}${toKebabCase(rest)}`;
25+
return toKebabCase(legacyName);
2726
}
2827

2928
function getHostMapping(host: INestedOptionContainer | undefined): DeprecatedConfigEntry | undefined {

0 commit comments

Comments
 (0)