File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 10991099 "scripts/check-fork-dependent-coverage.ts" : 2 ,
11001100 "scripts/check-import-specifiers.ts" : 1 ,
11011101 "scripts/create-single-release.ts" : 2 ,
1102- "scripts/generate-docs.ts" : 41 ,
1102+ "scripts/generate-docs.ts" : 40 ,
11031103 "scripts/generate-v2-cli-api.ts" : 3
11041104 },
11051105 "nonNullAssertion" : {
Original file line number Diff line number Diff line change @@ -2238,14 +2238,16 @@ function extractSpreadBase(blockContent: string): string | null {
22382238/**
22392239 * Operations a block inherits by spreading a same-file block's fields array
22402240 * (`subBlocks: [...NotionBlock.subBlocks, ...]`) rather than the whole config.
2241+ * Only a plain spread counts: a transformed one (`...XBlock.subBlocks.map(...)`) may rewrite the
2242+ * operations, so it falls through to the block's own `tools.access`.
22412243 */
22422244function extractSpreadSubBlocksOperations (
22432245 blockContent : string ,
22442246 fileContent : string | undefined
22452247) : { label : string ; id : string } [ ] {
22462248 if ( ! fileContent ) return [ ]
22472249 const declarations = blockDeclarations ( fileContent )
2248- for ( const match of blockContent . matchAll ( / \. \. \. ( \w + B l o c k ) \. s u b B l o c k s \b / g) ) {
2250+ for ( const match of blockContent . matchAll ( / \. \. \. ( \w + B l o c k ) \. s u b B l o c k s \s * [ , \] ] / g) ) {
22492251 const declaration = declarations . find ( ( candidate ) => candidate . name === match [ 1 ] )
22502252 const operations = declaration ? extractOperationsFromContent ( declaration . content ) : [ ]
22512253 if ( operations . length > 0 ) return operations
@@ -2354,7 +2356,7 @@ function extractBlockConfigFromContent(
23542356 }
23552357
23562358 const ownOperations = extractOperationsFromContent ( blockContent )
2357- const baseOperations : { label : string ; id : string } [ ] = ( baseConfig as any ) ?. operations ?? [ ]
2359+ const baseOperations = baseConfig ?. operations ?? [ ]
23582360 const operations =
23592361 ownOperations . length > 0
23602362 ? ownOperations
You can’t perform that action at this time.
0 commit comments