vitest 0.0.113 → 0.0.117

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.
@@ -1,79 +0,0 @@
1
- import { A as API_PATH } from './constants-900abe4a.js';
2
- import 'url';
3
- import './index-1488b423.js';
4
- import 'path';
5
-
6
- /*! (c) 2020 Andrea Giammarchi */
7
-
8
- const {parse: $parse, stringify: $stringify} = JSON;
9
-
10
- const Primitive = String; // it could be Number
11
- const primitive = 'string'; // it could be 'number'
12
- const object = 'object';
13
-
14
- const noop = (_, value) => value;
15
-
16
- const set = (known, input, value) => {
17
- const index = Primitive(input.push(value) - 1);
18
- known.set(value, index);
19
- return index;
20
- };
21
-
22
- const stringify = (value, replacer, space) => {
23
- const $ = replacer && typeof replacer === object ?
24
- (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
25
- (replacer || noop);
26
- const known = new Map;
27
- const input = [];
28
- const output = [];
29
- let i = +set(known, input, $.call({'': value}, '', value));
30
- let firstRun = !i;
31
- while (i < input.length) {
32
- firstRun = true;
33
- output[i] = $stringify(input[i++], replace, space);
34
- }
35
- return '[' + output.join(',') + ']';
36
- function replace(key, value) {
37
- if (firstRun) {
38
- firstRun = !firstRun;
39
- return value;
40
- }
41
- const after = $.call(this, key, value);
42
- switch (typeof after) {
43
- case object:
44
- if (after === null) return after;
45
- case primitive:
46
- return known.get(after) || set(known, input, after);
47
- }
48
- return after;
49
- }
50
- };
51
-
52
- function sendFlatted(res, data) {
53
- res.setHeader("Content-Type", "application/json");
54
- res.write(stringify(data));
55
- res.statusCode = 200;
56
- res.end();
57
- }
58
- function middlewareAPI(ctx) {
59
- return (req, res, next) => {
60
- var _a;
61
- if (!((_a = req.url) == null ? void 0 : _a.startsWith(API_PATH)))
62
- return next();
63
- const url = req.url.slice(API_PATH.length);
64
- if (url === "/") {
65
- return sendFlatted(res, {
66
- files: ctx.state.filesMap
67
- });
68
- }
69
- if (url === "/files") {
70
- return sendFlatted(res, {
71
- files: Object.keys(ctx.state.filesMap)
72
- });
73
- }
74
- res.statusCode = 404;
75
- res.end();
76
- };
77
- }
78
-
79
- export { middlewareAPI as default, sendFlatted };
@@ -1,10 +0,0 @@
1
- const rpc = async (method, ...args) => {
2
- var _a;
3
- return (_a = process.__vitest_worker__) == null ? void 0 : _a.rpc(method, ...args);
4
- };
5
- const send = async (method, ...args) => {
6
- var _a;
7
- return (_a = process.__vitest_worker__) == null ? void 0 : _a.send(method, ...args);
8
- };
9
-
10
- export { rpc as r, send as s };