Comparing version 0.0.8 to 0.0.9
@@ -35,5 +35,11 @@ /// <reference types="node" /> | ||
}>, Partials>; | ||
addDefinitions<NewDefinitions extends readonly ZCollectionDefinition<any, any>[]>(definitions: NewDefinitions): ZDatabase<Merge<Definitions & { | ||
[Definition in NewDefinitions[number] as ZCollectionModelName<Definition>]: Definition; | ||
}>, Partials>; | ||
addPartial<PartialDef extends ZPartialDefinition<any, any>>(definition: PartialDef): ZDatabase<Definitions, Merge<Partials & { | ||
[key in ZPartialName<PartialDef>]: PartialDef; | ||
}>>; | ||
addPartials<NewPartials extends readonly ZPartialDefinition<any, any>[]>(definitions: NewPartials): ZDatabase<Definitions, Merge<Partials & { | ||
[Definition in NewPartials[number] as ZPartialName<Definition>]: Definition; | ||
}>>; | ||
getCollection<DefName extends keyof Definitions>(defName: DefName): Collection<ZRawDocumentType<Definitions[DefName]>>; | ||
@@ -40,0 +46,0 @@ create<Def extends keyof Definitions>(def: Def, data: CreateDocumentParam<Definitions, Def>): Promise<z.output<ZCollectionBranded<Definitions[Def]>>>; |
@@ -39,2 +39,8 @@ "use strict"; | ||
} | ||
addDefinitions(definitions) { | ||
for (const definition of definitions) { | ||
this.addDefinition(definition); | ||
} | ||
return this; | ||
} | ||
addPartial(definition) { | ||
@@ -45,2 +51,8 @@ definition.zdb = this; | ||
} | ||
addPartials(definitions) { | ||
for (const definition of definitions) { | ||
this.addPartial(definition); | ||
} | ||
return this; | ||
} | ||
getCollection(defName) { | ||
@@ -47,0 +59,0 @@ const definition = this.definitions.get(defName); |
{ | ||
"name": "zongo", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50951
956