simple-graph-query 1.1.1 → 1.1.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.
@@ -56,3 +56,6 @@ export declare class ForgeExprEvaluator extends AbstractParseTreeVisitor<EvalRes
56
56
  private evaluateBinaryOperation;
57
57
  private evaluateUnaryOperation;
58
58
  }
59
+ export declare class NameNotFoundError extends Error {
60
+ constructor(message: string);
61
+ }
@@ -48436,7 +48436,7 @@ module.exports = function whichTypedArray(value) {
48436
48436
  "use strict";
48437
48437
 
48438
48438
  Object.defineProperty(exports, "__esModule", ({ value: true }));
48439
- exports.ForgeExprEvaluator = exports.SUPPORTED_BUILTINS = void 0;
48439
+ exports.NameNotFoundError = exports.ForgeExprEvaluator = exports.SUPPORTED_BUILTINS = void 0;
48440
48440
  exports.areTupleArraysEqual = areTupleArraysEqual;
48441
48441
  const AbstractParseTreeVisitor_1 = __webpack_require__(/*! antlr4ts/tree/AbstractParseTreeVisitor */ "./node_modules/antlr4ts/tree/AbstractParseTreeVisitor.js");
48442
48442
  const lodash_1 = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
@@ -49889,7 +49889,7 @@ class ForgeExprEvaluator extends AbstractParseTreeVisitor_1.AbstractParseTreeVis
49889
49889
  if (exports.SUPPORTED_BUILTINS.includes(identifier)) {
49890
49890
  return identifier;
49891
49891
  }
49892
- throw new Error(`bad name ${identifier} referenced!`);
49892
+ throw new NameNotFoundError(`bad name ${identifier} referenced!`);
49893
49893
  }
49894
49894
  visitQualName(ctx) {
49895
49895
  // NOTE: this currently only supports Int; doesn't support other branches
@@ -49998,6 +49998,14 @@ class ForgeExprEvaluator extends AbstractParseTreeVisitor_1.AbstractParseTreeVis
49998
49998
  }
49999
49999
  }
50000
50000
  exports.ForgeExprEvaluator = ForgeExprEvaluator;
50001
+ // Custom error for undefined names
50002
+ class NameNotFoundError extends Error {
50003
+ constructor(message) {
50004
+ super(message);
50005
+ this.name = "NameNotFoundError";
50006
+ }
50007
+ }
50008
+ exports.NameNotFoundError = NameNotFoundError;
50001
50009
 
50002
50010
 
50003
50011
  /***/ }),
@@ -60946,6 +60954,11 @@ class SimpleGraphQueryEvaluator {
60946
60954
  return result;
60947
60955
  }
60948
60956
  catch (error) {
60957
+ if (error instanceof ForgeExprEvaluator_1.NameNotFoundError) {
60958
+ // Return an empty EvalResult for undefined names
60959
+ let emptyResult = [];
60960
+ return emptyResult;
60961
+ }
60949
60962
  if (error instanceof Error) {
60950
60963
  const stackTrace = error.stack;
60951
60964
  const errorMessage = error.message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-graph-query",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "TypeScript evaluator for Forge expressions with browser-compatible UMD bundle",
5
5
  "main": "dist/simple-graph-query.bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,6 +46,7 @@
46
46
  "jest": "^29.7.0",
47
47
  "jest-environment-jsdom": "^29.7.0",
48
48
  "process": "^0.11.10",
49
+ "semver": "^7.7.2",
49
50
  "stream-browserify": "^3.0.0",
50
51
  "ts-jest": "^29.3.1",
51
52
  "ts-loader": "^9.5.2",