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";
71
71
72
72
import {
73
73
cleanupFileInformationCache ,
74
+ FileInformationCacheMap ,
74
75
ignoreFieldsForProjectType ,
75
76
normalizeFormatYaml ,
76
77
projectConfigFile ,
@@ -107,16 +108,6 @@ import { createTempContext } from "../core/temp.ts";
107
108
108
109
import { onCleanup } from "../core/cleanup.ts" ;
109
110
import { 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
- }
120
111
121
112
export async function projectContext (
122
113
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";
50
50
import { Zod } from "../resources/types/zod/schema-types.ts" ;
51
51
import { Brand } from "../core/brand/brand.ts" ;
52
52
import { assert } from "testing/asserts" ;
53
+ import { Cloneable } from "../core/safe-clone-deep.ts" ;
53
54
54
55
export function projectExcludeDirs ( context : ProjectContext ) : string [ ] {
55
56
const outputDir = projectOutputDir ( context ) ;
@@ -633,6 +634,15 @@ export async function projectResolveBrand(
633
634
}
634
635
}
635
636
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
+
636
646
export function cleanupFileInformationCache ( project : ProjectContext ) {
637
647
project . fileInformationCache . forEach ( ( entry ) => {
638
648
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";
21
21
import { fileExecutionEngineAndTarget } from "../../../execute/engine.ts" ;
22
22
import {
23
23
cleanupFileInformationCache ,
24
+ FileInformationCacheMap ,
24
25
projectFileMetadata ,
25
26
projectResolveBrand ,
26
27
projectResolveFullMarkdownForFile ,
@@ -49,7 +50,7 @@ export async function singleFileProjectContext(
49
50
notebookContext,
50
51
environment : ( ) => environmentMemoizer ( result ) ,
51
52
renderFormats,
52
- fileInformationCache : new Map ( ) ,
53
+ fileInformationCache : new FileInformationCacheMap ( ) ,
53
54
fileExecutionEngineAndTarget : (
54
55
file : string ,
55
56
) => {
You can’t perform that action at this time.
0 commit comments