Skip to content

Commit 9becd74

Browse files
committed
Rename functions to disambiguate two caches
1 parent 60d0b08 commit 9becd74

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/react-fs/src/ReactFilesystem.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function checkPathInDev(path: string) {
9292
}
9393
}
9494

95-
function createAccessCache(): Map<string, Array<number | Record<void>>> {
95+
function createAccessMap(): Map<string, Array<number | Record<void>>> {
9696
return new Map();
9797
}
9898

@@ -101,7 +101,7 @@ export function access(path: string, mode?: number): void {
101101
if (mode == null) {
102102
mode = 0; // fs.constants.F_OK
103103
}
104-
const map = unstable_getCacheForType(createAccessCache);
104+
const map = unstable_getCacheForType(createAccessMap);
105105
let accessCache = map.get(path);
106106
if (!accessCache) {
107107
accessCache = [];
@@ -124,7 +124,7 @@ export function access(path: string, mode?: number): void {
124124
readRecord(record); // No return value.
125125
}
126126

127-
function createLstatCache(): Map<string, Array<boolean | Record<mixed>>> {
127+
function createLstatMap(): Map<string, Array<boolean | Record<mixed>>> {
128128
return new Map();
129129
}
130130

@@ -134,7 +134,7 @@ export function lstat(path: string, options?: {bigint?: boolean}): mixed {
134134
if (options && options.bigint) {
135135
bigint = true;
136136
}
137-
const map = unstable_getCacheForType(createLstatCache);
137+
const map = unstable_getCacheForType(createLstatMap);
138138
let lstatCache = map.get(path);
139139
if (!lstatCache) {
140140
lstatCache = [];
@@ -158,7 +158,7 @@ export function lstat(path: string, options?: {bigint?: boolean}): mixed {
158158
return stats;
159159
}
160160

161-
function createReaddirCache(): Map<
161+
function createReaddirMap(): Map<
162162
string,
163163
Array<string | boolean | Record<mixed>>,
164164
> {
@@ -182,7 +182,7 @@ export function readdir(
182182
withFileTypes = true;
183183
}
184184
}
185-
const map = unstable_getCacheForType(createReaddirCache);
185+
const map = unstable_getCacheForType(createReaddirMap);
186186
let readdirCache = map.get(path);
187187
if (!readdirCache) {
188188
readdirCache = [];
@@ -207,7 +207,7 @@ export function readdir(
207207
return files;
208208
}
209209

210-
function createReadFileCache(): Map<string, Record<Buffer>> {
210+
function createReadFileMap(): Map<string, Record<Buffer>> {
211211
return new Map();
212212
}
213213

@@ -223,7 +223,7 @@ export function readFile(
223223
},
224224
): string | Buffer {
225225
checkPathInDev(path);
226-
const map = unstable_getCacheForType(createReadFileCache);
226+
const map = unstable_getCacheForType(createReadFileMap);
227227
let record = map.get(path);
228228
if (!record) {
229229
const thenable = fs.readFile(path);
@@ -264,7 +264,7 @@ export function readFile(
264264
return text;
265265
}
266266

267-
function createReadlinkCache(): Map<string, Array<string | Record<mixed>>> {
267+
function createReadlinkMap(): Map<string, Array<string | Record<mixed>>> {
268268
return new Map();
269269
}
270270

@@ -281,7 +281,7 @@ export function readlink(
281281
encoding = options.encoding;
282282
}
283283
}
284-
const map = unstable_getCacheForType(createReadlinkCache);
284+
const map = unstable_getCacheForType(createReadlinkMap);
285285
let readlinkCache = map.get(path);
286286
if (!readlinkCache) {
287287
readlinkCache = [];
@@ -305,7 +305,7 @@ export function readlink(
305305
return linkString;
306306
}
307307

308-
function createRealpathCache(): Map<string, Array<string | Record<mixed>>> {
308+
function createRealpathMap(): Map<string, Array<string | Record<mixed>>> {
309309
return new Map();
310310
}
311311

@@ -322,7 +322,7 @@ export function realpath(
322322
encoding = options.encoding;
323323
}
324324
}
325-
const map = unstable_getCacheForType(createRealpathCache);
325+
const map = unstable_getCacheForType(createRealpathMap);
326326
let realpathCache = map.get(path);
327327
if (!realpathCache) {
328328
realpathCache = [];
@@ -346,7 +346,7 @@ export function realpath(
346346
return resolvedPath;
347347
}
348348

349-
function createStatCache(): Map<string, Array<boolean | Record<mixed>>> {
349+
function createStatMap(): Map<string, Array<boolean | Record<mixed>>> {
350350
return new Map();
351351
}
352352

@@ -356,7 +356,7 @@ export function stat(path: string, options?: {bigint?: boolean}): mixed {
356356
if (options && options.bigint) {
357357
bigint = true;
358358
}
359-
const map = unstable_getCacheForType(createStatCache);
359+
const map = unstable_getCacheForType(createStatMap);
360360
let statCache = map.get(path);
361361
if (!statCache) {
362362
statCache = [];

0 commit comments

Comments
 (0)