[minor] Use `fs.existsSync` when available

`path.exists*` was moved to `fs` module in
joyent/node@e10ed097cb.
master
Maciej Małecki 2012-03-29 13:13:16 +02:00
parent d8c4749335
commit b3699314cf
1 changed files with 3 additions and 2 deletions

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 = {};
}