revojs 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http/index.d.ts +1 -1
- package/dist/index.js +44 -2
- package/package.json +1 -1
package/dist/http/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type CookieOptions = {
|
|
|
11
11
|
export type HttpMethod = "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE";
|
|
12
12
|
export type Encoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
|
13
13
|
export type StatusCode = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 450 | 451 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 506 | 507 | 508 | 509 | 510 | 511 | 521 | 522 | 523 | 525 | 530 | 599;
|
|
14
|
-
export type MimeType = "text/css" | "text/
|
|
14
|
+
export type MimeType = "text/plain" | "text/css" | "text/html" | "text/csv" | "text/javascript" | "application/json" | "application/xml" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/x-icon" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/mp4" | "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.microsoft.portable-executable" | "application/vnd.android.package-archive";
|
|
15
15
|
export type Context<T> = {
|
|
16
16
|
inputs: Record<string, string>;
|
|
17
17
|
variables: T;
|
package/dist/index.js
CHANGED
|
@@ -546,9 +546,49 @@ const getMimeType = (file) => {
|
|
|
546
546
|
return mimeTypes[extension ?? ""] ?? "text/plain";
|
|
547
547
|
};
|
|
548
548
|
const mimeTypes = {
|
|
549
|
+
txt: "text/plain",
|
|
549
550
|
css: "text/css",
|
|
551
|
+
html: "text/html",
|
|
552
|
+
htm: "text/html",
|
|
550
553
|
js: "text/javascript",
|
|
551
|
-
|
|
554
|
+
json: "application/json",
|
|
555
|
+
xml: "application/xml",
|
|
556
|
+
csv: "text/csv",
|
|
557
|
+
jpg: "image/jpeg",
|
|
558
|
+
jpeg: "image/jpeg",
|
|
559
|
+
png: "image/png",
|
|
560
|
+
gif: "image/gif",
|
|
561
|
+
webp: "image/webp",
|
|
562
|
+
svg: "image/svg+xml",
|
|
563
|
+
bmp: "image/bmp",
|
|
564
|
+
ico: "image/x-icon",
|
|
565
|
+
ttf: "font/ttf",
|
|
566
|
+
otf: "font/otf",
|
|
567
|
+
woff: "font/woff",
|
|
568
|
+
woff2: "font/woff2",
|
|
569
|
+
mp3: "audio/mpeg",
|
|
570
|
+
wav: "audio/wav",
|
|
571
|
+
ogg: "audio/ogg",
|
|
572
|
+
m4a: "audio/mp4",
|
|
573
|
+
mp4: "video/mp4",
|
|
574
|
+
webm: "video/webm",
|
|
575
|
+
ogv: "video/ogg",
|
|
576
|
+
mov: "video/quicktime",
|
|
577
|
+
avi: "video/x-msvideo",
|
|
578
|
+
zip: "application/zip",
|
|
579
|
+
rar: "application/vnd.rar",
|
|
580
|
+
tar: "application/x-tar",
|
|
581
|
+
gz: "application/gzip",
|
|
582
|
+
"7z": "application/x-7z-compressed",
|
|
583
|
+
pdf: "application/pdf",
|
|
584
|
+
doc: "application/msword",
|
|
585
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
586
|
+
xls: "application/vnd.ms-excel",
|
|
587
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
588
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
589
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
590
|
+
exe: "application/vnd.microsoft.portable-executable",
|
|
591
|
+
apk: "application/vnd.android.package-archive"
|
|
552
592
|
};
|
|
553
593
|
|
|
554
594
|
//#endregion
|
|
@@ -728,7 +768,9 @@ const createRouter = (options) => {
|
|
|
728
768
|
const useRouter = (scope, context) => {
|
|
729
769
|
const { url, route, inputs, navigator } = scope.getContext(context ?? ROUTER_CONTEXT);
|
|
730
770
|
const navigate = (path) => {
|
|
731
|
-
if (isClient())
|
|
771
|
+
if (isClient()) {
|
|
772
|
+
if (window.location.pathname != path) window.history.pushState(window.history.state, "", path);
|
|
773
|
+
}
|
|
732
774
|
navigator.dispatchEvent(new NavigateEvent());
|
|
733
775
|
};
|
|
734
776
|
const anchorNavigate = (event) => {
|