Skip to content

Commit

Permalink
Revert "FIX: replace circular-json with flatted (#23)"
Browse files Browse the repository at this point in the history
This reverts commit 00f6892.
  • Loading branch information
royriojas committed Nov 7, 2018
1 parent 29df8a6 commit db12d74
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 430 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
- 0.12
- 4
- 6
- 8
- 10
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"npm run verify --silent"
],
"scripts": {
"beautify": "esbeautifier cache.js test/specs/**/*.js",
"beautify": "esbeautifier 'cache.js' 'test/specs/**/*.js'",
"beautify-check": "npm run beautify -- -k",
"eslint": "eslinter cache.js utils.js specs/**/*.js",
"eslint": "eslinter 'cache.js' 'utils.js' 'specs/**/*.js'",
"eslint-fix": "npm run eslint -- --fix",
"autofix": "npm run beautify && npm run eslint-fix",
"check": "npm run beautify-check && npm run eslint",
Expand Down Expand Up @@ -79,8 +79,8 @@
"watch-run": "^1.2.2"
},
"dependencies": {
"circular-json": "^0.3.1",
"del": "^3.0.0",
"flatted": "^2.0.0",
"graceful-fs": "^4.1.2",
"write": "^0.2.1"
}
Expand Down
10 changes: 5 additions & 5 deletions utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fs = require( 'graceful-fs' );
var write = require( 'write' );
var flatted = require( 'flatted' );
var circularJson = require( 'circular-json' );

module.exports = {

Expand All @@ -15,25 +15,25 @@ module.exports = {
},

/**
* Read json file synchronously using flatted
* Read json file synchronously using circular-json
*
* @method readJSON
* @param {String} filePath Json filepath
* @returns {*} parse result
*/
readJSON: function ( filePath ) {
return flatted.parse( fs.readFileSync( filePath ).toString() );
return circularJson.parse( fs.readFileSync( filePath ).toString() );
},

/**
* Write json file synchronously using flatted
* Write json file synchronously using circular-json
*
* @method writeJSON
* @param {String} filePath Json filepath
* @param {*} data Object to serialize
*/
writeJSON: function (filePath, data ) {
write.sync( filePath, flatted.stringify( data ) );
write.sync( filePath, circularJson.stringify( data ) );
}

};
Loading

0 comments on commit db12d74

Please sign in to comment.