File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,15 @@ File.prototype._processJson = function(json) {
44
44
this . indent = determineWhitespace ( json ) ;
45
45
} ;
46
46
47
- File . prototype . write = function ( callback ) {
48
- var json = JSON . stringify ( this . data , null , this . indent ) ;
47
+ File . prototype . write = function ( callback , replacer , space ) {
48
+ var space = space || this . indent ,
49
+ json = JSON . stringify ( this . data , replacer , space ) ;
49
50
fs . writeFile ( this . path , json , callback ) ;
50
51
} ;
51
52
52
- File . prototype . writeSync = function ( ) {
53
- var json = JSON . stringify ( this . data , null , this . indent ) ;
53
+ File . prototype . writeSync = function ( replacer , space ) {
54
+ var space = space || this . indent ,
55
+ json = JSON . stringify ( this . data , replacer , space ) ;
54
56
fs . writeFileSync ( this . path , json ) ;
55
57
} ;
56
58
@@ -97,6 +99,6 @@ function determineWhitespace(contents) {
97
99
whitespace = match [ 1 ] . length ;
98
100
}
99
101
}
100
- }
102
+ } z
101
103
}
102
104
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-file" ,
3
- "version" : " 0.0 .0" ,
3
+ "version" : " 0.1 .0" ,
4
4
"description" : " A module for modifiying JSON files" ,
5
5
"main" : " lib/index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments