Skip to content

Commit

Permalink
use shortcut imports
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Aug 26, 2023
1 parent f72ee16 commit 590e76c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion alt/factory.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { proxify, wrap } from '../lib/poteto.mjs';
export { proxify, wrap } from '#poteto.mjs';
2 changes: 1 addition & 1 deletion alt/internal.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { methods, execute } from '../lib/poteto.mjs';
export { methods, execute } from '#poteto.mjs';
4 changes: 2 additions & 2 deletions alt/polyfill.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ProxyRequest } from '../lib/request.mjs';
import { poteto } from '../lib/poteto.mjs';
import { ProxyRequest } from '#request.mjs';
import { poteto } from '#poteto.mjs';

globalThis.Request = ProxyRequest;
globalThis.fetch = poteto;
4 changes: 2 additions & 2 deletions alt/ponyfill.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { PotetoRequest as Request } from '../lib/request.mjs';
export { ponyfill as fetch, ponyfill as default } from '../lib/poteto.mjs';
export { PotetoRequest as Request } from '#request.mjs';
export { ponyfill as fetch, ponyfill as default } from '#poteto.mjs';
1 change: 0 additions & 1 deletion alt/wrap.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { poteto as default } from './lib/poteto.mjs';
export { poteto as default } from '#poteto.mjs';
10 changes: 5 additions & 5 deletions lib/methods.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import {
getRanges,
preHooks,
statsAsOptions,
} from './http.mjs';
} from '#http.mjs';
import {
STAT_OPTS,
READDIR_OPTS,
} from './constants.mjs';
} from '#constants.mjs';
import {
responseConstructor,
} from './generic.mjs';
} from '#generic.mjs';
import {
validatedBody,
} from './sri.mjs';
} from '#sri.mjs';
import {
readRange,
writeRange,
} from './fs.mjs';
} from '#fs.mjs';

const DELETE = async url =>
fs.rm(url).then(() => genericResponse(204));
Expand Down
4 changes: 2 additions & 2 deletions lib/poteto.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
PotetoRequest,
ProxyRequest,
} from './request.mjs';
} from '#request.mjs';
import {
methods,
execute,
} from './methods.mjs';
} from '#methods.mjs';

// fair proxy
const proxify = $ => new Proxy($, {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.6.0",
"description": "HTTP-alike fetch for FILE protocol, e.g. fetch('file:///usr/bin/node')",
"type": "module",
"imports": {
"#*": "./lib/*"
},
"exports": {
".": "./index.mjs",
"./factory": "./alt/factory.mjs",
Expand Down

0 comments on commit 590e76c

Please sign in to comment.