erulabs/erudb

View on GitHub
src/Service.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strong'

import Client from './Client.js'
import {
  validateServiceOptions,
  validateClientOptions
} from './helpers.js'

// EruDB Service
export default class {
  constructor (rawOptions) {
    // Initialize Client
    this.opts = validateServiceOptions(validateClientOptions(rawOptions))

    this.client = new Client(this.opts, this)

    // Shorthand
    this.get = this.client.get
    this.put = this.client.put
    this.use = this.client.use
  }
}