Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
ricsam committed Dec 16, 2024
1 parent dfba48b commit ae4fc5a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# nafs

## 0.1.2

### Patch Changes

- update types

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nafs",
"version": "0.1.1",
"version": "0.1.2",
"description": "Node Active FS - nafs. File system abstraction to read/write files to AWS S3 or local directory. Includes middleware for usage with express.",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
Expand Down
13 changes: 6 additions & 7 deletions src/nafs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ export async function nafs(
*/
export async function nafs(uri: ':memory:'): Promise<import('memfs').IFs>;
export async function nafs(
uri: `${proto}://${string}` | ':memory:'
uri: string
): Promise<import('memfs').IFs | typeof import('./backends/s3/s3fs').S3Fs> {
if (uri === ':memory:') {
const { createMemFs } = await import('./backends/local/memory');
return createMemFs();
}

const parsed = parseUri(uri);
const parsed = parseUri(uri as any);

switch (parsed.proto) {
case 'memory': {
const { createMemFs } = await import('./backends/local/memory');
return createMemFs();
}
case 'file': {
const { createFileFs } = await import('./backends/local/file');
const lfs = createFileFs(parsed.uri);
Expand Down

0 comments on commit ae4fc5a

Please sign in to comment.