@tpmjs/reconciliation-match 0.1.0 → 0.1.1

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 +5 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -19,18 +19,18 @@ function stringSimilarity(str1, str2) {
19
19
  for (let i = 1; i <= s2.length; i++) {
20
20
  for (let j = 1; j <= s1.length; j++) {
21
21
  if (s2.charAt(i - 1) === s1.charAt(j - 1)) {
22
- matrix[i][j] = matrix[i - 1][j - 1];
22
+ matrix[i][j] = matrix[i - 1]?.[j - 1];
23
23
  } else {
24
24
  matrix[i][j] = Math.min(
25
- matrix[i - 1][j - 1] + 1,
26
- matrix[i][j - 1] + 1,
27
- matrix[i - 1][j] + 1
25
+ matrix[i - 1]?.[j - 1] + 1,
26
+ matrix[i]?.[j - 1] + 1,
27
+ matrix[i - 1]?.[j] + 1
28
28
  );
29
29
  }
30
30
  }
31
31
  }
32
32
  const maxLength = Math.max(s1.length, s2.length);
33
- return 1 - matrix[s2.length][s1.length] / maxLength;
33
+ return 1 - matrix[s2.length]?.[s1.length] / maxLength;
34
34
  }
35
35
  function dateProximityScore(date1, date2) {
36
36
  const d1 = new Date(date1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpmjs/reconciliation-match",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Matches bank transactions to ledger entries for reconciliation",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -20,7 +20,7 @@
20
20
  "dist"
21
21
  ],
22
22
  "devDependencies": {
23
- "tsup": "^8.3.5",
23
+ "tsup": "^8.5.1",
24
24
  "typescript": "^5.9.3",
25
25
  "@tpmjs/tsconfig": "0.0.0"
26
26
  },
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "tools": [
43
43
  {
44
- "exportName": "reconciliationMatchTool",
44
+ "name": "reconciliationMatchTool",
45
45
  "description": "Matches bank transactions to ledger entries for reconciliation. Uses amount, date proximity, and description similarity to identify matches with confidence scoring.",
46
46
  "parameters": [
47
47
  {
@@ -74,7 +74,7 @@
74
74
  ]
75
75
  },
76
76
  "dependencies": {
77
- "ai": "6.0.0-beta.124"
77
+ "ai": "6.0.49"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "tsup",