mirror of
https://github.com/appy-one/acebase-core.git
synced 2026-06-30 06:02:04 -06:00
Add option for firebaseCompat
This commit is contained in:
parent
62166b07f2
commit
c50702eda4
1 changed files with 10 additions and 1 deletions
|
|
@ -37,6 +37,12 @@ export class AceBaseBaseSettings {
|
|||
*/
|
||||
logColors = true;
|
||||
|
||||
/**
|
||||
* Whether to expose a more Firebase-compatible API
|
||||
* @default true
|
||||
*/
|
||||
firebaseCompat = false;
|
||||
|
||||
/**
|
||||
* @internal (for internal use)
|
||||
*/
|
||||
|
|
@ -51,6 +57,7 @@ export class AceBaseBaseSettings {
|
|||
if (typeof options !== 'object') { options = {}; }
|
||||
if (typeof options.logLevel === 'string') { this.logLevel = options.logLevel; }
|
||||
if (typeof options.logColors === 'boolean') { this.logColors = options.logColors; }
|
||||
if (typeof options.firebaseCompat === 'boolean') { this.firebaseCompat = options.firebaseCompat; }
|
||||
if (typeof options.info === 'string') { this.info = options.info; }
|
||||
if (typeof options.sponsor === 'boolean') { this.sponsor = options.sponsor; }
|
||||
}
|
||||
|
|
@ -76,12 +83,14 @@ export abstract class AceBaseBase extends SimpleEventEmitter {
|
|||
|
||||
readonly name: string;
|
||||
|
||||
readonly options: AceBaseBaseSettings;
|
||||
|
||||
/**
|
||||
* @param dbname Name of the database to open or create
|
||||
*/
|
||||
constructor(dbname: string, options: Partial<AceBaseBaseSettings> = {}) {
|
||||
super();
|
||||
options = new AceBaseBaseSettings(options);
|
||||
this.options = options = new AceBaseBaseSettings(options);
|
||||
|
||||
this.name = dbname;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue