[minor] Use fs.existsSync when available

`path.exists*` was moved to `fs` module in
joyent/node@e10ed097cb.
This commit is contained in:
Maciej Małecki 2012-03-29 13:13:16 +02:00
parent d8c4749335
commit b3699314cf

View file

@ -9,7 +9,8 @@ var fs = require('fs'),
path = require('path'),
util = require('util'),
formats = require('../formats'),
Memory = require('./memory').Memory;
Memory = require('./memory').Memory,
existsSync = fs.existsSync || path.existsSync;
//
// ### function File (options)
@ -113,7 +114,7 @@ File.prototype.load = function (callback) {
File.prototype.loadSync = function () {
var data, self = this;
if (!path.existsSync(self.file)) {
if (!existsSync(self.file)) {
self.store = {};
data = {};
}