@wp-playground/blueprints 0.5.1 → 0.5.2

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.
Files changed (3) hide show
  1. package/index.cjs +10 -10
  2. package/index.js +91 -90
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -7,7 +7,7 @@ var H = (t, e, r) => (dn(t, e, "read from private field"), r ? r.call(t) : e.get
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  e instanceof WeakSet ? e.add(t) : e.set(t, r);
9
9
  }, pe = (t, e, r, n) => (dn(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r);
10
- var $e = (t, e, r) => (dn(t, e, "access private method"), r);
10
+ var _e = (t, e, r) => (dn(t, e, "access private method"), r);
11
11
  if (typeof File > "u") {
12
12
  class t extends Blob {
13
13
  constructor(r, n, s) {
@@ -737,7 +737,7 @@ class Tn {
737
737
  }
738
738
  }
739
739
  }
740
- function we(...t) {
740
+ function ye(...t) {
741
741
  let e = t.join("/");
742
742
  const r = e[0] === "/", n = e.substring(e.length - 1) === "/";
743
743
  return e = hi(e), !e && !r && (e = "."), e && n && (e += "/"), e;
@@ -887,36 +887,36 @@ const On = async (t, { zipPath: e, extractToPath: r }) => {
887
887
  new Uint8Array(await e.arrayBuffer())
888
888
  );
889
889
  const s = await t.documentRoot;
890
- let i = we("/tmp", "import");
891
- await t.mkdir(i), await On(t, { zipPath: n, extractToPath: i }), await t.unlink(n), i = we(i, r);
892
- const a = we(i, "wp-content"), l = we(s, "wp-content");
890
+ let i = ye("/tmp", "import");
891
+ await t.mkdir(i), await On(t, { zipPath: n, extractToPath: i }), await t.unlink(n), i = ye(i, r);
892
+ const a = ye(i, "wp-content"), l = ye(s, "wp-content");
893
893
  for (const y of ci) {
894
- const R = we(
894
+ const R = ye(
895
895
  a,
896
896
  y
897
897
  );
898
898
  await Cs(t, R);
899
- const O = we(l, y);
899
+ const O = ye(l, y);
900
900
  await t.fileExists(O) && (await t.mkdir(Lo(R)), await t.mv(O, R));
901
901
  }
902
- const p = we(
902
+ const p = ye(
903
903
  i,
904
904
  "wp-content",
905
905
  "database"
906
906
  );
907
907
  await t.fileExists(p) || await t.mv(
908
- we(s, "wp-content", "database"),
908
+ ye(s, "wp-content", "database"),
909
909
  p
910
910
  );
911
911
  const u = await t.listFiles(i);
912
912
  for (const y of u)
913
- await Cs(t, we(s, y)), await t.mv(
914
- we(i, y),
915
- we(s, y)
913
+ await Cs(t, ye(s, y)), await t.mv(
914
+ ye(i, y),
915
+ ye(s, y)
916
916
  );
917
917
  await t.rmdir(i);
918
918
  const f = mr(
919
- we(s, "wp-admin", "upgrade.php")
919
+ ye(s, "wp-admin", "upgrade.php")
920
920
  );
921
921
  await t.run({
922
922
  code: `<?php
@@ -941,31 +941,32 @@ async function ra(t) {
941
941
  return new File([e.bytes], "export.wxz");
942
942
  }
943
943
  async function yi(t, { targetPath: e, zipFile: r }) {
944
- const n = r.name, s = n.replace(/\.zip$/, ""), i = `/tmp/assets/${s}`, a = `/tmp/${n}`, l = () => t.rmdir(i, {
944
+ const n = r.name, s = n.replace(/\.zip$/, ""), i = ye(await t.documentRoot, "wp-content"), a = ye(i, crypto.randomUUID()), l = ye(a, n), p = ye(a, "assets", s);
945
+ await t.fileExists(p) && await t.rmdir(a, {
945
946
  recursive: !0
946
- });
947
- await t.fileExists(i) && await l(), await mi(t, {
948
- path: a,
947
+ }), await t.mkdir(a), await mi(t, {
948
+ path: l,
949
949
  data: r
950
950
  });
951
- const p = () => Promise.all([l, () => t.unlink(a)]);
952
951
  try {
953
952
  await On(t, {
954
- zipPath: a,
955
- extractToPath: i
953
+ zipPath: l,
954
+ extractToPath: p
956
955
  });
957
- const u = await t.listFiles(i, {
956
+ const u = await t.listFiles(p, {
958
957
  prependPath: !0
959
958
  }), f = u.length === 1 && await t.isDir(u[0]);
960
959
  let y, R = "";
961
- f ? (R = u[0], y = u[0].split("/").pop()) : (R = i, y = s);
960
+ f ? (R = u[0], y = u[0].split("/").pop()) : (R = p, y = s);
962
961
  const O = `${e}/${y}`;
963
- return await t.mv(R, O), await p(), {
962
+ return await t.mv(R, O), {
964
963
  assetFolderPath: O,
965
964
  assetFolderName: y
966
965
  };
967
- } catch (u) {
968
- throw await p(), u;
966
+ } finally {
967
+ await t.rmdir(a, {
968
+ recursive: !0
969
+ });
969
970
  }
970
971
  }
971
972
  const na = async (t, { pluginZipFile: e, options: r = {} }, n) => {
@@ -1075,7 +1076,7 @@ async function gi(t) {
1075
1076
  throw console.log(t), new Error(`Failed to run code: ${t.text} ${t.errors}`);
1076
1077
  }
1077
1078
  const ua = async (t, { selfContained: e = !1 } = {}) => {
1078
- const r = "/tmp/wordpress-playground.zip", n = await t.documentRoot, s = we(n, "wp-content");
1079
+ const r = "/tmp/wordpress-playground.zip", n = await t.documentRoot, s = ye(n, "wp-content");
1079
1080
  let i = ci;
1080
1081
  e && (i = i.filter((p) => !p.startsWith("themes/twenty")).filter((p) => p !== "plugins/sqlite-database-integration"));
1081
1082
  const a = Rn({
@@ -1083,10 +1084,10 @@ const ua = async (t, { selfContained: e = !1 } = {}) => {
1083
1084
  wpContentPath: s,
1084
1085
  documentRoot: n,
1085
1086
  exceptPaths: i.map(
1086
- (p) => we(n, "wp-content", p)
1087
+ (p) => ye(n, "wp-content", p)
1087
1088
  ),
1088
1089
  additionalPaths: e ? {
1089
- [we(n, "wp-config.php")]: "wp-config.php"
1090
+ [ye(n, "wp-config.php")]: "wp-config.php"
1090
1091
  } : {}
1091
1092
  });
1092
1093
  await li(
@@ -1726,7 +1727,7 @@ class Oa {
1726
1727
  n.pathname,
1727
1728
  H(this, xe)
1728
1729
  ), i = `${H(this, We)}${s}`;
1729
- return ka(i) ? await $e(this, Wr, wi).call(this, e, n) : $e(this, Vr, vi).call(this, i);
1730
+ return ka(i) ? await _e(this, Wr, wi).call(this, e, n) : _e(this, Vr, vi).call(this, i);
1730
1731
  }
1731
1732
  }
1732
1733
  We = new WeakMap(), Lt = new WeakMap(), gr = new WeakMap(), $t = new WeakMap(), zt = new WeakMap(), xe = new WeakMap(), Ht = new WeakMap(), Vt = new WeakMap(), Vr = new WeakSet(), vi = function(e) {
@@ -1788,7 +1789,7 @@ We = new WeakMap(), Lt = new WeakMap(), gr = new WeakMap(), $t = new WeakMap(),
1788
1789
  ).toString()) : p = e.body;
1789
1790
  let u;
1790
1791
  try {
1791
- u = $e(this, xr, bi).call(this, r.pathname);
1792
+ u = _e(this, xr, bi).call(this, r.pathname);
1792
1793
  } catch {
1793
1794
  return new qt(
1794
1795
  404,
@@ -1996,7 +1997,7 @@ var Fa = Object.defineProperty, qa = Object.getOwnPropertyDescriptor, Fe = (t, e
1996
1997
  (a = t[i]) && (s = (n ? a(e, r, s) : a(s)) || s);
1997
1998
  return n && s && Fa(e, r, s), s;
1998
1999
  };
1999
- const _e = "string", It = "number", te = Symbol("__private__dont__use");
2000
+ const ve = "string", It = "number", te = Symbol("__private__dont__use");
2000
2001
  var _t, nt, vt, st, Ye, Wt, $r, Br, Pi, Kr, Ei, Gr, Si, Jr, Ti, Yr, Ri, Zr, Oi, Qr, Ni, Xr, Ci, en, ki, tn, ji, rn, Ii, nn, Ai;
2001
2002
  class qe {
2002
2003
  /**
@@ -2124,12 +2125,12 @@ class qe {
2124
2125
  async run(e) {
2125
2126
  const r = await H(this, $r).acquire();
2126
2127
  try {
2127
- H(this, nt) || ($e(this, Br, Pi).call(this), pe(this, nt, !0)), $e(this, Xr, Ci).call(this, e.scriptPath || ""), $e(this, Gr, Si).call(this, e.relativeUri || ""), $e(this, Yr, Ri).call(this, e.method || "GET");
2128
+ H(this, nt) || (_e(this, Br, Pi).call(this), pe(this, nt, !0)), _e(this, Xr, Ci).call(this, e.scriptPath || ""), _e(this, Gr, Si).call(this, e.relativeUri || ""), _e(this, Yr, Ri).call(this, e.method || "GET");
2128
2129
  const n = Di(e.headers || {}), s = n.host || "example.com:443";
2129
- if ($e(this, Jr, Ti).call(this, s, e.protocol || "http"), $e(this, Zr, Oi).call(this, n), e.body && $e(this, Qr, Ni).call(this, e.body), e.fileInfos)
2130
+ if (_e(this, Jr, Ti).call(this, s, e.protocol || "http"), _e(this, Zr, Oi).call(this, n), e.body && _e(this, Qr, Ni).call(this, e.body), e.fileInfos)
2130
2131
  for (const i of e.fileInfos)
2131
- $e(this, tn, ji).call(this, i);
2132
- return e.code && $e(this, rn, Ii).call(this, " ?>" + e.code), $e(this, en, ki).call(this), await $e(this, nn, Ai).call(this);
2132
+ _e(this, tn, ji).call(this, i);
2133
+ return e.code && _e(this, rn, Ii).call(this, " ?>" + e.code), _e(this, en, ki).call(this), await _e(this, nn, Ai).call(this);
2133
2134
  } finally {
2134
2135
  r(), this.dispatchEvent({
2135
2136
  type: "request.end"
@@ -2234,7 +2235,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2234
2235
  this[te].ccall(
2235
2236
  "wasm_set_phpini_entries",
2236
2237
  null,
2237
- [_e],
2238
+ [ve],
2238
2239
  [e]
2239
2240
  );
2240
2241
  }
@@ -2260,14 +2261,14 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2260
2261
  if (this[te].ccall(
2261
2262
  "wasm_set_request_uri",
2262
2263
  null,
2263
- [_e],
2264
+ [ve],
2264
2265
  [e]
2265
2266
  ), e.includes("?")) {
2266
2267
  const r = e.substring(e.indexOf("?") + 1);
2267
2268
  this[te].ccall(
2268
2269
  "wasm_set_query_string",
2269
2270
  null,
2270
- [_e],
2271
+ [ve],
2271
2272
  [r]
2272
2273
  );
2273
2274
  }
@@ -2275,7 +2276,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2275
2276
  this[te].ccall(
2276
2277
  "wasm_set_request_host",
2277
2278
  null,
2278
- [_e],
2279
+ [ve],
2279
2280
  [e]
2280
2281
  );
2281
2282
  let n;
@@ -2293,19 +2294,19 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2293
2294
  this[te].ccall(
2294
2295
  "wasm_set_request_method",
2295
2296
  null,
2296
- [_e],
2297
+ [ve],
2297
2298
  [e]
2298
2299
  );
2299
2300
  }, Zr = new WeakSet(), Oi = function(e) {
2300
2301
  e.cookie && this[te].ccall(
2301
2302
  "wasm_set_cookies",
2302
2303
  null,
2303
- [_e],
2304
+ [ve],
2304
2305
  [e.cookie]
2305
2306
  ), e["content-type"] && this[te].ccall(
2306
2307
  "wasm_set_content_type",
2307
2308
  null,
2308
- [_e],
2309
+ [ve],
2309
2310
  [e["content-type"]]
2310
2311
  ), e["content-length"] && this[te].ccall(
2311
2312
  "wasm_set_content_length",
@@ -2324,7 +2325,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2324
2325
  this[te].ccall(
2325
2326
  "wasm_set_request_body",
2326
2327
  null,
2327
- [_e],
2328
+ [ve],
2328
2329
  [e]
2329
2330
  ), this[te].ccall(
2330
2331
  "wasm_set_content_length",
@@ -2336,7 +2337,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2336
2337
  this[te].ccall(
2337
2338
  "wasm_set_path_translated",
2338
2339
  null,
2339
- [_e],
2340
+ [ve],
2340
2341
  [e]
2341
2342
  );
2342
2343
  }, en = new WeakSet(), ki = function() {
@@ -2344,7 +2345,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2344
2345
  this[te].ccall(
2345
2346
  "wasm_add_SERVER_entry",
2346
2347
  null,
2347
- [_e, _e],
2348
+ [ve, ve],
2348
2349
  [e, H(this, st)[e]]
2349
2350
  );
2350
2351
  }, tn = new WeakSet(), ji = function(e) {
@@ -2354,14 +2355,14 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2354
2355
  this[te].ccall(
2355
2356
  "wasm_add_uploaded_file",
2356
2357
  null,
2357
- [_e, _e, _e, _e, It, It],
2358
+ [ve, ve, ve, ve, It, It],
2358
2359
  [r, n, s, a, l, i.byteLength]
2359
2360
  );
2360
2361
  }, rn = new WeakSet(), Ii = function(e) {
2361
2362
  this[te].ccall(
2362
2363
  "wasm_set_php_code",
2363
2364
  null,
2364
- [_e],
2365
+ [ve],
2365
2366
  [e]
2366
2367
  );
2367
2368
  }, nn = new WeakSet(), Ai = async function() {
@@ -2399,7 +2400,7 @@ _t = new WeakMap(), nt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(),
2399
2400
  } finally {
2400
2401
  (i = H(this, vt)) == null || i.removeEventListener("error", r), pe(this, st, {});
2401
2402
  }
2402
- const { headers: n, httpStatusCode: s } = $e(this, Kr, Ei).call(this);
2403
+ const { headers: n, httpStatusCode: s } = _e(this, Kr, Ei).call(this);
2403
2404
  return new qt(
2404
2405
  s,
2405
2406
  n,
@@ -3617,28 +3618,28 @@ var re = {};
3617
3618
  })(re);
3618
3619
  var Ge = {};
3619
3620
  Object.defineProperty(Ge, "__esModule", { value: !0 });
3620
- const ve = K, Ya = {
3621
+ const we = K, Ya = {
3621
3622
  // validation function arguments
3622
- data: new ve.Name("data"),
3623
+ data: new we.Name("data"),
3623
3624
  // args passed from referencing schema
3624
- valCxt: new ve.Name("valCxt"),
3625
- instancePath: new ve.Name("instancePath"),
3626
- parentData: new ve.Name("parentData"),
3627
- parentDataProperty: new ve.Name("parentDataProperty"),
3628
- rootData: new ve.Name("rootData"),
3629
- dynamicAnchors: new ve.Name("dynamicAnchors"),
3625
+ valCxt: new we.Name("valCxt"),
3626
+ instancePath: new we.Name("instancePath"),
3627
+ parentData: new we.Name("parentData"),
3628
+ parentDataProperty: new we.Name("parentDataProperty"),
3629
+ rootData: new we.Name("rootData"),
3630
+ dynamicAnchors: new we.Name("dynamicAnchors"),
3630
3631
  // function scoped variables
3631
- vErrors: new ve.Name("vErrors"),
3632
- errors: new ve.Name("errors"),
3633
- this: new ve.Name("this"),
3632
+ vErrors: new we.Name("vErrors"),
3633
+ errors: new we.Name("errors"),
3634
+ this: new we.Name("this"),
3634
3635
  // "globals"
3635
- self: new ve.Name("self"),
3636
- scope: new ve.Name("scope"),
3636
+ self: new we.Name("self"),
3637
+ scope: new we.Name("scope"),
3637
3638
  // JTD serialize/parse name for JSON string and position
3638
- json: new ve.Name("json"),
3639
- jsonPos: new ve.Name("jsonPos"),
3640
- jsonLen: new ve.Name("jsonLen"),
3641
- jsonPart: new ve.Name("jsonPart")
3639
+ json: new we.Name("json"),
3640
+ jsonPos: new we.Name("jsonPos"),
3641
+ jsonLen: new we.Name("jsonLen"),
3642
+ jsonPart: new we.Name("jsonPart")
3642
3643
  };
3643
3644
  Ge.default = Ya;
3644
3645
  (function(t) {
@@ -4199,7 +4200,7 @@ function kc(t, { jtdDiscriminator: e, jtdMetadata: r, compositeRule: n, createEr
4199
4200
  n !== void 0 && (t.compositeRule = n), s !== void 0 && (t.createErrors = s), i !== void 0 && (t.allErrors = i), t.jtdDiscriminator = e, t.jtdMetadata = r;
4200
4201
  }
4201
4202
  ot.extendSubschemaMode = kc;
4202
- var ge = {}, Bi = function t(e, r) {
4203
+ var $e = {}, Bi = function t(e, r) {
4203
4204
  if (e === r)
4204
4205
  return !0;
4205
4206
  if (e && r && typeof e == "object" && typeof r == "object") {
@@ -4307,8 +4308,8 @@ function jc(t) {
4307
4308
  return t.replace(/~/g, "~0").replace(/\//g, "~1");
4308
4309
  }
4309
4310
  var Ic = Ki.exports;
4310
- Object.defineProperty(ge, "__esModule", { value: !0 });
4311
- ge.getSchemaRefs = ge.resolveUrl = ge.normalizeId = ge._getFullPath = ge.getFullPath = ge.inlineRef = void 0;
4311
+ Object.defineProperty($e, "__esModule", { value: !0 });
4312
+ $e.getSchemaRefs = $e.resolveUrl = $e.normalizeId = $e._getFullPath = $e.getFullPath = $e.inlineRef = void 0;
4312
4313
  const Ac = re, Dc = Bi, Fc = Ic, qc = /* @__PURE__ */ new Set([
4313
4314
  "type",
4314
4315
  "format",
@@ -4330,7 +4331,7 @@ const Ac = re, Dc = Bi, Fc = Ic, qc = /* @__PURE__ */ new Set([
4330
4331
  function Mc(t, e = !0) {
4331
4332
  return typeof t == "boolean" ? !0 : e === !0 ? !wn(t) : e ? Gi(t) <= e : !1;
4332
4333
  }
4333
- ge.inlineRef = Mc;
4334
+ $e.inlineRef = Mc;
4334
4335
  const Uc = /* @__PURE__ */ new Set([
4335
4336
  "$ref",
4336
4337
  "$recursiveRef",
@@ -4363,20 +4364,20 @@ function Ji(t, e = "", r) {
4363
4364
  const n = t.parse(e);
4364
4365
  return Yi(t, n);
4365
4366
  }
4366
- ge.getFullPath = Ji;
4367
+ $e.getFullPath = Ji;
4367
4368
  function Yi(t, e) {
4368
4369
  return t.serialize(e).split("#")[0] + "#";
4369
4370
  }
4370
- ge._getFullPath = Yi;
4371
+ $e._getFullPath = Yi;
4371
4372
  const Lc = /#\/?$/;
4372
4373
  function Mt(t) {
4373
4374
  return t ? t.replace(Lc, "") : "";
4374
4375
  }
4375
- ge.normalizeId = Mt;
4376
+ $e.normalizeId = Mt;
4376
4377
  function zc(t, e, r) {
4377
4378
  return r = Mt(r), t.resolve(e, r);
4378
4379
  }
4379
- ge.resolveUrl = zc;
4380
+ $e.resolveUrl = zc;
4380
4381
  const Hc = /^[a-z_][-a-z0-9._]*$/i;
4381
4382
  function Vc(t, e) {
4382
4383
  if (typeof t == "boolean")
@@ -4412,10 +4413,10 @@ function Vc(t, e) {
4412
4413
  return new Error(`reference "${y}" resolves to more than one schema`);
4413
4414
  }
4414
4415
  }
4415
- ge.getSchemaRefs = Vc;
4416
+ $e.getSchemaRefs = Vc;
4416
4417
  Object.defineProperty(Ae, "__esModule", { value: !0 });
4417
4418
  Ae.getData = Ae.KeywordCxt = Ae.validateFunctionCode = void 0;
4418
- const Zi = xt, Vs = vr, Dn = Ze, Mr = vr, Wc = on, ur = Ke, fn = ot, U = K, V = Ge, xc = ge, Qe = re, ir = _r;
4419
+ const Zi = xt, Vs = vr, Dn = Ze, Mr = vr, Wc = on, ur = Ke, fn = ot, U = K, V = Ge, xc = $e, Qe = re, ir = _r;
4419
4420
  function Bc(t) {
4420
4421
  if (eo(t) && (to(t), Xi(t))) {
4421
4422
  Jc(t);
@@ -4733,7 +4734,7 @@ class fl extends Error {
4733
4734
  wr.default = fl;
4734
4735
  var br = {};
4735
4736
  Object.defineProperty(br, "__esModule", { value: !0 });
4736
- const hn = ge;
4737
+ const hn = $e;
4737
4738
  class hl extends Error {
4738
4739
  constructor(e, r, n, s) {
4739
4740
  super(s || `can't resolve reference ${n} from id ${r}`), this.missingRef = (0, hn.resolveUrl)(e, r, n), this.missingSchema = (0, hn.normalizeId)((0, hn.getFullPath)(e, this.missingRef));
@@ -4743,7 +4744,7 @@ br.default = hl;
4743
4744
  var Se = {};
4744
4745
  Object.defineProperty(Se, "__esModule", { value: !0 });
4745
4746
  Se.resolveSchema = Se.getCompilingSchema = Se.resolveRef = Se.compileSchema = Se.SchemaEnv = void 0;
4746
- const ke = K, ml = wr, ft = Ge, Ie = ge, Ks = re, yl = Ae;
4747
+ const ke = K, ml = wr, ft = Ge, Ie = $e, Ks = re, yl = Ae;
4747
4748
  class an {
4748
4749
  constructor(e) {
4749
4750
  var r;
@@ -5495,7 +5496,7 @@ Mn.default = lo;
5495
5496
  } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
5496
5497
  return r.CodeGen;
5497
5498
  } });
5498
- const n = wr, s = br, i = wt, a = Se, l = K, p = ge, u = vr, f = re, y = Ol, R = Mn, O = (F, $) => new RegExp(F, $);
5499
+ const n = wr, s = br, i = wt, a = Se, l = K, p = $e, u = vr, f = re, y = Ol, R = Mn, O = (F, $) => new RegExp(F, $);
5499
5500
  O.code = "new RegExp";
5500
5501
  const v = ["removeAdditional", "useDefaults", "coerceTypes"], S = /* @__PURE__ */ new Set([
5501
5502
  "validate",
@@ -6208,9 +6209,9 @@ const fo = Bi;
6208
6209
  fo.code = 'require("ajv/dist/runtime/equal").default';
6209
6210
  Pr.default = fo;
6210
6211
  Object.defineProperty(Zn, "__esModule", { value: !0 });
6211
- const yn = vr, ye = K, eu = re, tu = Pr, ru = {
6212
- message: ({ params: { i: t, j: e } }) => (0, ye.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,
6213
- params: ({ params: { i: t, j: e } }) => (0, ye._)`{i: ${t}, j: ${e}}`
6212
+ const yn = vr, ge = K, eu = re, tu = Pr, ru = {
6213
+ message: ({ params: { i: t, j: e } }) => (0, ge.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,
6214
+ params: ({ params: { i: t, j: e } }) => (0, ge._)`{i: ${t}, j: ${e}}`
6214
6215
  }, nu = {
6215
6216
  keyword: "uniqueItems",
6216
6217
  type: "array",
@@ -6222,25 +6223,25 @@ const yn = vr, ye = K, eu = re, tu = Pr, ru = {
6222
6223
  if (!n && !s)
6223
6224
  return;
6224
6225
  const p = e.let("valid"), u = i.items ? (0, yn.getSchemaTypes)(i.items) : [];
6225
- t.block$data(p, f, (0, ye._)`${a} === false`), t.ok(p);
6226
+ t.block$data(p, f, (0, ge._)`${a} === false`), t.ok(p);
6226
6227
  function f() {
6227
- const v = e.let("i", (0, ye._)`${r}.length`), S = e.let("j");
6228
- t.setParams({ i: v, j: S }), e.assign(p, !0), e.if((0, ye._)`${v} > 1`, () => (y() ? R : O)(v, S));
6228
+ const v = e.let("i", (0, ge._)`${r}.length`), S = e.let("j");
6229
+ t.setParams({ i: v, j: S }), e.assign(p, !0), e.if((0, ge._)`${v} > 1`, () => (y() ? R : O)(v, S));
6229
6230
  }
6230
6231
  function y() {
6231
6232
  return u.length > 0 && !u.some((v) => v === "object" || v === "array");
6232
6233
  }
6233
6234
  function R(v, S) {
6234
- const _ = e.name("item"), g = (0, yn.checkDataTypes)(u, _, l.opts.strictNumbers, yn.DataType.Wrong), T = e.const("indices", (0, ye._)`{}`);
6235
- e.for((0, ye._)`;${v}--;`, () => {
6236
- e.let(_, (0, ye._)`${r}[${v}]`), e.if(g, (0, ye._)`continue`), u.length > 1 && e.if((0, ye._)`typeof ${_} == "string"`, (0, ye._)`${_} += "_"`), e.if((0, ye._)`typeof ${T}[${_}] == "number"`, () => {
6237
- e.assign(S, (0, ye._)`${T}[${_}]`), t.error(), e.assign(p, !1).break();
6238
- }).code((0, ye._)`${T}[${_}] = ${v}`);
6235
+ const _ = e.name("item"), g = (0, yn.checkDataTypes)(u, _, l.opts.strictNumbers, yn.DataType.Wrong), T = e.const("indices", (0, ge._)`{}`);
6236
+ e.for((0, ge._)`;${v}--;`, () => {
6237
+ e.let(_, (0, ge._)`${r}[${v}]`), e.if(g, (0, ge._)`continue`), u.length > 1 && e.if((0, ge._)`typeof ${_} == "string"`, (0, ge._)`${_} += "_"`), e.if((0, ge._)`typeof ${T}[${_}] == "number"`, () => {
6238
+ e.assign(S, (0, ge._)`${T}[${_}]`), t.error(), e.assign(p, !1).break();
6239
+ }).code((0, ge._)`${T}[${_}] = ${v}`);
6239
6240
  });
6240
6241
  }
6241
6242
  function O(v, S) {
6242
6243
  const _ = (0, eu.useFunc)(e, tu.default), g = e.name("outer");
6243
- e.label(g).for((0, ye._)`;${v}--;`, () => e.for((0, ye._)`${S} = ${v}; ${S}--;`, () => e.if((0, ye._)`${_}(${r}[${v}], ${r}[${S}])`, () => {
6244
+ e.label(g).for((0, ge._)`;${v}--;`, () => e.for((0, ge._)`${S} = ${v}; ${S}--;`, () => e.if((0, ge._)`${_}(${r}[${v}], ${r}[${S}])`, () => {
6244
6245
  t.error(), e.assign(p, !1).break(g);
6245
6246
  })));
6246
6247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/blueprints",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "access": "public",
22
22
  "directory": "../../../dist/packages/playground/blueprints"
23
23
  },
24
- "gitHead": "6c2256a8f3b6bafb2d9a5860f236b00832839769",
24
+ "gitHead": "630288218e307d9a5e93d92b428ed30ae6a5fa2f",
25
25
  "engines": {
26
26
  "node": ">=16.15.1",
27
27
  "npm": ">=8.11.0"