tien commented on code in PR #2515: URL: https://github.com/apache/tinkerpop/pull/2515#discussion_r1522509374
########## gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.ts: ########## @@ -476,49 +481,43 @@ function toEnum(typeName, keys) { const directionAlias = { from_: 'out', to: 'in', -}; +} as const; // for direction enums, maps the same EnumValue object to the enum aliases after creating them -function toDirectionEnum(typeName, keys) { +function toDirectionEnum(typeName: string, keys: string) { const result = toEnum(typeName, keys); Object.keys(directionAlias).forEach((k) => { - result[k] = result[directionAlias[k]]; + result[k] = result[directionAlias[k as keyof typeof directionAlias]]; }); return result; } -class EnumValue { - constructor(typeName, elementName) { - this.typeName = typeName; - this.elementName = elementName; - } +export class EnumValue { + constructor( + public typeName: string, + public elementName: string, + ) {} toString() { return this.elementName; } } -module.exports = { - EnumValue, - P, - TextP, - withOptions, - IO, - Traversal, - TraversalSideEffects, - Traverser, - barrier: toEnum('Barrier', 'normSack'), - cardinality: toEnum('Cardinality', 'list set single'), - column: toEnum('Column', 'keys values'), - direction: toDirectionEnum('Direction', 'BOTH IN OUT from_ to'), - dt: toEnum('DT', 'second minute hour day'), - graphSONVersion: toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0'), - gryoVersion: toEnum('GryoVersion', 'V1_0 V3_0'), - merge: toEnum('Merge', 'onCreate onMatch outV inV'), - operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'), - order: toEnum('Order', 'asc desc shuffle'), - pick: toEnum('Pick', 'any none'), - pop: toEnum('Pop', 'all first last mixed'), - scope: toEnum('Scope', 'global local'), - t: toEnum('T', 'id key label value'), -}; +// export const barrier = toEnum('Barrier', 'normSack'); Review Comment: Oops, have removed these -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org