Skip to content

Commit ea426f4

Browse files
committed
feat: use console.log to provide additional debugging information
1 parent 7e2ff6f commit ea426f4

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/getClassName.js

+24-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,31 @@ const getClassNameForNamespacedStyleName = (styleName: string, styleModuleImport
1818
const moduleName = styleNameParts[1];
1919

2020
if (!moduleName) {
21+
// eslint-disable-next-line no-console
22+
console.log({
23+
moduleName
24+
});
25+
2126
throw new Error('Invalid style name.');
2227
}
2328

2429
if (!styleModuleImportMap[importName]) {
25-
throw new Error('CSS module import,' + importName + ', does not exist.');
30+
// eslint-disable-next-line no-console
31+
console.log({
32+
importName
33+
});
34+
35+
throw new Error('CSS module import does not exist.');
2636
}
2737

2838
if (!styleModuleImportMap[importName][moduleName]) {
29-
throw new Error('CSS module,' + moduleName + ', does not exist in import, ' + importName + '.');
39+
// eslint-disable-next-line no-console
40+
console.log({
41+
importName,
42+
moduleName
43+
});
44+
45+
throw new Error('CSS module does not exist.');
3046
}
3147

3248
return styleModuleImportMap[importName][moduleName];
@@ -56,7 +72,12 @@ export default (styleNameValue: string, styleModuleImportMap: StyleModuleImportM
5672
const styleModuleMap: StyleModuleMapType = styleModuleImportMap[styleModuleImportMapKeys[0]];
5773

5874
if (!styleModuleMap[styleName]) {
59-
throw new Error('Could not resolve the styleName \'' + styleName + '\'.');
75+
// eslint-disable-next-line no-console
76+
console.log({
77+
styleName
78+
});
79+
80+
throw new Error('Could not resolve a styleName.');
6081
}
6182

6283
return styleModuleMap[styleName];

0 commit comments

Comments
 (0)