browser-ava 2.3.40 → 2.3.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-ava",
3
- "version": "2.3.40",
3
+ "version": "2.3.41",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -0,0 +1 @@
1
+ const isArray=e=>Array.isArray(e),isObject=e=>"Object"===Object.prototype.toString.call(e).slice(8,-1),validate=e=>{if(void 0===e)throw new Error("This method requires one parameter");if(!isArray(e)&&!isObject(e))throw new TypeError("This method only accepts arrays and objects")},isRef=e=>isObject(e)&&e.hasOwnProperty("$ref")&&1===Object.keys(e).length&&!!e.$ref&&"$"===e.$ref.charAt(0),encycle=arg=>{validate(arg);const recurs=value=>isArray(value)||isObject(value)?isArray(value)?value.map((elem,i)=>isRef(elem)?(value[i]=eval("arg"+elem.$ref.slice(1)),value):recurs(elem)):Object.keys(value).reduce((accum,key)=>(accum[key]=isRef(value[key])?eval("arg"+value[key].$ref.slice(1)):recurs(value[key]),accum),value):value;return recurs(arg)},findRef=(e,r)=>Object.keys(r).find(a=>r[a]===e),decycle=e=>{validate(e);let r={};const a=(e,c="$")=>{const s=findRef(e,r);return s?{$ref:s}:isArray(e)||isObject(e)?(r[c]=e,isArray(e)?e.map((e,r)=>a(e,`${c}[${r}]`)):Object.keys(e).reduce((r,s)=>(r[s]=a(e[s],`${c}.${s}`),r),{})):e};return a(e)};export{decycle,encycle};
@@ -1,4 +1,4 @@
1
- import { decycle } from "./node_modules/json-cyclic/dist/index.esm.js";
1
+ import { decycle } from "./json-cyclic.mjs";
2
2
  import { testModules, test } from "./ava.mjs";
3
3
  import {
4
4
  calculateSummary,
@@ -8,7 +8,7 @@ import {
8
8
  } from "./util.mjs";
9
9
  import { isEqual } from "./assertions.mjs";
10
10
 
11
- let ws = new WebSocket(`ws://${location.host}`);
11
+ const ws = new WebSocket(`ws://${location.host}`);
12
12
  ws.onerror = console.error;
13
13
 
14
14
  function primitiveRoString() {
@@ -227,7 +227,6 @@ async function createServer(tests, options) {
227
227
  app.use(Cors({ origin: "*" }));
228
228
 
229
229
  app.use(Static(new URL("./browser", import.meta.url).pathname));
230
- app.use(Static(new URL("..", import.meta.url).pathname));
231
230
 
232
231
  app.on("error", console.error);
233
232