code: function validateOptions (options) {
    // options must be an object
    invariant(
      _.isObject(options),
      'Check out our JavaScript SDK Usage Guide: ' +
        'http://docs.treasuredata.com/articles/javascript-sdk'
    )
  
    invariant(_.isString(options.writeKey), 'Must provide a writeKey')
  
    invariant(_.isString(options.database), 'Must provide a database')
  
    invariant(
      /^[a-z0-9_]{3,255}$/.test(options.database),
      'Database must be between 3 and 255 characters and must ' +
        'consist only of lower case letters, numbers, and _'
    )
  }
docs: Helpers