@motiadev/core 0.6.0-beta.123 → 0.6.2-beta.125

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.
@@ -52,7 +52,7 @@ class Logger {
52
52
  }
53
53
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
54
  log(args) {
55
- this._log('info', args.msg, args);
55
+ this._log(args.level ?? 'info', args.msg, args);
56
56
  }
57
57
  addListener(listener) {
58
58
  this.listeners.push(listener);
@@ -8,8 +8,17 @@ class Logger {
8
8
  this.sender = sender;
9
9
  }
10
10
  _log(level, message, args) {
11
+ const argsCopy = args ? { ...args } : {};
12
+ if (argsCopy.error && argsCopy.error instanceof Error) {
13
+ argsCopy.error = {
14
+ ...argsCopy.error,
15
+ message: argsCopy.error.message,
16
+ stack: argsCopy.error.stack,
17
+ name: argsCopy.error.name,
18
+ };
19
+ }
11
20
  const logEntry = {
12
- ...(args || {}),
21
+ ...argsCopy,
13
22
  level,
14
23
  time: Date.now(),
15
24
  traceId: this.traceId,
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.filterItem = exports.inferType = void 0;
7
- const lodash_get_1 = __importDefault(require("lodash.get"));
4
+ const getNestedValue = (obj, path) => {
5
+ if (!obj || typeof obj !== 'object')
6
+ return undefined;
7
+ const mappedObj = obj;
8
+ return mappedObj[path];
9
+ };
8
10
  const inferType = (value) => {
9
11
  if (typeof value === 'string') {
10
12
  return 'string';
@@ -54,7 +56,7 @@ const filterItem = (item, filters) => {
54
56
  }
55
57
  };
56
58
  return filters.every((filter) => {
57
- const valueFromKey = (0, lodash_get_1.default)(item.value, filter.valueKey);
59
+ const valueFromKey = getNestedValue(item.value, filter.valueKey);
58
60
  if (filter.valueKey === 'key') {
59
61
  return compare(item.key, filter.operation, filter.value) || compare(valueFromKey, filter.operation, filter.value);
60
62
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@motiadev/core",
3
3
  "description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
4
4
  "main": "dist/index.js",
5
- "version": "0.6.0-beta.123",
5
+ "version": "0.6.2-beta.125",
6
6
  "dependencies": {
7
7
  "@amplitude/analytics-node": "^1.3.8",
8
8
  "body-parser": "^1.20.3",
@@ -10,7 +10,6 @@
10
10
  "cors": "^2.8.5",
11
11
  "dotenv": "^16.4.7",
12
12
  "express": "^4.21.2",
13
- "lodash.get": "^4.4.2",
14
13
  "node-cron": "^3.0.3",
15
14
  "ts-node": "^10.9.2",
16
15
  "tsconfig-paths": "^4.2.0",
@@ -24,7 +23,6 @@
24
23
  "@types/cors": "^2.8.17",
25
24
  "@types/express": "^5.0.1",
26
25
  "@types/jest": "^29.5.14",
27
- "@types/lodash.get": "^4.4.9",
28
26
  "@types/node-cron": "^3.0.11",
29
27
  "@types/supertest": "^6.0.2",
30
28
  "@types/ws": "^8.18.1",