socket-function 0.10.5 → 0.10.6
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/SocketFunction.ts
CHANGED
package/package.json
CHANGED
|
@@ -277,6 +277,7 @@ class RequireControllerBase {
|
|
|
277
277
|
modules: Object.entries(result.modules).map(x => [x[0], {
|
|
278
278
|
filename: x[1].filename,
|
|
279
279
|
version: x[1].version,
|
|
280
|
+
sourceLength: x[1].source?.length,
|
|
280
281
|
}]),
|
|
281
282
|
};
|
|
282
283
|
let key = sha256Hash(JSON.stringify(simplifiedResult));
|
package/src/callHTTPHandler.ts
CHANGED
|
@@ -166,7 +166,7 @@ export async function httpCallHandler(request: http.IncomingMessage, response: h
|
|
|
166
166
|
|
|
167
167
|
// NOTE: Our ETag caching is only to reduce data sent on the wire, we evaluate the calls
|
|
168
168
|
// every time (so it is strictly a wire cache for HTTP, not a computation cache)
|
|
169
|
-
if (SocketFunction.
|
|
169
|
+
if (SocketFunction.HTTP_ETAG_CACHE) {
|
|
170
170
|
response.setHeader("cache-control", "private, max-age=0, must-revalidate");
|
|
171
171
|
let hash = sha256Hash(resultBuffer);
|
|
172
172
|
response.setHeader("ETag", hash);
|
|
@@ -5,14 +5,16 @@ function ansiHSL(h: number, s: number, l: number, text: string): string {
|
|
|
5
5
|
return ansiRGB(r, g, b, text);
|
|
6
6
|
}
|
|
7
7
|
function ansiRGB(r: number, g: number, b: number, text: string): string {
|
|
8
|
-
return `\x1b[38;2;${r};${g};${b}m${text}\x1b[
|
|
8
|
+
return `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m`;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const lightness = 68;
|
|
12
|
-
export const blue =
|
|
12
|
+
export const blue = (text: string) => `\x1b[34m${text}\x1b[0m`;
|
|
13
13
|
export const red = ansiHSL.bind(null, 0, 100, lightness);
|
|
14
|
-
export const green = (text: string) => `\x1b[32m${text}\x1b[
|
|
15
|
-
export const yellow = (text: string) => `\x1b[33m${text}\x1b[
|
|
14
|
+
export const green = (text: string) => `\x1b[32m${text}\x1b[0m`;
|
|
15
|
+
export const yellow = (text: string) => `\x1b[33m${text}\x1b[0m`;
|
|
16
16
|
export const white = ansiHSL.bind(null, 0, 0, 80);
|
|
17
17
|
|
|
18
|
-
export const magenta = (text: string) => `\x1b[35m${text}\x1b[
|
|
18
|
+
export const magenta = (text: string) => `\x1b[35m${text}\x1b[0m`;
|
|
19
|
+
|
|
20
|
+
console.log(blue('blue'));
|