@@ -17,10 +17,7 @@ import {
1717 PluginStringMap
1818} from '@types' ;
1919import {
20- BOOLEAN_TYPE ,
21- STRING_TYPE ,
22- NUMBER_TYPE ,
23- FUNCTION_TYPE ,
20+ TYPEOF ,
2421 REG_EXP_CHARACTERS_REG_EXP ,
2522 LAST_WORD_CHARACTER_REG_EXP
2623} from '@constants' ;
@@ -106,12 +103,12 @@ const isNotAcceptedStringMap = (stringMap: PluginStringMap[]): boolean => {
106103const isAcceptedProcessDeclarationPlugins = ( plugins : DeclarationPlugin [ ] ) : boolean =>
107104 Array . isArray ( plugins )
108105 && plugins . every ( ( plugin : DeclarationPlugin ) =>
109- typeof plugin . name == STRING_TYPE
110- && typeof plugin . priority == NUMBER_TYPE
106+ typeof plugin . name == TYPEOF . STRING
107+ && typeof plugin . priority == TYPEOF . NUMBER
111108 && Array . isArray ( plugin . processors )
112109 && plugin . processors . every ( ( processor : DeclarationPluginProcessor ) =>
113110 processor . expr instanceof RegExp
114- && typeof processor . action === FUNCTION_TYPE
111+ && typeof processor . action === TYPEOF . FUNCTION
115112 )
116113 ) ;
117114
@@ -183,10 +180,10 @@ const normalizeOptions = (options: PluginOptions): PluginOptionsNormalized => {
183180 if ( options . source && SourceValuesArray . includes ( options . source ) ) {
184181 returnOptions . source = options . source ;
185182 }
186- if ( typeof options . ignorePrefixedRules === BOOLEAN_TYPE ) {
183+ if ( typeof options . ignorePrefixedRules === TYPEOF . BOOLEAN ) {
187184 returnOptions . ignorePrefixedRules = options . ignorePrefixedRules ;
188185 }
189- if ( typeof options . greedy === BOOLEAN_TYPE ) {
186+ if ( typeof options . greedy === TYPEOF . BOOLEAN ) {
190187 returnOptions . greedy = options . greedy ;
191188 }
192189 if ( ! isNotStringOrStringArray ( options . ltrPrefix ) ) {
@@ -198,25 +195,25 @@ const normalizeOptions = (options: PluginOptions): PluginOptionsNormalized => {
198195 if ( ! isNotStringOrStringArray ( options . bothPrefix ) ) {
199196 returnOptions . bothPrefix = options . bothPrefix ;
200197 }
201- if ( typeof options . prefixSelectorTransformer === FUNCTION_TYPE ) {
198+ if ( typeof options . prefixSelectorTransformer === TYPEOF . FUNCTION ) {
202199 returnOptions . prefixSelectorTransformer = options . prefixSelectorTransformer ;
203200 }
204- if ( typeof options . safeBothPrefix === BOOLEAN_TYPE ) {
201+ if ( typeof options . safeBothPrefix === TYPEOF . BOOLEAN ) {
205202 returnOptions . safeBothPrefix = options . safeBothPrefix ;
206203 }
207- if ( typeof options . processUrls === BOOLEAN_TYPE ) {
204+ if ( typeof options . processUrls === TYPEOF . BOOLEAN ) {
208205 returnOptions . processUrls = options . processUrls ;
209206 }
210- if ( typeof options . processRuleNames === BOOLEAN_TYPE ) {
207+ if ( typeof options . processRuleNames === TYPEOF . BOOLEAN ) {
211208 returnOptions . processRuleNames = options . processRuleNames ;
212209 }
213- if ( typeof options . processKeyFrames === BOOLEAN_TYPE ) {
210+ if ( typeof options . processKeyFrames === TYPEOF . BOOLEAN ) {
214211 returnOptions . processKeyFrames = options . processKeyFrames ;
215212 }
216- if ( typeof options . processEnv === BOOLEAN_TYPE ) {
213+ if ( typeof options . processEnv === TYPEOF . BOOLEAN ) {
217214 returnOptions . processEnv = options . processEnv ;
218215 }
219- if ( typeof options . useCalc === BOOLEAN_TYPE ) {
216+ if ( typeof options . useCalc === TYPEOF . BOOLEAN ) {
220217 returnOptions . useCalc = options . useCalc ;
221218 }
222219 if ( ! isNotAcceptedStringMap ( options . stringMap ) ) {
0 commit comments