File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ import { projectResourceFiles } from "./project-resources.ts";
7171
7272import {
7373 cleanupFileInformationCache ,
74+ FileInformationCacheMap ,
7475 ignoreFieldsForProjectType ,
7576 normalizeFormatYaml ,
7677 projectConfigFile ,
@@ -107,16 +108,6 @@ import { createTempContext } from "../core/temp.ts";
107108
108109import { onCleanup } from "../core/cleanup.ts" ;
109110import { once } from "../core/once.ts" ;
110- import { Cloneable } from "../core/safe-clone-deep.ts" ;
111-
112- // Create a class that extends Map and implements Cloneable
113- class FileInformationCacheMap extends Map < string , FileInformation >
114- implements Cloneable < Map < string , FileInformation > > {
115- clone ( ) : Map < string , FileInformation > {
116- // Return the same instance (reference) instead of creating a clone
117- return this ;
118- }
119- }
120111
121112export async function projectContext (
122113 path : string ,
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import { refSchema } from "../core/lib/yaml-schema/common.ts";
5050import { Zod } from "../resources/types/zod/schema-types.ts" ;
5151import { Brand } from "../core/brand/brand.ts" ;
5252import { assert } from "testing/asserts" ;
53+ import { Cloneable } from "../core/safe-clone-deep.ts" ;
5354
5455export function projectExcludeDirs ( context : ProjectContext ) : string [ ] {
5556 const outputDir = projectOutputDir ( context ) ;
@@ -633,6 +634,15 @@ export async function projectResolveBrand(
633634 }
634635}
635636
637+ // Create a class that extends Map and implements Cloneable
638+ export class FileInformationCacheMap extends Map < string , FileInformation >
639+ implements Cloneable < Map < string , FileInformation > > {
640+ clone ( ) : Map < string , FileInformation > {
641+ // Return the same instance (reference) instead of creating a clone
642+ return this ;
643+ }
644+ }
645+
636646export function cleanupFileInformationCache ( project : ProjectContext ) {
637647 project . fileInformationCache . forEach ( ( entry ) => {
638648 if ( entry ?. target ?. data ) {
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { MappedString } from "../../../core/mapped-text.ts";
2121import { fileExecutionEngineAndTarget } from "../../../execute/engine.ts" ;
2222import {
2323 cleanupFileInformationCache ,
24+ FileInformationCacheMap ,
2425 projectFileMetadata ,
2526 projectResolveBrand ,
2627 projectResolveFullMarkdownForFile ,
@@ -49,7 +50,7 @@ export async function singleFileProjectContext(
4950 notebookContext,
5051 environment : ( ) => environmentMemoizer ( result ) ,
5152 renderFormats,
52- fileInformationCache : new Map ( ) ,
53+ fileInformationCache : new FileInformationCacheMap ( ) ,
5354 fileExecutionEngineAndTarget : (
5455 file : string ,
5556 ) => {
You can’t perform that action at this time.
0 commit comments