@vope/utils 1.4.21 → 1.4.22

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/cjs/index.js CHANGED
@@ -716,7 +716,9 @@ var Neo4jAhchors = class {
716
716
  * 查找边连接点的位置
717
717
  */
718
718
  findAnchor(id) {
719
- const anchor = this.#anchors[id] || {};
719
+ const anchor = this.#anchors[id];
720
+ if (!anchor)
721
+ return null;
720
722
  return {
721
723
  source: anchor.source || 0,
722
724
  target: anchor.target || 0
@@ -112,7 +112,9 @@ class Neo4jAhchors {
112
112
  * 查找边连接点的位置
113
113
  */
114
114
  findAnchor(id) {
115
- const anchor = this.#anchors[id] || {};
115
+ const anchor = this.#anchors[id];
116
+ if (!anchor)
117
+ return null;
116
118
  return {
117
119
  source: anchor.source || 0,
118
120
  target: anchor.target || 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vope/utils",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -31,7 +31,7 @@ export default class Neo4jAhchors<INode extends object, IEdge extends object> {
31
31
  findAnchor(id: string): {
32
32
  source: number;
33
33
  target: number;
34
- };
34
+ } | null;
35
35
  /**
36
36
  * 获取指定边控制点距离两端点连线的距离(可理解为控制边的弯曲程度)
37
37
  * @description 返回值是一个相对值,需要乘以一个基数值(基数值应为负值,如-30)