Skip to content

Commit 3ec38dc

Browse files
committed
refactor: clean up
1 parent 265fdba commit 3ec38dc

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/actor-memory-expression/src/memory_calculator.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
compileDependencies,
66
create,
77
divideDependencies,
8-
type EvalFunction,
98
evaluateDependencies,
109
maxDependencies,
1110
minDependencies,
@@ -20,10 +19,7 @@ import {
2019

2120
import { ACTOR_LIMITS } from '@apify/consts';
2221

23-
import type { ActorRunOptions, CompilationCache, MemoryEvaluationContext } from './types.js';
24-
25-
// Re-export EvalFunction type for external usage.
26-
export type { EvalFunction };
22+
import type { ActorRunOptions, CompilationCache, CompilationResult, MemoryEvaluationContext } from './types.js';
2723

2824
// In theory, users could create expressions longer than 1000 characters,
2925
// but in practice, it's unlikely anyone would need that much complexity.
@@ -179,9 +175,9 @@ const processTemplateVariables = (defaultMemoryMbytes: string): string => {
179175
*
180176
* @param expression The expression string to compile.
181177
* @param cache An optional cache to store/retrieve compiled expressions.
182-
* @returns The compiled EvalFunction.
178+
* @returns The compiled CompilationResult.
183179
*/
184-
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<EvalFunction> => {
180+
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<CompilationResult> => {
185181
if (!cache) {
186182
return compile(expression);
187183
}

packages/actor-memory-expression/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ export type CompilationCache = {
2020
set: (expression: string, compilationResult: EvalFunction) => Promise<void>;
2121
size: () => Promise<number>;
2222
}
23+
24+
export type CompilationResult = EvalFunction;

0 commit comments

Comments
 (0)