@zhongguo168a/yxeditor-common 0.0.108 → 0.0.110

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.d.ts CHANGED
@@ -746,7 +746,7 @@ declare class Dictionary<K = string, V = any> {
746
746
  delete(key: K): void;
747
747
  private deleteData;
748
748
  exists(keys: K[]): boolean;
749
- length(): number;
749
+ get length(): number;
750
750
  pop(key: K): [V, boolean];
751
751
  isEmpty(): boolean;
752
752
  items(): V[];
package/dist/index.esm.js CHANGED
@@ -2863,11 +2863,11 @@ class Dictionary {
2863
2863
  * 如果使用了 onSet or onDelete,需要注意清理
2864
2864
  */
2865
2865
  clear(useIter = true) {
2866
- let data = this._data;
2866
+ this._data;
2867
2867
  if (useIter) {
2868
- for (const key in data) {
2869
- const item = data[key];
2870
- this.delete(item);
2868
+ let keys = this.keys();
2869
+ for (const key of keys) {
2870
+ this.delete(key);
2871
2871
  }
2872
2872
  }
2873
2873
  else {
@@ -2929,7 +2929,7 @@ class Dictionary {
2929
2929
  }
2930
2930
  }
2931
2931
  addDictionary(other) {
2932
- if (other.length() == 0) {
2932
+ if (other.length == 0) {
2933
2933
  return;
2934
2934
  }
2935
2935
  for (const key in other._data) {
@@ -2981,7 +2981,7 @@ class Dictionary {
2981
2981
  }
2982
2982
  return true;
2983
2983
  }
2984
- length() {
2984
+ get length() {
2985
2985
  return this.size;
2986
2986
  }
2987
2987
  pop(key) {