File tree 1 file changed +4
-4
lines changed
packages/@css-blocks/core/src/BlockParser
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ export class BlockFactory {
207
207
208
208
// Ensure this block name is unique.
209
209
const uniqueName = this . getUniqueBlockName ( block . name , file . type === "ImportedCompiledCssFile" ) ;
210
- if ( uniqueName === false ) {
210
+ if ( uniqueName === null ) {
211
211
// For ImportedCompiledCssFiles, leave the name alone and add an error.
212
212
block . addError (
213
213
new CssBlockError ( "Block uses a name that has already been used! Check dependencies for conflicting block names." , {
@@ -427,16 +427,16 @@ export class BlockFactory {
427
427
* @param name The new block name to register.
428
428
* @param doNotOverride If true, will not attempt to provide a new block name if the given
429
429
* name has already been registered.
430
- * @return The unique block name that is now registered with the BlockFactory, or false if
430
+ * @return The unique block name that is now registered with the BlockFactory, or null if
431
431
* the name has already been registered and should not be overridden.
432
432
*/
433
- getUniqueBlockName ( name : string , doNotOverride = false ) : string | false {
433
+ getUniqueBlockName ( name : string , doNotOverride = false ) : string | null {
434
434
if ( ! this . blockNames [ name ] ) {
435
435
this . blockNames [ name ] = 1 ;
436
436
return name ;
437
437
}
438
438
if ( doNotOverride ) {
439
- return false ;
439
+ return null ;
440
440
}
441
441
return `${ name } -${ ++ this . blockNames [ name ] } ` ;
442
442
}
You can’t perform that action at this time.
0 commit comments