[minor] Use fs.existsSync
when available
`path.exists*` was moved to `fs` module in joyent/node@e10ed097cb.
This commit is contained in:
parent
d8c4749335
commit
b3699314cf
1 changed files with 3 additions and 2 deletions
|
@ -9,7 +9,8 @@ var fs = require('fs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
util = require('util'),
|
util = require('util'),
|
||||||
formats = require('../formats'),
|
formats = require('../formats'),
|
||||||
Memory = require('./memory').Memory;
|
Memory = require('./memory').Memory,
|
||||||
|
existsSync = fs.existsSync || path.existsSync;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ### function File (options)
|
// ### function File (options)
|
||||||
|
@ -113,7 +114,7 @@ File.prototype.load = function (callback) {
|
||||||
File.prototype.loadSync = function () {
|
File.prototype.loadSync = function () {
|
||||||
var data, self = this;
|
var data, self = this;
|
||||||
|
|
||||||
if (!path.existsSync(self.file)) {
|
if (!existsSync(self.file)) {
|
||||||
self.store = {};
|
self.store = {};
|
||||||
data = {};
|
data = {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue