Comparing version 0.37.1 to 0.37.2
import { IDictionary } from "common-types"; | ||
import { IMockAuthConfig } from "./auth-types"; | ||
import { Mock } from ".."; | ||
/** an _async_ mock function which returns a dictionary data structure */ | ||
export declare type AsyncMockData = () => Promise<IDictionary>; | ||
export declare type AsyncMockData = (db: Mock) => Promise<IDictionary>; | ||
export interface IMockConfigOptions { | ||
@@ -6,0 +7,0 @@ auth?: IMockAuthConfig; |
@@ -72,6 +72,9 @@ "use strict"; | ||
? typeof options.db === "function" | ||
? await options.db() | ||
? {} | ||
: options.db || defaultDbConfig | ||
: defaultDbConfig, options.auth | ||
? Object.assign(Object.assign({}, defaultAuthConfig), options.auth) : defaultAuthConfig); | ||
if (typeof options.db === "function") { | ||
obj.updateDB(await options.db(obj)); | ||
} | ||
try { | ||
@@ -78,0 +81,0 @@ await obj.importFakerLibrary(); |
import { IDictionary } from "common-types"; | ||
import { IMockAuthConfig } from "./auth-types"; | ||
import { Mock } from ".."; | ||
/** an _async_ mock function which returns a dictionary data structure */ | ||
export declare type AsyncMockData = () => Promise<IDictionary>; | ||
export declare type AsyncMockData = (db: Mock) => Promise<IDictionary>; | ||
export interface IMockConfigOptions { | ||
@@ -6,0 +7,0 @@ auth?: IMockAuthConfig; |
@@ -61,6 +61,9 @@ import { Queue, Schema, Reference, Deployment } from "./index"; | ||
? typeof options.db === "function" | ||
? await options.db() | ||
? {} | ||
: options.db || defaultDbConfig | ||
: defaultDbConfig, options.auth | ||
? Object.assign(Object.assign({}, defaultAuthConfig), options.auth) : defaultAuthConfig); | ||
if (typeof options.db === "function") { | ||
obj.updateDB(await options.db(obj)); | ||
} | ||
try { | ||
@@ -67,0 +70,0 @@ await obj.importFakerLibrary(); |
{ | ||
"name": "firemock", | ||
"version": "0.37.1", | ||
"version": "0.37.2", | ||
"description": "firemock", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
444354
7684