src/lib/JsonFileDB.js
function has(key) {
    if (options.cacheValues) {
      return Promise.resolve((cachedData[key] !== undefined));
    } else if (options.cacheKeys) {
      return Promise.resolve((cachedKeys.indexOf(key) !== -1));
    } else {
      return readData().then(function(data) {
        return (data[key] !== undefined);
      });
    }
  }
function has(key) {
    if (options.cacheValues) {
      return Promise.resolve((cachedData[key] !== undefined));
    } else if (options.cacheKeys) {
      return Promise.resolve((cachedKeys.indexOf(key) !== -1));
    } else {
      return readData().then(function(data) {
        return (data[key] !== undefined);
      });
    }
  }
function has ( key ) { if ( options . cacheValues ) { return Promise . resolve ( ( cachedData [ key ] !== undefined ) ) ; } else if ( options . cacheKeys ) { return Promise . resolve ( ( cachedKeys . indexOf ( key ) !== - 1 ) ) ; } else { return readData ( ) . then ( function ( data ) { return ( data [ key ] !== undefined ) ; } ) ; } }
Implements checking for if a value for a key exists

@param {Key} key Key to see if there is a value for

@returns {Promise} A promise that will resolve to a Boolean value of
whether or not a value for the given key exists
Implements checking for if a value for a key exists