confeta-file
Advanced tools
Comparing version 1.0.6 to 1.0.8
@@ -24,2 +24,3 @@ 'use strict'; | ||
var $obj = Symbol('obj'); | ||
var $hasNoFile = Symbol('has-no-file'); | ||
@@ -32,2 +33,4 @@ var ConfetaFile = function () { | ||
this[$hasNoFile] = false; | ||
var parseFn = options.parseFn || JSON.parse; | ||
@@ -41,2 +44,6 @@ var obj = undefined; | ||
!_path2.default.isAbsolute(filePath) && (filePath = _path2.default.resolve(process.cwd(), options.path)); | ||
if (!_fs2.default.existsSync(filePath)) { | ||
this[$hasNoFile] = true; | ||
this[$obj] = {}; | ||
} | ||
@@ -52,2 +59,6 @@ obj = parseFn(_fs2.default.readFileSync(filePath, 'utf8')); | ||
value: function get(segments) { | ||
if (this[$hasNoFile]) { | ||
return; | ||
} | ||
var value = this[$obj]; | ||
@@ -54,0 +65,0 @@ |
{ | ||
"name": "confeta-file", | ||
"version": "1.0.6", | ||
"version": "1.0.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
108537
2830