@@ -5,10 +5,15 @@ import type { DiscourseRelation } from "./getDiscourseRelations";
55
66// lifted from getExportTypes
77
8- export const getRelationDataUtil = async (
9- allRelations : DiscourseRelation [ ] ,
10- nodeLabelByType : Record < string , string > ,
11- ) =>
8+ export const getRelationDataUtil = async ( {
9+ allRelations,
10+ nodeLabelByType,
11+ local,
12+ } : {
13+ allRelations : DiscourseRelation [ ] ;
14+ nodeLabelByType : Record < string , string > ;
15+ local ?: boolean ;
16+ } ) =>
1217 Promise . all (
1318 allRelations
1419 . filter (
@@ -23,6 +28,7 @@ export const getRelationDataUtil = async (
2328 ? [ ]
2429 : fireQuery ( {
2530 returnNode : sourceLabel ,
31+ local,
2632 conditions : [
2733 {
2834 relation : s . label ,
@@ -50,13 +56,13 @@ export const getRelationDataUtil = async (
5056 } ) ,
5157 ) . then ( ( r ) => r . flat ( ) ) ;
5258
53- const getRelationData = async ( ) => {
59+ const getRelationData = async ( local ?: boolean ) => {
5460 const allRelations = getDiscourseRelations ( ) ;
5561 const allNodes = getDiscourseNodes ( allRelations ) ;
5662 const nodeLabelByType = Object . fromEntries (
5763 allNodes . map ( ( a ) => [ a . type , a . text ] ) ,
5864 ) ;
59- return await getRelationDataUtil ( allRelations , nodeLabelByType ) ;
65+ return await getRelationDataUtil ( { allRelations, nodeLabelByType, local } ) ;
6066} ;
6167
6268export default getRelationData ;
0 commit comments