MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / isInitialized

Method isInitialized

packages/core/src/entity/Collection.ts:851–863  ·  view source on GitHub ↗

Returns whether the collection has been initialized. Pass `fully = true` to also check that all items are initialized.

(fully = false)

Source from the content-addressed store, hash-verified

849
850 /** Returns whether the collection has been initialized. Pass `fully = true` to also check that all items are initialized. */
851 isInitialized(fully = false): boolean {
852 if (!this.#initialized || !fully) {
853 return this.#initialized;
854 }
855
856 for (const item of this.#items) {
857 if (!helper(item).__initialized) {
858 return false;
859 }
860 }
861
862 return true;
863 }
864
865 isDirty(): boolean {
866 return this.#dirty;

Callers 4

loadMethod · 0.95
toJSONMethod · 0.95
shouldPopulateMethod · 0.95
checkInitializedMethod · 0.95

Calls 1

helperFunction · 0.85

Tested by

no test coverage detected