Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 80ae4e7

Browse files
committed
fix(helper.ts): Fixed to behave correctly as &:not and &:has
1 parent a4e7189 commit 80ae4e7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_internal/utils/helper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,31 +128,31 @@ export const camelToKebabCase = (property: string) => {
128128
const afterProp = property.slice(index + prop.length);
129129
const afterNotKebab = afterProp.replace(/_/g, '-').toLowerCase();
130130

131-
if (property.startsWith('notClass')) {
131+
if (prop === 'notClass') {
132132
return `:not(.${afterNotKebab})`;
133133
}
134134

135-
if (property.startsWith('not')) {
135+
if (prop === 'not') {
136136
if (property.includes('not(')) {
137137
return `:not${afterProp.toLowerCase()}`;
138138
} else {
139139
return `:not(${afterProp.toLowerCase()})`;
140140
}
141141
}
142142

143-
if (property.startsWith('hasClass')) {
143+
if (prop === 'hasClass') {
144144
return `:has(.${afterNotKebab})`;
145145
}
146146

147-
if (property.startsWith('hasChild')) {
147+
if (prop === 'hasChild') {
148148
return `:has(> ${afterProp.toLowerCase()})`;
149149
}
150150

151-
if (property.startsWith('hasPlus')) {
151+
if (prop === 'hasPlus') {
152152
return `:has(+ ${afterProp.toLowerCase()})`;
153153
}
154154

155-
if (property.startsWith('has')) {
155+
if (prop === 'has') {
156156
if (property.includes('has(')) {
157157
return `:has${afterProp.toLowerCase()}`;
158158
} else {

0 commit comments

Comments
 (0)