Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/actor-memory-expression/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './memory_calculator';
export * from './types';
7 changes: 3 additions & 4 deletions packages/actor-memory-expression/src/memory_calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
compileDependencies,
create,
divideDependencies,
type EvalFunction,
evaluateDependencies,
maxDependencies,
minDependencies,
Expand All @@ -20,7 +19,7 @@ import {

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

import type { ActorRunOptions, CompilationCache, MemoryEvaluationContext } from './types.js';
import type { ActorRunOptions, CompilationCache, CompilationResult, MemoryEvaluationContext } from './types.js';

// In theory, users could create expressions longer than 1000 characters,
// but in practice, it's unlikely anyone would need that much complexity.
Expand Down Expand Up @@ -176,9 +175,9 @@ const processTemplateVariables = (defaultMemoryMbytes: string): string => {
*
* @param expression The expression string to compile.
* @param cache An optional cache to store/retrieve compiled expressions.
* @returns The compiled EvalFunction.
* @returns The compiled CompilationResult.
*/
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<EvalFunction> => {
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<CompilationResult> => {
if (!cache) {
return compile(expression);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/actor-memory-expression/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ export type CompilationCache = {
set: (expression: string, compilationResult: EvalFunction) => Promise<void>;
size: () => Promise<number>;
}

export type CompilationResult = EvalFunction;