@@ -5,13 +5,12 @@ import type {
5
5
StyleModuleImportMapType ,
6
6
HandleMissingStyleNameOptionType
7
7
} from './types' ;
8
+ import optionsDefaults from './schemas/optionsDefaults' ;
8
9
9
10
type OptionsType = { |
10
11
handleMissingStyleName : HandleMissingStyleNameOptionType
11
12
| } ;
12
13
13
- const DEFAULT_HANDLE_MISSING_STYLENAME_OPTION = 'throw' ;
14
-
15
14
const isNamespacedStyleName = ( styleName : string ) : boolean => {
16
15
return styleName . indexOf ( '.' ) !== - 1 ;
17
16
} ;
@@ -28,7 +27,7 @@ const getClassNameForNamespacedStyleName = (
28
27
const importName = styleNameParts [ 0 ] ;
29
28
const moduleName = styleNameParts [ 1 ] ;
30
29
const handleMissingStyleName = handleMissingStyleNameOption ||
31
- DEFAULT_HANDLE_MISSING_STYLENAME_OPTION ;
30
+ optionsDefaults . handleMissingStyleName ;
32
31
33
32
if ( ! moduleName ) {
34
33
if ( handleMissingStyleName === 'throw' ) {
@@ -70,7 +69,7 @@ export default (styleNameValue: string, styleModuleImportMap: StyleModuleImportM
70
69
const styleModuleImportMapKeys = Object . keys ( styleModuleImportMap ) ;
71
70
72
71
const handleMissingStyleName = options && options . handleMissingStyleName ||
73
- DEFAULT_HANDLE_MISSING_STYLENAME_OPTION ;
72
+ optionsDefaults . handleMissingStyleName ;
74
73
75
74
if ( ! styleNameValue ) {
76
75
return '' ;
0 commit comments