pasika 0.10.10 → 0.10.12

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.
@@ -1865,6 +1865,12 @@ function expectedSupportFolder(kinds) {
1865
1865
  }
1866
1866
  return void 0;
1867
1867
  }
1868
+ function mixedSupportKinds(folder, kinds) {
1869
+ if (folder === "types") return kinds.has("type") && (kinds.has("constant") || kinds.has("schema"));
1870
+ if (folder === "schemas") return kinds.has("schema") && kinds.has("constant");
1871
+ if (folder === "constants") return kinds.has("constant") && kinds.has("schema");
1872
+ return false;
1873
+ }
1868
1874
  function configModuleRoot(filename, sourceRoot) {
1869
1875
  const segments = segmentsOf(filename, sourceRoot);
1870
1876
  if (segments[0] !== "config" || segments.length < 3) return void 0;
@@ -1991,6 +1997,12 @@ var applicationStructureRule = {
1991
1997
  `A support folder must not contain a component; move ${path13.basename(filename)} beside ${currentFolder}/.`
1992
1998
  );
1993
1999
  }
2000
+ if (mixedSupportKinds(currentFolder, kinds)) {
2001
+ return report2(
2002
+ context,
2003
+ `A ${currentFolder}/ folder must not mix unrelated support kinds; keep types, schemas, and constants in their matching folders.`
2004
+ );
2005
+ }
1994
2006
  const expected = expectedSupportFolder(kinds);
1995
2007
  if (expected !== void 0 && expected !== currentFolder) {
1996
2008
  return report2(
@@ -3178,6 +3190,9 @@ function analyzeHandlerBody(body, sourceText) {
3178
3190
  if (ts4.isTryStatement(node)) kinds.add("try");
3179
3191
  if (isLoop(node)) kinds.add("loop");
3180
3192
  if (ts4.isIfStatement(node)) kinds.add("if");
3193
+ if (ts4.isCallExpression(node) && ts4.isPropertyAccessExpression(node.expression) && node.expression.name.text === "map") {
3194
+ kinds.add("map");
3195
+ }
3181
3196
  if (ts4.isCallExpression(node) && ts4.isIdentifier(node.expression)) calledNames.add(node.expression.text);
3182
3197
  if (isFunctionBoundary(node)) return;
3183
3198
  ts4.forEachChild(node, visit);
@@ -3188,7 +3203,8 @@ function analyzeHandlerBody(body, sourceText) {
3188
3203
  var CONTROL_FLOW_MESSAGES = {
3189
3204
  try: "a try statement",
3190
3205
  loop: "a loop",
3191
- if: "an if statement"
3206
+ if: "an if statement",
3207
+ map: "a map operation"
3192
3208
  };
3193
3209
  function isFunctionLikeInit(node) {
3194
3210
  return node?.type === "ArrowFunctionExpression" || node?.type === "FunctionExpression";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.10.10",
3
+ "version": "0.10.12",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",