MCPcopy
hub / github.com/directus/directus / field

Method field

packages/schema-builder/src/collection.ts:28–38  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

26 }
27
28 field(name: string): FieldBuilder {
29 const existingField = this._fields.find((fieldBuilder) => fieldBuilder.get_name() === name);
30
31 if (existingField) {
32 return existingField;
33 }
34
35 const field = new FieldBuilder(name, this._schemaBuilder, this);
36 this._fields.push(field);
37 return field;
38 }
39
40 get_name(): string {
41 return this._data.collection;

Callers 15

buildMethod · 0.95
builder.test.tsFile · 0.80
translationsMethod · 0.80
read.test.tsFile · 0.80
format.test.tsFile · 0.80
limit.test.tsFile · 0.80

Calls 1

get_nameMethod · 0.45

Tested by

no test coverage detected