@@ -12,13 +12,7 @@ type TraceProp = string | Future<string> | number | Future<number>;
1212type Concatable = string | Future < string > ;
1313type JQCompatible = Record < string , unknown > | any [ ] | string | number ;
1414type JQDirectiveTarget = Future < any > | JQCompatible ;
15- // type FutureTypeMap = {
16- // string: FutureString;
17- // object: FutureAnyObject;
18- // number: FutureNumber;
19- // boolean: FutureBoolean;
20- // };
21- //
15+
2216const parsePath = ( path : string ) : TraceProp [ ] => {
2317 // Split the path by dots or brackets, and filter out empty strings
2418 const parts = path . split ( / \. | \[ | \] \[ ? / ) . filter ( Boolean ) ;
@@ -218,27 +212,6 @@ export class Future<T> {
218212 return this . _directive . result ( ) ;
219213 }
220214
221- // TODO(liam): don't think we need this type mapping here
222- // static jq<T extends keyof FutureTypeMap>(
223- // future: JQDirectiveTarget,
224- // query: string,
225- // futureType: keyof FutureTypeMap = "string",
226- // ): FutureTypeMap[T] {
227- // const directive = new JQ(query, future);
228- // switch (futureType) {
229- // case "string":
230- // return new FutureString(directive) as FutureTypeMap[T];
231- // case "number":
232- // return new FutureNumber(directive) as FutureTypeMap[T];
233- // case "object":
234- // return new FutureAnyObject(directive) as FutureTypeMap[T];
235- // case "boolean":
236- // return new FutureBoolean(directive) as FutureTypeMap[T];
237- // default:
238- // throw new Error(`Unknown future type: ${futureType}`);
239- // }
240- // }
241-
242215 toJSON ( ) {
243216 return {
244217 id : this . _id ,
0 commit comments