File tree 3 files changed +15
-21
lines changed 3 files changed +15
-21
lines changed Original file line number Diff line number Diff line change 75
75
"jest-worker" : " ^23.2.0" ,
76
76
"joi" : " 12.x.x" ,
77
77
"json-loader" : " ^0.5.7" ,
78
- "json-stream- stringify" : " ^2 .0.1" ,
78
+ "json-stringify-safe " : " ^5 .0.1" ,
79
79
"kebab-hash" : " ^0.1.2" ,
80
80
"lodash" : " ^4.17.10" ,
81
81
"md5" : " ^2.2.1" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const Redux = require(`redux`)
2
2
const _ = require ( `lodash` )
3
3
const fs = require ( `fs` )
4
4
const mitt = require ( `mitt` )
5
- const stringify = require ( `json-stream- stringify` )
5
+ const stringify = require ( `json-stringify-safe ` )
6
6
7
7
// Create event emitter for actions
8
8
const emitter = mitt ( )
@@ -78,21 +78,12 @@ const saveState = state => {
78
78
)
79
79
pickedState . components = mapToObject ( pickedState . components )
80
80
pickedState . nodes = mapToObject ( pickedState . nodes )
81
-
82
- const writeStream = fs . createWriteStream (
83
- `${ process . cwd ( ) } /.cache/redux-state.json`
81
+ const stringified = stringify ( pickedState , null , 2 )
82
+ fs . writeFile (
83
+ `${ process . cwd ( ) } /.cache/redux-state.json` ,
84
+ stringified ,
85
+ ( ) => { }
84
86
)
85
-
86
- new stringify ( pickedState , null , 2 , true )
87
- . pipe ( writeStream )
88
- . on ( `finish` , ( ) => {
89
- writeStream . destroy ( )
90
- writeStream . end ( )
91
- } )
92
- . on ( `error` , ( ) => {
93
- writeStream . destroy ( )
94
- writeStream . end ( )
95
- } )
96
87
}
97
88
const saveStateDebounced = _ . debounce ( saveState , 1000 )
98
89
Original file line number Diff line number Diff line change @@ -2965,6 +2965,14 @@ babel-plugin-macros@^2.4.2:
2965
2965
cosmiconfig "^5.0.5"
2966
2966
resolve "^1.8.1"
2967
2967
2968
+ babel-plugin-macros@^2.4.2:
2969
+ version "2.4.2"
2970
+ resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.4.2.tgz#21b1a2e82e2130403c5ff785cba6548e9b644b28"
2971
+ integrity sha512-NBVpEWN4OQ/bHnu1fyDaAaTPAjnhXCEPqr1RwqxrU7b6tZ2hypp+zX4hlNfmVGfClD5c3Sl6Hfj5TJNF5VG5aA==
2972
+ dependencies:
2973
+ cosmiconfig "^5.0.5"
2974
+ resolve "^1.8.1"
2975
+
2968
2976
babel-plugin-react-css-modules@^3.2.1:
2969
2977
version "3.4.2"
2970
2978
resolved "https://registry.yarnpkg.com/babel-plugin-react-css-modules/-/babel-plugin-react-css-modules-3.4.2.tgz#4c1db8d4bc8b2973f6c689da7dbd56b0cb8f099c"
@@ -11502,11 +11510,6 @@ json-stable-stringify@^1.0.0:
11502
11510
dependencies:
11503
11511
jsonify "~0.0.0"
11504
11512
11505
- json-stream-stringify@^2.0.1:
11506
- version "2.0.1"
11507
- resolved "https://registry.yarnpkg.com/json-stream-stringify/-/json-stream-stringify-2.0.1.tgz#8bc0e65ff94567d9010e14c27c043a951cb14939"
11508
- integrity sha512-5XymtJXPmzRWZ1UdLQQQXbjHV/E7NAanSClikEqORbkZKOYLSYLNHqRuooyju9W90kJUzknFhX2xvWn4cHluHQ==
11509
-
11510
11513
json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
11511
11514
version "5.0.1"
11512
11515
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
You can’t perform that action at this time.
0 commit comments