@davidsouther/jiffies 1.0.0-beta.1 → 1.0.0
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/build/components/button_bar.js +24 -13
- package/build/components/select.d.ts +1 -4
- package/build/display.js +9 -1
- package/build/dom/dom.js +1 -0
- package/build/dom/form/form.d.ts +9 -8
- package/build/dom/form/form.js +14 -5
- package/build/dom/provide.d.ts +3 -0
- package/build/dom/provide.js +7 -0
- package/build/equal.d.ts +5 -4
- package/build/equal.js +19 -4
- package/build/fs.d.ts +48 -0
- package/build/fs.js +144 -0
- package/build/{components/index.d.ts → fs.test.d.ts} +0 -0
- package/build/fs.test.js +43 -0
- package/build/log.js +16 -4
- package/build/result.d.ts +11 -11
- package/build/result.js +2 -2
- package/build/scope/execute.js +1 -1
- package/build/scope/expect.d.ts +1 -1
- package/build/scope/expect.js +4 -3
- package/build/server/http/css.d.ts +5 -0
- package/build/server/http/css.js +47 -0
- package/build/server/http/index.js +4 -2
- package/build/server/http/response.js +6 -3
- package/build/test_all.d.ts +7 -1
- package/build/test_all.js +7 -8
- package/package.json +5 -2
- package/src/components/button_bar.ts +32 -26
- package/src/display.ts +8 -2
- package/src/dom/dom.ts +1 -0
- package/src/dom/form/form.ts +30 -7
- package/src/dom/provide.ts +11 -0
- package/src/equal.ts +22 -11
- package/src/fs.test.ts +53 -0
- package/src/fs.ts +180 -0
- package/src/index.html +4 -4
- package/src/log.ts +8 -4
- package/src/pico/_variables.scss +66 -0
- package/src/pico/components/_accordion.scss +112 -0
- package/src/pico/components/_button-group.scss +51 -0
- package/src/pico/components/_card.scss +47 -0
- package/src/pico/components/_dropdown.scss +203 -0
- package/src/pico/components/_modal.scss +181 -0
- package/src/pico/components/_nav.scss +79 -0
- package/src/pico/components/_progress.scss +70 -0
- package/src/pico/components/_property.scss +34 -0
- package/src/pico/content/_button.scss +152 -0
- package/src/pico/content/_code.scss +63 -0
- package/src/pico/content/_embedded.scss +0 -0
- package/src/pico/content/_form-alt.scss +276 -0
- package/src/pico/content/_form.scss +259 -0
- package/src/pico/content/_misc.scss +0 -0
- package/src/pico/content/_table.scss +28 -0
- package/src/pico/content/_toggle.scss +132 -0
- package/src/pico/content/_typography.scss +232 -0
- package/src/pico/layout/_container.scss +40 -0
- package/src/pico/layout/_document.scss +0 -0
- package/src/pico/layout/_flex.scss +46 -0
- package/src/pico/layout/_grid.scss +24 -0
- package/src/pico/layout/_scroller.scss +16 -0
- package/src/pico/layout/_section.scss +8 -0
- package/src/pico/layout/_sectioning.scss +53 -0
- package/src/pico/pico.scss +60 -0
- package/src/pico/reset/_accessibility.scss +34 -0
- package/src/pico/reset/_button.scss +17 -0
- package/src/pico/reset/_code.scss +15 -0
- package/src/pico/reset/_document.scss +48 -0
- package/src/pico/reset/_embedded.scss +39 -0
- package/src/pico/reset/_form.scss +97 -0
- package/src/pico/reset/_misc.scss +23 -0
- package/src/pico/reset/_nav.scss +5 -0
- package/src/pico/reset/_progress.scss +4 -0
- package/src/pico/reset/_table.scss +8 -0
- package/src/pico/reset/_typography.scss +25 -0
- package/src/pico/themes/default/_colors.scss +65 -0
- package/src/pico/themes/default/_dark.scss +148 -0
- package/src/pico/themes/default/_light.scss +149 -0
- package/src/pico/themes/default/_styles.scss +272 -0
- package/src/pico/themes/default.scss +34 -0
- package/src/pico/utilities/_accessibility.scss +3 -0
- package/src/pico/utilities/_loading.scss +52 -0
- package/src/pico/utilities/_reduce-motion.scss +27 -0
- package/src/pico/utilities/_tooltip.scss +101 -0
- package/src/result.ts +16 -20
- package/src/scope/execute.ts +1 -1
- package/src/scope/expect.ts +10 -9
- package/src/server/http/css.ts +63 -0
- package/src/server/http/index.ts +4 -2
- package/src/server/http/response.ts +7 -4
- package/src/test_all.ts +7 -8
- package/src/zip/spec.txt +3260 -0
- package/build/components/index.js +0 -1
- package/build/index.d.ts +0 -13
- package/build/index.js +0 -13
- package/build/parcel_resolver.d.ts +0 -3
- package/build/parcel_resolver.js +0 -19
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@if $enable-transitions and $enable-important {
|
|
2
|
+
/**
|
|
3
|
+
* Reduce Motion Features
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Based on :
|
|
7
|
+
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
|
|
8
|
+
// ––––––––––––––––––––
|
|
9
|
+
|
|
10
|
+
// 1. Remove animations when motion is reduced (opinionated)
|
|
11
|
+
// 2. Remove fixed background attachments when motion is reduced (opinionated)
|
|
12
|
+
// 3. Remove timed scrolling behaviors when motion is reduced (opinionated)
|
|
13
|
+
// 4. Remove transitions when motion is reduced (opinionated)
|
|
14
|
+
@media (prefers-reduced-motion: reduce) {
|
|
15
|
+
*:not([aria-busy="true"]),
|
|
16
|
+
:not([aria-busy="true"])::before,
|
|
17
|
+
:not([aria-busy="true"])::after {
|
|
18
|
+
background-attachment: initial !important; // 2
|
|
19
|
+
animation-duration: 1ms !important; // 1
|
|
20
|
+
animation-delay: -1ms !important; // 1
|
|
21
|
+
animation-iteration-count: 1 !important; // 1
|
|
22
|
+
scroll-behavior: auto !important; // 3
|
|
23
|
+
transition-delay: 0s !important; // 4
|
|
24
|
+
transition-duration: 0s !important; // 4
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
[data-tooltip] {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
&:not(a):not(button):not(input) {
|
|
5
|
+
border-bottom: 1px dotted;
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
cursor: help;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&::before,
|
|
11
|
+
&::after {
|
|
12
|
+
display: block;
|
|
13
|
+
z-index: 99;
|
|
14
|
+
position: absolute;
|
|
15
|
+
bottom: 100%;
|
|
16
|
+
left: 50%;
|
|
17
|
+
padding: 0.25rem 0.5rem;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
transform: translate(-50%, -0.25rem);
|
|
20
|
+
border-radius: var(--border-radius);
|
|
21
|
+
background: var(--tooltip-background-color);
|
|
22
|
+
content: attr(data-tooltip);
|
|
23
|
+
color: var(--tooltip-color);
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: var(--font-weight);
|
|
26
|
+
font-size: 0.875rem;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Caret
|
|
35
|
+
&::after {
|
|
36
|
+
padding: 0;
|
|
37
|
+
transform: translate(-50%, 0rem);
|
|
38
|
+
border-top: 0.3rem solid;
|
|
39
|
+
border-right: 0.3rem solid transparent;
|
|
40
|
+
border-left: 0.3rem solid transparent;
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
content: "";
|
|
44
|
+
color: var(--tooltip-background-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Display
|
|
48
|
+
&:focus,
|
|
49
|
+
&:hover {
|
|
50
|
+
&::before,
|
|
51
|
+
&::after {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Animations, excluding touch devices
|
|
57
|
+
@if $enable-transitions {
|
|
58
|
+
@media (hover: hover) and (pointer: fine) {
|
|
59
|
+
&:focus,
|
|
60
|
+
&:hover {
|
|
61
|
+
&::before,
|
|
62
|
+
&::after {
|
|
63
|
+
animation-duration: 0.2s;
|
|
64
|
+
animation-name: slide;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&::after {
|
|
68
|
+
animation-name: slideCaret;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Animations
|
|
76
|
+
@if $enable-transitions {
|
|
77
|
+
@keyframes slide {
|
|
78
|
+
from {
|
|
79
|
+
transform: translate(-50%, 0.75rem);
|
|
80
|
+
opacity: 0;
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
transform: translate(-50%, -0.25rem);
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@keyframes slideCaret {
|
|
89
|
+
from {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
50% {
|
|
93
|
+
transform: translate(-50%, -0.25rem);
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
to {
|
|
97
|
+
transform: translate(-50%, 0rem);
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/result.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type None = null;
|
|
2
2
|
export type Some<T> = T;
|
|
3
3
|
export type Option<T> = Some<T> | None;
|
|
4
|
-
export type Err<E
|
|
4
|
+
export type Err<E = Error> = {
|
|
5
5
|
err: E;
|
|
6
6
|
map: <U>(fn: (t: unknown) => Result<U>) => Result<U>;
|
|
7
7
|
};
|
|
8
8
|
export type Ok<T> = { ok: T; map: <U>(fn: (t: T) => Result<U>) => Result<U> };
|
|
9
|
-
export type Result<T, E
|
|
9
|
+
export type Result<T, E = Error> = Ok<T> | Err<E>;
|
|
10
10
|
|
|
11
11
|
export const isNone = <T>(s: Option<T>): s is None => s == null;
|
|
12
12
|
export const isSome = <T>(s: Option<T>): s is Some<T> => s != null;
|
|
@@ -21,18 +21,17 @@ export function Some(t: any): any {
|
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const isOk = <T, E
|
|
24
|
+
export const isOk = <T, E>(t: Result<T, E>): t is Ok<T> =>
|
|
25
25
|
(t as Ok<T>).ok !== undefined;
|
|
26
|
-
export const isErr = <T, E
|
|
26
|
+
export const isErr = <T, E>(e: Result<T, E>): e is Err<E> =>
|
|
27
27
|
(e as Err<E>).err !== undefined;
|
|
28
|
-
export const isResult = <T, E
|
|
29
|
-
t
|
|
30
|
-
): t is Result<T, E> => isOk(t) || isErr(t);
|
|
28
|
+
export const isResult = <T, E>(t: Result<T, E>): t is Result<T, E> =>
|
|
29
|
+
isOk(t) || isErr(t);
|
|
31
30
|
|
|
32
31
|
// Beware: Order matters for correct inference.
|
|
33
32
|
export function Ok<T>(ok: Ok<T>): T;
|
|
34
33
|
export function Ok<T>(t: T): Ok<T>;
|
|
35
|
-
export function Ok<T, E
|
|
34
|
+
export function Ok<T, E>(t: any): any {
|
|
36
35
|
return t.ok
|
|
37
36
|
? t.ok
|
|
38
37
|
: {
|
|
@@ -44,21 +43,21 @@ export function Ok<T, E extends Error>(t: any): any {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
// Beware: Order matters for correct inference.
|
|
47
|
-
export function Err<E
|
|
48
|
-
export function Err<E
|
|
49
|
-
export function Err<E
|
|
50
|
-
export function Err<T, E
|
|
46
|
+
export function Err<E>(e: Err<E>): E;
|
|
47
|
+
export function Err<E>(e: E): Err<E>;
|
|
48
|
+
export function Err<E>(e: string): Err<E>;
|
|
49
|
+
export function Err<T, E>(e: any): any {
|
|
51
50
|
return (
|
|
52
51
|
e.err ?? {
|
|
53
|
-
err:
|
|
54
|
-
map<U>(this: Result<T, E>,
|
|
52
|
+
err: e,
|
|
53
|
+
map<U>(this: Result<T, E>, _fn: (t: unknown) => Result<U>): Result<U, E> {
|
|
55
54
|
return this as Result<U, E>;
|
|
56
55
|
},
|
|
57
56
|
}
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
export function unwrap<T, E
|
|
60
|
+
export function unwrap<T, E>(result: Result<T, E>): T | never;
|
|
62
61
|
export function unwrap<O>(some: Option<O>): O | never;
|
|
63
62
|
export function unwrap(t: any): any {
|
|
64
63
|
if (isNone(t)) {
|
|
@@ -73,7 +72,7 @@ export function unwrap(t: any): any {
|
|
|
73
72
|
return t;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
export function unwrapOr<T, E
|
|
75
|
+
export function unwrapOr<T, E>(result: Result<T, E>, def: T): T;
|
|
77
76
|
export function unwrapOr<T>(some: Some<T>, def: T): T;
|
|
78
77
|
export function unwrapOr(t: any, def: any): any {
|
|
79
78
|
if (isNone(t)) {
|
|
@@ -88,10 +87,7 @@ export function unwrapOr(t: any, def: any): any {
|
|
|
88
87
|
return t;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
export function unwrapOrElse<T, E
|
|
92
|
-
result: Result<T, Error>,
|
|
93
|
-
def: () => T
|
|
94
|
-
): T;
|
|
90
|
+
export function unwrapOrElse<T, E>(result: Result<T, Error>, def: () => T): T;
|
|
95
91
|
export function unwrapOrElse<T>(some: Some<T>, def: () => T): T;
|
|
96
92
|
export function unwrapOrElse(t: any, def: any): any {
|
|
97
93
|
if (isNone(t)) {
|
package/src/scope/execute.ts
CHANGED
|
@@ -87,7 +87,7 @@ function makeResult(
|
|
|
87
87
|
stats: { executed: 1, failed: 1 },
|
|
88
88
|
},
|
|
89
89
|
];
|
|
90
|
-
if ((result as TestPassed).passed) {
|
|
90
|
+
if ((result as TestPassed).passed === true) {
|
|
91
91
|
return [{ test, stats: { executed: 1, failed: 0 } }];
|
|
92
92
|
}
|
|
93
93
|
return flattenResults(result as TestResult, test);
|
package/src/scope/expect.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
|
+
import { display } from "../display.js";
|
|
2
3
|
import { equals } from "../equal.js";
|
|
3
4
|
|
|
4
5
|
export class Matcher<T> {
|
|
@@ -15,13 +16,13 @@ export class Matcher<T> {
|
|
|
15
16
|
assert(this.actual === expected, () => `${this.actual} !== ${expected}`);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
toEqual(expected: T) {
|
|
19
|
+
toEqual(expected: T, partial = false) {
|
|
19
20
|
assert(
|
|
20
|
-
equals(this.actual, expected),
|
|
21
|
+
equals(this.actual, expected, partial),
|
|
21
22
|
() =>
|
|
22
|
-
`Objects are not equivalent: ${
|
|
23
|
-
|
|
24
|
-
)}
|
|
23
|
+
`Objects are not equivalent: ${display(this.actual)}, ${display(
|
|
24
|
+
expected
|
|
25
|
+
)}`
|
|
25
26
|
);
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -50,11 +51,11 @@ export class Matcher<T> {
|
|
|
50
51
|
// @ts-expect-error
|
|
51
52
|
const actual: Partial<T> = this.actual[k];
|
|
52
53
|
assert(
|
|
53
|
-
equals(actual, v),
|
|
54
|
+
equals(actual, v, true),
|
|
54
55
|
() =>
|
|
55
|
-
`Comparing ${k}, properties not equal: ${
|
|
56
|
-
|
|
57
|
-
)}
|
|
56
|
+
`Comparing ${k}, properties not equal: ${display(actual)}, ${display(
|
|
57
|
+
v
|
|
58
|
+
)}`
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { contentResponse } from "./response.js";
|
|
4
|
+
import { MiddlewareFactory } from "./index.js";
|
|
5
|
+
import sass from "sass";
|
|
6
|
+
import { error, info } from "../../log.js";
|
|
7
|
+
const { compileStringAsync } = sass;
|
|
8
|
+
|
|
9
|
+
function render(source: string) {
|
|
10
|
+
// Replace `from "@scope` with `from "/@scope`, for browsers
|
|
11
|
+
// source = source
|
|
12
|
+
// .replaceAll(`from "@`, 'from "/@')
|
|
13
|
+
// .replaceAll(`import("@`, 'import("/@');
|
|
14
|
+
return contentResponse(source, "text/css");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function compile(
|
|
18
|
+
filename: string,
|
|
19
|
+
root: string,
|
|
20
|
+
vars: string
|
|
21
|
+
): Promise<string> {
|
|
22
|
+
vars = vars.substring(1).replaceAll("=", ":");
|
|
23
|
+
const sassString = `// Using variables: ${vars}\n${vars};\n@import "${filename}";`;
|
|
24
|
+
return (await compileStringAsync(sassString, { loadPaths: [root] })).css;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Serves .css files statically. Finds .sass files and transpiles them to css.
|
|
29
|
+
*/
|
|
30
|
+
export const cssFileServer: MiddlewareFactory =
|
|
31
|
+
async ({ root, scopes = {} }) =>
|
|
32
|
+
async (req) => {
|
|
33
|
+
const Url = new URL(req.url ?? "/", `http://${req.headers.host}`);
|
|
34
|
+
if (Url.pathname.endsWith(".css")) {
|
|
35
|
+
let scope = Object.entries(scopes).find(([s]) =>
|
|
36
|
+
Url.pathname.startsWith(`/${s}`)
|
|
37
|
+
);
|
|
38
|
+
// Expand url with found scope
|
|
39
|
+
let url = scope ? Url.pathname.replace(scope[0], scope[1]) : Url.pathname;
|
|
40
|
+
let filename = path.join(root, url);
|
|
41
|
+
try {
|
|
42
|
+
const stat = await fs.stat(filename);
|
|
43
|
+
if (stat.isFile()) {
|
|
44
|
+
const css = (await fs.readFile(filename)).toString("utf-8");
|
|
45
|
+
return render(css);
|
|
46
|
+
}
|
|
47
|
+
} catch {}
|
|
48
|
+
|
|
49
|
+
filename = filename.replace(/\.css$/, ".scss");
|
|
50
|
+
try {
|
|
51
|
+
const stat = await fs.stat(filename);
|
|
52
|
+
if (stat.isFile()) {
|
|
53
|
+
const css = await compile(
|
|
54
|
+
filename.replace(root, "."),
|
|
55
|
+
root,
|
|
56
|
+
Url.search
|
|
57
|
+
);
|
|
58
|
+
return render(css);
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
};
|
package/src/server/http/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { AddressInfo } from "net";
|
|
|
10
10
|
import * as path from "path";
|
|
11
11
|
import { info } from "../../log.js";
|
|
12
12
|
import { findIndex } from "./apps.js";
|
|
13
|
+
import { cssFileServer } from "./css.js";
|
|
13
14
|
import { fileResponse } from "./response.js";
|
|
14
15
|
import { sitemap } from "./sitemap.js";
|
|
15
16
|
import { staticFileServer } from "./static.js";
|
|
@@ -48,6 +49,7 @@ const notFound: MiddlewareFactory =
|
|
|
48
49
|
const BASE_MIDDLEWARES: MiddlewareFactory[] = [
|
|
49
50
|
sitemap,
|
|
50
51
|
tsFileServer,
|
|
52
|
+
cssFileServer,
|
|
51
53
|
staticFileServer,
|
|
52
54
|
findIndex,
|
|
53
55
|
notFound,
|
|
@@ -65,8 +67,8 @@ const sendContent = async (
|
|
|
65
67
|
res: ServerResponse,
|
|
66
68
|
{ content, contentType, contentLength }: StaticResponse
|
|
67
69
|
) => {
|
|
68
|
-
res.setHeader("
|
|
69
|
-
res.setHeader("
|
|
70
|
+
res.setHeader("Content-Length", `${contentLength}`);
|
|
71
|
+
res.setHeader("Content-Type", contentType);
|
|
70
72
|
await res.write(content);
|
|
71
73
|
res.end();
|
|
72
74
|
return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stats } from "fs";
|
|
2
2
|
import * as fs from "fs/promises";
|
|
3
|
-
import {
|
|
3
|
+
import { StaticResponse } from ".";
|
|
4
4
|
|
|
5
5
|
const MIME_TYPES: Record<string, string> = {
|
|
6
6
|
js: "text/javascript",
|
|
@@ -18,7 +18,9 @@ const MIME_TYPES: Record<string, string> = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const mime = (basename: string) => {
|
|
21
|
-
const extension = basename
|
|
21
|
+
const extension = basename
|
|
22
|
+
.substring(basename.lastIndexOf(".") + 1)
|
|
23
|
+
.toLowerCase();
|
|
22
24
|
return MIME_TYPES[extension] ?? "application/octet-stream";
|
|
23
25
|
};
|
|
24
26
|
|
|
@@ -34,13 +36,14 @@ export const fileResponse =
|
|
|
34
36
|
return { status, contentType, contentLength, content };
|
|
35
37
|
};
|
|
36
38
|
|
|
39
|
+
const CHARSET = "utf-8";
|
|
37
40
|
export const contentResponse =
|
|
38
41
|
(content: string, contentType: string, status: 200 | 404 | 500 = 200) =>
|
|
39
42
|
async (): Promise<StaticResponse> => {
|
|
40
|
-
const contentBuffer = Buffer.from(content,
|
|
43
|
+
const contentBuffer = Buffer.from(content, CHARSET);
|
|
41
44
|
return {
|
|
42
45
|
content: contentBuffer,
|
|
43
|
-
contentType,
|
|
46
|
+
contentType: contentType.split(";")[0] + "; charset=" + CHARSET,
|
|
44
47
|
status,
|
|
45
48
|
contentLength: contentBuffer.length,
|
|
46
49
|
};
|
package/src/test_all.ts
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// discarded during transpilation.
|
|
3
3
|
import { describe, expect, it } from "./scope/index.js";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
]);
|
|
5
|
+
import "./context.test.js";
|
|
6
|
+
import "./equal.test.js";
|
|
7
|
+
import "./flags.test.js";
|
|
8
|
+
import "./fs.test.js";
|
|
9
|
+
import "./generator.test.js";
|
|
10
|
+
import "./lock.test.js";
|
|
11
|
+
import "./result.test.js";
|
|
13
12
|
|
|
14
13
|
describe("Test executor", () => {
|
|
15
14
|
it("matches equality", () => {
|