@tachybase/database 0.23.18 → 0.23.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.
@@ -83,6 +83,7 @@ export declare class Collection<TModelAttributes extends {} = any, TCreationAttr
83
83
  findField(callback: (field: Field) => boolean): any;
84
84
  hasField(name: string): boolean;
85
85
  getField<F extends Field>(name: string): F;
86
+ getFieldByField(field: string): Field;
86
87
  getFields(): any[];
87
88
  addField(name: string, options: FieldOptions): Field;
88
89
  checkFieldType(name: string, options: FieldOptions): void;
package/lib/collection.js CHANGED
@@ -227,6 +227,9 @@ const _Collection = class _Collection extends (_a = import_events.EventEmitter,
227
227
  getField(name) {
228
228
  return this.fields.get(name);
229
229
  }
230
+ getFieldByField(field) {
231
+ return this.findField((f) => f.options.field === field);
232
+ }
230
233
  getFields() {
231
234
  return [...this.fields.values()];
232
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/database",
3
- "version": "0.23.18",
3
+ "version": "0.23.22",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",
@@ -24,8 +24,8 @@
24
24
  "semver": "^7.6.3",
25
25
  "sequelize": "^6.37.5",
26
26
  "umzug": "^3.8.2",
27
- "@tachybase/logger": "0.23.18",
28
- "@tachybase/utils": "0.23.18"
27
+ "@tachybase/utils": "0.23.22",
28
+ "@tachybase/logger": "0.23.22"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/flat": "^5.0.5",