Skip to content

Commit a442c52

Browse files
committed
chore: rename to required blocks
1 parent aca4c8f commit a442c52

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/welcome/admin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,22 @@ const SEARCH_TREE = [
246246
]
247247

248248
const DERIVED_BLOCKS = getAllBlocks()
249-
// An object containing all the blocks and the children blocks they are dependent to
250-
const BLOCK_DEPENDENCIES = BLOCK_CATEROGIES.reduce( ( acc, { id } ) => {
249+
// An object containing all the blocks and their required children
250+
const REQUIRED_BLOCKS = BLOCK_CATEROGIES.reduce( ( acc, { id } ) => {
251251
DERIVED_BLOCKS[ id ].forEach( block => {
252252
acc[ block.name ] = block[ 'stk-required-blocks' ] ?? []
253253
} )
254254
return acc
255255
}, {} )
256256

257257
const getChildrenBlocks = blockname => {
258-
return BLOCK_DEPENDENCIES[ blockname ] || []
258+
return REQUIRED_BLOCKS[ blockname ] || []
259259
}
260260

261261
const getParentBlocks = blockName => {
262262
const parents = []
263-
for ( const parent in BLOCK_DEPENDENCIES ) {
264-
if ( BLOCK_DEPENDENCIES[ parent ].includes( blockName ) ) {
263+
for ( const parent in REQUIRED_BLOCKS ) {
264+
if ( REQUIRED_BLOCKS[ parent ].includes( blockName ) ) {
265265
parents.push( parent )
266266
}
267267
}

0 commit comments

Comments
 (0)