       dotty.put prop_obj.data, k, v for k, v of obj
     return cb null, prop_obj.data
 
-  clever+  clever

fs       = require 'fs'
_.mixin require('underscore.string').exports()
_.mixin require('understream').exports()

module.exports = (api_key, data_dir) ->
  throw new Error "Must provide api_key" unless api_key?


  sandbox.stub clever.Query.prototype, 'stream', () ->
    resource = _.strRightBack(@_url, '/')
    s = _(clever.db[resource]).stream()
      .map(apply_shadow_props)
      .map (raw_json) ->
        Klass = clever[_(resource).chain().capitalize().rtrim('s').value()]
        return new Klass raw_json
    process.nextTick () -> s.run((err) ->)
    return s.stream()

