File tree 4 files changed +11
-9
lines changed 4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,4 @@ build.cjs
28
28
tmpPackage *
29
29
tmpDist *
30
30
api-extractor-configs /temp /
31
- * .log
31
+ * .log
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
ComponentDefinitionAnalysis ,
13
13
ComponentDefinitionType ,
14
14
} from "./definition.js" ;
15
- import { toReferencePath } from "./paths.js" ;
15
+ import { setReferencePath , toReferencePath } from "./paths.js" ;
16
16
17
17
/**
18
18
* A serializable reference to a Convex function.
@@ -158,15 +158,10 @@ class InstalledComponent<Definition extends ComponentDefinition<any>> {
158
158
*/
159
159
_name : string ;
160
160
161
- /**
162
- * @internal
163
- */
164
- [ toReferencePath ] : string ;
165
-
166
161
constructor ( definition : Definition , name : string ) {
167
162
this . _definition = definition ;
168
163
this . _name = name ;
169
- this [ toReferencePath ] = `_reference/childComponent/${ name } ` ;
164
+ setReferencePath ( this , `_reference/childComponent/${ name } ` ) ;
170
165
}
171
166
172
167
get exports ( ) : ComponentDefinitionExports < Definition > {
Original file line number Diff line number Diff line change 1
1
export const toReferencePath = Symbol . for ( "toReferencePath" ) ;
2
2
3
+ // Multiple instances of the same Symbol.for() are equal at runtime but not
4
+ // at type-time, so `[toReferencePath]` properties aren't used in types.
5
+ // Use this function to set the property invisibly.
6
+ export function setReferencePath < T > ( obj : T , value : string ) {
7
+ ( obj as any ) [ toReferencePath ] = value ;
8
+ }
9
+
3
10
export function extractReferencePath ( reference : any ) : string | null {
4
11
return reference [ toReferencePath ] ?? null ;
5
12
}
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export type RouteSpec = RouteSpecWithPath | RouteSpecWithPathPrefix;
142
142
export class HttpRouter {
143
143
exactRoutes : Map < string , Map < RoutableMethod , PublicHttpAction > > = new Map ( ) ;
144
144
prefixRoutes : Map < RoutableMethod , Map < string , PublicHttpAction > > = new Map ( ) ;
145
- isRouter = true ;
145
+ isRouter : true = true ;
146
146
147
147
/**
148
148
* Specify an HttpAction to be used to respond to requests
You can’t perform that action at this time.
0 commit comments