@adminforth/text-complete 2.0.22 → 2.0.24

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.
package/dist/index.js CHANGED
@@ -82,6 +82,9 @@ export default class TextCompletePlugin extends AdminForthPlugin {
82
82
  }
83
83
  }
84
84
  const { record } = body;
85
+ if (!record) {
86
+ return { completion: [] };
87
+ }
85
88
  const recordNoField = Object.assign({}, record);
86
89
  delete recordNoField[this.options.fieldName];
87
90
  let currentVal = record[this.options.fieldName];
package/index.ts CHANGED
@@ -98,6 +98,9 @@ export default class TextCompletePlugin extends AdminForthPlugin {
98
98
  }
99
99
 
100
100
  const { record } = body;
101
+ if (!record) {
102
+ return { completion: [] };
103
+ }
101
104
  const recordNoField = {...record};
102
105
  delete recordNoField[this.options.fieldName];
103
106
  let currentVal = record[this.options.fieldName];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/text-complete",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "Text completion plugin for adminforth",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.10.7",
27
- "adminforth": "^3.6.2",
27
+ "adminforth": "^3.6.21",
28
28
  "semantic-release": "^24.2.1",
29
29
  "semantic-release-slack-bot": "^4.0.2",
30
30
  "typescript": "^5.7.3"
@@ -55,6 +55,6 @@
55
55
  ]
56
56
  },
57
57
  "peerDependencies": {
58
- "adminforth": "^3.6.2"
58
+ "adminforth": "^3.6.21"
59
59
  }
60
60
  }