Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LlamaIndexTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
LlamaIndexTS
Commits
66b6fe51
Commit
66b6fe51
authored
1 year ago
by
Sourabh Desai
Browse files
Options
Downloads
Patches
Plain Diff
fix access() implementation for in memory fs
parent
a7edc4d2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/core/src/storage/FileSystem.ts
+5
-3
5 additions, 3 deletions
packages/core/src/storage/FileSystem.ts
packages/core/src/tests/GenericFileSystem.test.ts
+0
-0
0 additions, 0 deletions
packages/core/src/tests/GenericFileSystem.test.ts
with
5 additions
and
3 deletions
packages/core/src/storage/FileSystem.ts
+
5
−
3
View file @
66b6fe51
...
...
@@ -9,7 +9,7 @@ import _ from "lodash";
export
interface
GenericFileSystem
{
writeFile
(
path
:
string
,
content
:
string
,
options
?:
any
):
Promise
<
void
>
;
readFile
(
path
:
string
,
options
?:
any
):
Promise
<
string
>
;
access
(
path
:
string
):
Promise
<
boolean
>
;
access
(
path
:
string
):
Promise
<
void
>
;
mkdir
(
path
:
string
,
options
?:
any
):
Promise
<
void
>
;
}
...
...
@@ -35,8 +35,10 @@ export class InMemoryFileSystem implements GenericFileSystem {
return
_
.
cloneDeep
(
this
.
files
[
path
]);
}
async
access
(
path
:
string
):
Promise
<
boolean
>
{
return
path
in
this
.
files
;
async
access
(
path
:
string
):
Promise
<
void
>
{
if
(
!
(
path
in
this
.
files
))
{
throw
new
Error
(
`File
${
path
}
does not exist`
);
}
}
async
mkdir
(
path
:
string
,
options
?:
any
):
Promise
<
void
>
{
...
...
This diff is collapsed.
Click to expand it.
packages/core/src/tests/
InMemory
FileSystem.test.ts
→
packages/core/src/tests/
Generic
FileSystem.test.ts
+
0
−
0
View file @
66b6fe51
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment