MCPcopy
hub / github.com/TryGhost/Ghost / create

Function create

e2e/data-factory/factory.ts:18–24  ·  view source on GitHub ↗
(options?: Partial<TOptions>)

Source from the content-addressed store, hash-verified

16 }
17
18 async create(options?: Partial<TOptions>): Promise<TResult> {
19 if (!this.adapter) {
20 throw new Error('Cannot create without a persistence adapter. Use build() for in-memory objects.');
21 }
22 const data = this.build(options);
23 return await this.adapter.insert(this.entityType, data) as Promise<TResult>;
24 }
25
26 async createMany(optionsList: Partial<TOptions>[]): Promise<TResult[]> {
27 if (!this.adapter) {

Callers 1

getOrCreateContainerMethod · 0.50

Calls 2

insertMethod · 0.65
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…