Skip to content

Commit

Permalink
feat: remove bound prefix from function name to not figure in trace
Browse files Browse the repository at this point in the history
  • Loading branch information
tabkram committed Dec 10, 2023
1 parent 8cbc519 commit 229d3cd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/trace/traceableExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export class TraceableExecution {
inputs: Array<unknown> = [],
options: TraceOptions<Array<any>, O> | TraceOptions<Array<any>, O>['trace'] = {
trace: {
id: [blockFunction.name ? blockFunction.name : 'function', new Date()?.getTime(), uuidv4()]?.join('_'),
label: blockFunction.name ? blockFunction.name : 'function'
id: [blockFunction.name ? blockFunction.name.replace('bound ', '') : 'function', new Date()?.getTime(), uuidv4()]?.join('_'),
label: blockFunction.name ? blockFunction.name.replace('bound ', '') : 'function'
},
config: DEFAULT_TRACE_CONFIG
}
Expand All @@ -182,10 +182,15 @@ export class TraceableExecution {
const executionTimer = new ExecutionTimer();
executionTimer?.start();
const nodeTrace: NodeData = {
id: [blockFunction.name ? blockFunction.name : 'function', executionTimer?.getStartDate()?.getTime(), uuidv4()]?.join('_'),
label: [(this.nodes?.length ?? 0) + 1, nodeTraceFromOptions?.id ?? (blockFunction.name ? blockFunction.name : 'function')]?.join(
' - '
),
id: [
blockFunction.name ? blockFunction.name.replace('bound ', '') : 'function',
executionTimer?.getStartDate()?.getTime(),
uuidv4()
]?.join('_'),
label: [
(this.nodes?.length ?? 0) + 1,

Check warning on line 191 in src/trace/traceableExecution.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
nodeTraceFromOptions?.id ?? (blockFunction.name ? blockFunction.name.replace('bound ', '') : 'function')
]?.join(' - '),
...nodeTraceFromOptions
};

Expand Down

0 comments on commit 229d3cd

Please sign in to comment.