nudojs 1.3.19 → 1.3.20

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 (2) hide show
  1. package/dist/index.js +30 -16
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -29873,14 +29873,32 @@ function $concat(a, b) {
29873
29873
  if (isMapAbs(x)) return mapEntriesAbs(x);
29874
29874
  const mi = matchIterElements(x);
29875
29875
  if (mi) return mi;
29876
+ if (x.shape.k === "brand") return expand(x.shape.shape);
29877
+ if (x.shape.k === "tuple") return [...x.shape.elements];
29876
29878
  return null;
29877
29879
  };
29880
+ const sideEl = (x, expanded) => {
29881
+ if (expanded) {
29882
+ return expanded.length ? expanded.reduce((u, y) => joinAbs(u, y)) : abs({ k: "never" }, void 0, void 0, "exact");
29883
+ }
29884
+ if (x?.shape?.k === "any") return anyMemberResult();
29885
+ if (x?.shape?.k === "tuple") {
29886
+ const els = x.shape.elements;
29887
+ return els.length ? els.reduce((u, y) => joinAbs(u, y)) : abs({ k: "never" }, void 0, void 0, "exact");
29888
+ }
29889
+ if (x?.shape?.k === "prim" && x.shape.type === "string") {
29890
+ return abs({ k: "prim", type: "string" }, void 0, void 0, "path");
29891
+ }
29892
+ if (x?.shape?.k === "arr") return x.shape.element;
29893
+ if (x?.shape?.k === "brand") return sideEl(x.shape.shape, null);
29894
+ return unknown;
29895
+ };
29878
29896
  if (as.k === "tuple") {
29879
29897
  const be = expand(b);
29880
29898
  if (be) {
29881
29899
  return tupleOrWiden([...as.elements, ...be], confJoin(a.conf, b.conf));
29882
29900
  }
29883
- const bEl = b?.shape?.k === "any" ? anyMemberResult() : unknown;
29901
+ const bEl = sideEl(b, be);
29884
29902
  return abs(
29885
29903
  { k: "arr", element: [...as.elements, bEl].reduce((x, y) => joinAbs(x, y)) },
29886
29904
  void 0,
@@ -29892,20 +29910,6 @@ function $concat(a, b) {
29892
29910
  if (ae && bs.k === "tuple") {
29893
29911
  return tupleOrWiden([...ae, ...bs.elements], confJoin(a.conf, b.conf));
29894
29912
  }
29895
- const sideEl = (x, expanded) => {
29896
- if (expanded) {
29897
- return expanded.length ? expanded.reduce((u, y) => joinAbs(u, y)) : abs({ k: "never" }, void 0, void 0, "exact");
29898
- }
29899
- if (x?.shape?.k === "any") return anyMemberResult();
29900
- if (x?.shape?.k === "tuple") {
29901
- const els = x.shape.elements;
29902
- return els.length ? els.reduce((u, y) => joinAbs(u, y)) : abs({ k: "never" }, void 0, void 0, "exact");
29903
- }
29904
- if (x?.shape?.k === "prim" && x.shape.type === "string") {
29905
- return abs({ k: "prim", type: "string" }, void 0, void 0, "path");
29906
- }
29907
- return unknown;
29908
- };
29909
29913
  return abs(
29910
29914
  { k: "arr", element: joinAbs(sideEl(a, ae), sideEl(b, expand(b))) },
29911
29915
  void 0,
@@ -29939,6 +29943,9 @@ function iterabilityKind(a) {
29939
29943
  if (s.slots["@@iterator"]) return "total";
29940
29944
  return s.open ? "may" : "definite";
29941
29945
  }
29946
+ if (s.k === "brand") {
29947
+ return iterabilityKind(s.shape) === "total" ? "total" : "may";
29948
+ }
29942
29949
  return "may";
29943
29950
  }
29944
29951
  function asyncIterabilityKind(a) {
@@ -29956,6 +29963,12 @@ function asyncIterabilityKind(a) {
29956
29963
  if (s.k === "obj" && !s.slots["@@iterator"] && s.slots["@@asyncIterator"]) {
29957
29964
  return "total";
29958
29965
  }
29966
+ if (s.k === "brand") {
29967
+ const ish = s.shape.shape;
29968
+ if (ish.k === "obj" && !ish.slots["@@iterator"] && ish.slots["@@asyncIterator"]) {
29969
+ return "total";
29970
+ }
29971
+ }
29959
29972
  return iterabilityKind(a);
29960
29973
  }
29961
29974
  function guardIterable(a, ctx2) {
@@ -30019,6 +30032,7 @@ function elemsOf(a) {
30019
30032
  if (a.shape.k === "prim" && a.shape.type === "string") {
30020
30033
  return [abs({ k: "prim", type: "string" }, void 0, void 0, "path")];
30021
30034
  }
30035
+ if (a.shape.k === "brand") return elemsOf(a.shape.shape);
30022
30036
  return [unknown];
30023
30037
  }
30024
30038
  function $forInKeys(o) {
@@ -36948,7 +36962,7 @@ ${js}`;
36948
36962
  (k) => !ENV_SHADOW_SKIP.has(k)
36949
36963
  );
36950
36964
  if (envInjectNames.length > 0) {
36951
- const envBinds = envInjectNames.map((k) => `const ${k} = __nudoEnv[${JSON.stringify(k)}];`).join("\n");
36965
+ const envBinds = envInjectNames.map((k) => `let ${k} = __nudoEnv[${JSON.stringify(k)}];`).join("\n");
36952
36966
  js = `${envBinds}
36953
36967
  ${js}`;
36954
36968
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nudojs",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -46,11 +46,11 @@
46
46
  "dependencies": {
47
47
  "@babel/generator": "^8.0.6",
48
48
  "@babel/types": "^8.0.6",
49
- "@nudojs/core": "1.10.1",
50
- "@nudojs/env": "0.4.33",
51
- "@nudojs/harvester": "0.3.19",
52
- "@nudojs/parser": "1.4.15",
53
- "@nudojs/service": "1.6.18",
49
+ "@nudojs/core": "1.10.2",
50
+ "@nudojs/env": "0.4.34",
51
+ "@nudojs/harvester": "0.3.20",
52
+ "@nudojs/parser": "1.4.16",
53
+ "@nudojs/service": "1.6.19",
54
54
  "commander": "^15.0.0"
55
55
  },
56
56
  "devDependencies": {