         if exists
           fs.read path, 'r'
           .then (contents) =>
-            if _s.endsWith(normalizedPath, ".json")
+            if _.endsWith(normalizedPath, ".json")
               @_readJsonConfig "#{contents}"
             else
               @_readCsvConfig "#{contents}"

        throw new Error("Can't find credentials for project '#{credentials.project_key}'.")

  _normalizePath: (path) ->
    if not path? or _s.isBlank(path)
      throw new Error("Path is empty!")

    path.replace "~", @_getUserHome()

Q = require 'q'
fs = require 'q-io/fs'
{_} = require 'underscore'

_.mixin require('underscore.string')

csv = require 'csv'

